/* =========================================================
   catalog-layout-feature-accordion.css (VAO) — CORREGIDO
   Layout: Feature + Panel Expandible
   - Más responsive en portátiles y alturas bajas
   - Modal estable
   - Botón X clicable
   - Menos rigidez en alturas
   ========================================================= */

/* =========================================================
   Screen
   ========================================================= */
.catalog-fa-screen{
  position: relative;
  min-height: 100svh;
  height: auto;
  max-height: none;
  overflow: visible;
  background: rgb(10,10,12);
}

.catalog-fa-screen__bg{
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.02);
}

.catalog-fa-screen__overlay{
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      110deg,
      rgba(10,10,12,0.90) 0%,
      rgba(10,10,12,0.74) 44%,
      rgba(158,23,32,0.26) 100%
    ),
    linear-gradient(
      180deg,
      rgba(255,255,255,0.06) 0%,
      rgba(255,255,255,0.00) 60%,
      rgba(255,255,255,0.05) 100%
    );
  pointer-events: none;
}

.catalog-fa-screen__inner{
  position: relative;
  z-index: 2;
  min-height: 100svh;
  height: auto;
  max-height: none;
  padding: 72px 24px 48px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  overflow: visible;
}

/* =========================================================
   Panel izquierdo
   ========================================================= */
.catalog-fa-panel{
  position: relative;
  width: min(620px, 90vw);
  margin-left: clamp(24px, 6vw, 140px);
  padding: 76px 56px 48px;
  box-sizing: border-box;

  background:
    linear-gradient(110deg, rgba(158,23,32,0.28) 0%, rgba(10,10,12,0.72) 70%),
    rgba(10,10,12,0.58);

  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 20px 46px rgba(0,0,0,0.20);
  overflow: visible;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* Decor squares */
.catalog-fa-squares{
  position: absolute;
  top: 22px;
  right: 22px;
  width: 64px;
  height: 64px;
  display: block;
  z-index: 3;
  pointer-events: none;
}
.catalog-fa-squares span{
  position: absolute;
  width: 22px;
  height: 22px;
  background: rgba(255,255,255,0.22);
}
.catalog-fa-squares span:nth-child(1){
  right: 0;
  top: 0;
  background: rgba(255,255,255,0.50);
}
.catalog-fa-squares span:nth-child(2){
  right: 22px;
  top: 22px;
  background: rgba(158,23,32,0.70);
}

/* Corner square */
.catalog-fa-corner{
  position: absolute;
  left: 0;
  bottom: 0;
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.44);
  z-index: 3;
  pointer-events: none;
}

.catalog-fa-title{
  margin: 0;
  font-weight: 300;
  font-size: clamp(40px, 4.2vw, 72px);
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: #fff;
  white-space: pre-line;
  text-shadow: 0 6px 22px rgba(0,0,0,0.30);
}

.catalog-fa-line{
  width: 100%;
  height: 2px;
  background: rgba(158,23,32,0.72);
  margin: 22px 0 26px;
}

.catalog-fa-text{
  font-size: clamp(16px, 1.25vw, 20px);
  line-height: 1.85;
  color: rgba(255,255,255,0.92);
  margin-bottom: 28px;
}
.catalog-fa-text p{
  margin: 0 0 14px;
}

/* CTA trigger */
.catalog-fa-trigger{
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  width: 100%;
  margin-top: 32px;
  padding: 22px 28px;
  border: 1px solid rgba(255,255,255,0.14);
  cursor: pointer;
  text-align: left;

  background:
    linear-gradient(110deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.00) 55%),
    rgba(10,10,12,0.40);

  box-shadow: 0 14px 28px rgba(0,0,0,0.18);
  line-height: 1.5;
  border-radius: 18px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  transition: transform .18s ease, filter .18s ease, border-color .18s ease;
  z-index: 4;
}
.catalog-fa-trigger:hover{
  transform: translateY(-1px);
  filter: brightness(1.02);
  border-color: rgba(255,255,255,0.18);
}

.catalog-fa-trigger__label{
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.94);
  line-height: 1.35;
}

.catalog-fa-trigger__icon{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(158,23,32,0.92);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  flex: 0 0 auto;
  transition: transform .18s ease, filter .18s ease, background-color .18s ease;
}
.catalog-fa-trigger:hover .catalog-fa-trigger__icon{
  transform: translateY(-1px);
  filter: brightness(1.03);
  background: rgba(158,23,32,0.98);
}

/* Bottom shading */
.catalog-fa-panel::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height: 120px;
  pointer-events:none;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(10,10,12,0.32) 100%);
  opacity: .65;
}

/* =========================================================
   Expanded panel (modal)
   ========================================================= */
.catalog-fa-expanded[hidden]{
  display:none !important;
}

.catalog-fa-expanded{
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 34px 18px;
  box-sizing: border-box;
  pointer-events: auto;

  background: radial-gradient(
    1200px 700px at 30% 20%,
    rgba(158,23,32,.18),
    rgba(10,10,12,.62) 55%,
    rgba(10,10,12,.78) 100%
  );
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.catalog-fa-expanded__panel{
  position: relative;
  width: min(980px, calc(100vw - 26px));
  max-height: min(90svh, 900px);

  background:
    linear-gradient(180deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,.03) 40%, rgba(255,255,255,.02) 100%),
    linear-gradient(120deg, rgba(158,23,32,.16) 0%, rgba(10,10,12,.88) 55%, rgba(10,10,12,.92) 100%);

  border: 1px solid rgba(255,255,255,.14);
  border-radius: 22px;
  box-shadow:
    0 30px 90px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.08);

  padding: 40px 44px 42px;
  overflow: hidden;
  pointer-events: auto;
}

.catalog-fa-expanded__panel::before{
  content:"";
  position:absolute;
  left:18px;
  right:18px;
  top:14px;
  height:2px;
  background: linear-gradient(
    90deg,
    rgba(158,23,32,.0),
    rgba(158,23,32,.75),
    rgba(158,23,32,.0)
  );
  opacity:.9;
  pointer-events:none;
}

/* Close X */
.catalog-fa-expanded__x{
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
  pointer-events: auto;

  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);

  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.94);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0;

  display: grid;
  place-items: center;

  box-shadow: 0 14px 34px rgba(0,0,0,.25);
  transition: transform .16s ease, background .16s ease, border-color .16s ease, filter .16s ease;
}
.catalog-fa-expanded__x:hover{
  transform: translateY(-1px);
  background: rgba(158,23,32,.22);
  border-color: rgba(158,23,32,.45);
  filter: brightness(1.05);
}
.catalog-fa-expanded__x:active{
  transform: translateY(0);
}

/* Fallback botón inferior */
.catalog-fa-expanded__close{
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: rgba(158,23,32,0.95);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 14px 30px rgba(0,0,0,0.22);
  transition: transform .18s ease, filter .18s ease, background-color .18s ease;
  z-index: 15;
}
.catalog-fa-expanded__close:hover{
  transform: translateX(-50%) translateY(-1px);
  filter: brightness(1.03);
  background: rgba(158,23,32,0.98);
}

.catalog-fa-expanded__title{
  margin: 8px 56px 0 0;
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.96);
  max-width: 820px;
}

.catalog-fa-expanded__line{
  height: 2px;
  background: rgba(158,23,32,0.75);
  margin: 16px 0 18px;
  border-radius: 999px;
  opacity: .9;
}

.catalog-fa-expanded__content{
  font-size: 15.5px;
  line-height: 1.7;
  color: rgba(255,255,255,.92);
  max-height: calc(90svh - 170px);
  overflow: auto;
  padding-right: 8px;
  overscroll-behavior: contain;
}
.catalog-fa-expanded__content p{
  margin: 0 0 14px;
}

.catalog-fa-expanded__content ul{
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}
.catalog-fa-expanded__content li{
  position: relative;
  padding: 18px 18px 18px 60px;

  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;

  box-shadow:
    0 14px 36px rgba(0,0,0,.22),
    inset 0 1px 0 rgba(255,255,255,.06);

  overflow: hidden;
  border-left: 3px solid rgba(158,23,32,.55);
}
.catalog-fa-expanded__content li::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(90deg, rgba(158,23,32,.14), rgba(0,0,0,0) 55%);
  pointer-events:none;
}
.catalog-fa-expanded__content li::before{
  content:"";
  position:absolute;
  left: 22px;
  top: 20px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.28), rgba(158,23,32,.95));
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
}

.catalog-fa-item__title{
  font-weight: 800;
  font-size: 17px;
}

/* Bloqueos seguros cuando está abierto */
body.catalog-fa-open{
  overflow: hidden;
}
body.catalog-fa-open .catalog-page-drag-wrap{
  pointer-events: none;
}
body.catalog-fa-open .catalog-fa-expanded{
  pointer-events: auto;
}

/* =========================================================
   Breakpoint extra para portátiles medianos
   ========================================================= */
@media (max-width: 1366px){
  .catalog-fa-screen__inner{
    padding: 64px 20px 40px;
  }

  .catalog-fa-panel{
    width: min(580px, 88vw);
    margin-left: clamp(20px, 5vw, 80px);
    padding: 60px 40px 36px;
  }

  .catalog-fa-title{
    font-size: clamp(38px, 3.8vw, 58px);
  }

  .catalog-fa-text{
    font-size: 18px;
    line-height: 1.75;
  }

  .catalog-fa-trigger{
    padding: 18px 22px;
  }

  .catalog-fa-trigger__label{
    font-size: 16px;
  }
}

/* =========================================================
   Tablet horizontal / laptops bajas
   ========================================================= */
@media (max-width: 1200px){
  .catalog-fa-screen__inner{
    align-items: flex-start;
  }

  .catalog-fa-panel{
    width: min(540px, 88vw);
    margin-left: clamp(16px, 4vw, 50px);
    padding: 52px 32px 30px;
  }

  .catalog-fa-title{
    font-size: clamp(34px, 3.6vw, 50px);
  }

  .catalog-fa-text{
    font-size: 17px;
    line-height: 1.7;
  }

  .catalog-fa-squares{
    transform: scale(.9);
    transform-origin: top right;
  }
}

/* =========================================================
   Responsive — Mobile/Tablet
   ========================================================= */
@media (max-width: 980px){
  .catalog-fa-screen{
    min-height: 100svh;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .catalog-fa-screen__inner{
    min-height: auto;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 74px 14px 34px;
    display: block;
  }

  .catalog-fa-panel{
    width: 100%;
    margin: 0;
    padding: 40px 18px 26px;
    overflow: visible;
  }

  .catalog-fa-title{
    font-size: clamp(34px, 7.2vw, 48px);
    line-height: 1.12;
    letter-spacing: 0.01em;
  }

  .catalog-fa-text{
    font-size: 16px;
    line-height: 1.75;
    margin-bottom: 18px;
  }

  .catalog-fa-trigger{
    position: sticky;
    bottom: 12px;
    width: 100%;
    margin-top: 18px;
    padding: 16px 16px;
    border-radius: 16px;
    background:
      linear-gradient(110deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.00) 60%),
      rgba(10,10,12,0.46);
    box-shadow:
      0 18px 40px rgba(0,0,0,0.26),
      inset 0 1px 0 rgba(255,255,255,0.08);
  }

  .catalog-fa-trigger__label{
    font-size: 13px;
    line-height: 1.25;
    letter-spacing: 0.05em;
  }

  .catalog-fa-trigger__icon{
    width: 42px;
    height: 42px;
    font-size: 22px;
  }

  .catalog-fa-squares{
    top: 14px;
    right: 14px;
    transform: scale(.85);
  }

  .catalog-fa-corner{
    width: 26px;
    height: 26px;
  }

  .catalog-fa-expanded{
    padding: 14px;
    place-items: end center;
  }

  .catalog-fa-expanded__panel{
    width: 100%;
    max-height: 88dvh;
    border-radius: 20px;
    padding: 22px 18px 18px;
  }

  .catalog-fa-expanded__close{
    display: none !important;
  }

  .catalog-fa-expanded__x{
    top: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .catalog-fa-expanded__title{
    margin-right: 54px;
    font-size: 18px;
    line-height: 1.35;
  }

  .catalog-fa-expanded__content{
    max-height: calc(88dvh - 130px);
  }

  .catalog-fa-expanded__content ul{
    gap: 10px;
  }

  .catalog-fa-expanded__content li{
    padding: 14px 14px 14px 50px;
    border-radius: 16px;
  }

  .catalog-fa-expanded__content li::before{
    left: 16px;
    top: 16px;
  }
}

/* =========================================================
   Teléfonos pequeños
   ========================================================= */
@media (max-width: 520px){
  .catalog-fa-screen__inner{
    padding: 40px 12px 28px;
  }

  .catalog-fa-panel{
    padding: 34px 14px 22px;
  }

  .catalog-fa-title{
    font-size: 34px;
  }

  .catalog-fa-text{
    font-size: 15px;
    line-height: 1.7;
  }

  .catalog-fa-trigger{
    padding: 14px 14px;
    border-radius: 16px;
  }

  .catalog-fa-trigger__label{
    font-size: 12px;
  }

  .catalog-fa-trigger__icon{
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .catalog-fa-expanded__panel{
    border-radius: 18px;
    padding: 18px 14px 14px;
  }

  .catalog-fa-expanded__content{
    max-height: calc(88dvh - 120px);
  }
}

/* =========================================================
   Alturas bajas
   ========================================================= */
@media (max-height: 760px){
  .catalog-fa-screen__inner{
    align-items: flex-start;
    padding-top: 48px;
    padding-bottom: 32px;
  }

  .catalog-fa-panel{
    padding-top: 46px;
    padding-bottom: 26px;
  }

  .catalog-fa-title{
    font-size: clamp(32px, 3.6vw, 48px);
  }

  .catalog-fa-text{
    font-size: 16px;
    line-height: 1.6;
  }

  .catalog-fa-trigger{
    margin-top: 20px;
    padding: 16px 18px;
  }

  .catalog-fa-expanded__panel{
    max-height: 92dvh;
  }

  .catalog-fa-expanded__content{
    max-height: calc(92dvh - 150px);
  }
}
/* =========================
   MODAL PRO FIX
   ========================= */

html.catalog-fa-open,
body.catalog-fa-open{
  overflow: hidden !important;
}

.catalog-fa-expanded{
  position: fixed !important;
  inset: 0;
  z-index: 2147483647 !important;
  display: grid;
  place-items: center;
}

/* X siempre arriba */
.catalog-fa-expanded__x{
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 9999999;
  cursor: pointer;
}

/* Desactiva header y admin bar */
body.catalog-fa-open #wpadminbar,
body.catalog-fa-open #masthead{
  pointer-events: none !important;
  opacity: 0.3;
}

/* Modal sigue funcionando */
.catalog-fa-expanded,
.catalog-fa-expanded *{
  pointer-events: auto;
}