/* ---------- Overlay (fondo oscurecido del pop-up) ---------- */
.avx-mm-overlay{
  position:fixed;
  inset:0;
  z-index:99999;
  background:rgba(20,16,30,.55);
  -webkit-backdrop-filter:blur(2px);
  backdrop-filter:blur(2px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:3vh 16px;
  overflow:auto;
  opacity:0;
  visibility:hidden;
  transition:opacity .22s ease, visibility .22s ease;
}
.avx-mm-overlay.is-open{ opacity:1; visibility:visible; }

/* ---------- Panel blanco del pop-up ---------- */
.avx-mm-popup{
  position:relative;
  background:#fff;
  border-radius:14px;
  box-shadow:0 24px 60px -12px rgba(20,16,30,.35);
  padding:54px;
  width:min(96vw,1260px);
  margin:auto;
  transform:translateY(8px) scale(.99);
  transition:transform .22s ease;
}
.avx-mm-overlay.is-open .avx-mm-popup{ transform:none; }

/* Botón EXPLORAR (abre el pop-up) */
.avx-mm-trigger{
  display:inline-flex !important;align-items:center !important;gap:12px !important;
  font-family:'Inter',sans-serif !important;font-size:18px !important;font-weight:700 !important;line-height:26px !important;
  letter-spacing:.05em !important;text-transform:uppercase !important;
  color:#3D3D3D !important;
  background:#DCC5F2 !important;
  border:2px solid #3D3D3D !important;
  border-radius:10px !important;
  padding:14px 28px !important;
  margin:24px !important;
  cursor:pointer !important;
  transition:background .22s ease, color .22s ease, border-color .22s ease;
  box-shadow:none !important;
  text-decoration:none !important;
}
.avx-mm-trigger__icon{ width:22px !important;height:22px !important;display:block !important;object-fit:contain;flex:0 0 auto; }
.avx-mm-trigger:hover{
  background:transparent !important;
  border-color:#DCC5F2 !important;
  color:#DCC5F2 !important;
  text-decoration:none !important;
}

/* ---------- Tokens ---------- */
.avx-megamenu{
  --avx-purple: #551D87;       /* cabeceras + iconos */
  --avx-title:  #454545;       /* títulos de categoría */
  --avx-text:   #6D6D6D;       /* subítems / listas */
  --avx-bullet: #b9b9b9;       /* viñetas */
  --avx-lime:   #E3F853;       /* botón */
  --avx-lime-ink:#222222;      /* texto del botón */
  --avx-stroke: #DCC5F2;       /* borde lavanda de tarjetas */
  --avx-rule:   #e6dff0;       /* línea bajo cabecera */
  --avx-bg-cats:#FAFAFA;       /* fondo tarjeta Categorías */
  --avx-bg-card:#F6F6F6;       /* fondo resto de tarjetas */

  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  container-type: inline-size;
  width:100%;
  position:relative;
  box-sizing:border-box;
  -webkit-font-smoothing:antialiased;
}
.avx-megamenu *,
.avx-megamenu *::before,
.avx-megamenu *::after{ box-sizing:border-box; }

/* ---------- Botón cerrar ---------- */
.avx-mm__close{
  position:absolute !important;
  top:12px !important;
  right:12px !important;
  width:34px !important;
  height:34px !important;
  border:1.5px solid #3D3D3D !important;
  border-radius:50% !important;
  background:#fff !important;
  color:#3D3D3D !important;
  display:flex !important;align-items:center !important;justify-content:center !important;
  cursor:pointer !important;
  padding:0 !important;
  z-index:2 !important;
  transition:.18s ease;
  box-shadow:none !important;
}
.avx-mm__close svg{ width:48%;height:48%; }
.avx-mm__close:hover{ background:#f4f4f4 !important; color:#3D3D3D !important; box-shadow:none !important; }

/* ---------- Rejilla principal (3 columnas, mismo alto) ---------- */
.avx-mm__grid{
  display:grid;
  grid-template-columns: 53fr 21fr 26fr;
  gap:1.4cqw;
  align-items:stretch;
}

/* ---------- Tarjeta base ---------- */
.avx-card{
  background:var(--avx-bg-card);
  border:1px solid var(--avx-stroke);
  border-radius:0.654cqw;            /* 8px @1224 */
  padding:1.55cqw 1.7cqw;
  display:flex;
  flex-direction:column;
}
.avx-card--cats{ background:var(--avx-bg-cats); }

/* Cabecera de sección  "* Título" */
.avx-card__head{
  display:block;
  font-size:1.144cqw;                /* 14px @1224 */
  font-weight:600;
  line-height:1.286;                 /* 18px */
  letter-spacing:.02em;              /* 2% */
  text-transform:none;
  text-align:left;
  color:var(--avx-purple);
  padding-bottom:1.0cqw;
  margin-bottom:1.15cqw;
  border-bottom:1px solid var(--avx-rule);
}
.avx-card__head::before{ content:"* "; }

/* ===================================================
   TARJETA 1 · CATEGORÍAS
   =================================================== */
.avx-cats{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:1.1cqw 1.4cqw;
  align-items:stretch;
  flex:1;                              /* llena el alto de la tarjeta */
}
.avx-cats__col{
  display:flex;
  flex-direction:column;
  justify-content:space-between;       /* reparte para no dejar huecos */
  gap:1.1cqw;
  height:100%;
}

.avx-cat__top{
  display:flex;
  align-items:center;
  gap:0.6cqw;
  margin-bottom:0.42cqw;
}
.avx-cat__icon{
  color:var(--avx-purple);
  flex:0 0 auto;
  width:1.55cqw;height:1.55cqw;
  min-width:16px;min-height:16px;
  display:flex;align-items:center;justify-content:center;
}
.avx-cat__icon svg{ width:100%;height:100%; display:block; }
.avx-cat__name{
  font-size:1.144cqw;                /* 14px @1224 */
  font-weight:600;
  letter-spacing:0;
  color:var(--avx-title);
  line-height:1.286;                 /* 18px */
}

.avx-list{ list-style:none; margin:0; padding:0; }
.avx-list li{
  position:relative;
  padding-left:1.0cqw;
  font-size:1.144cqw;                /* 14px @1224 */
  font-weight:400;
  letter-spacing:0;
  line-height:1.286;                 /* 18px */
  color:var(--avx-text);
  margin-bottom:0.45cqw;
}
.avx-list li::before{
  content:"";
  position:absolute;
  left:0; top:0.6cqw;
  width:0.33cqw;height:0.33cqw;
  min-width:4px;min-height:4px;
  border-radius:50%;
  background:var(--avx-bullet);
}

/* Botón CTA (al fondo de la 3ª columna) */
.avx-cta{
  margin-top:auto;
  align-self:stretch;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  background:var(--avx-lime);
  color:var(--avx-lime-ink);
  font-family:inherit;
  font-size:1.144cqw;                /* 14px @1224 */
  font-weight:600;
  letter-spacing:0;
  text-transform:none;
  white-space:nowrap;
  text-decoration:none;
  padding:0.98cqw;                   /* 12px @1224, 4 lados */
  border-radius:0.817cqw;            /* 10px @1224 */
  border:1px solid #D1D1D1;
  cursor:pointer;
  transition:background .2s ease, color .2s ease, border-color .2s ease;
}
.avx-cta:hover{
  background:var(--avx-lime-ink);    /* #222222 */
  color:var(--avx-lime);             /* #E3F853 */
  border-color:var(--avx-lime-ink);
}

/* ===================================================
   COLUMNA CENTRAL · FORMATOS + RUTAS
   =================================================== */
.avx-mm__mid{ display:flex; flex-direction:column; gap:1.4cqw; height:100%; }
.avx-mm__mid .avx-card{ flex:1; }       /* Formatos y Rutas llenan la columna */

/* Listas que deben repartirse para llenar la tarjeta (sin huecos) */
.avx-card--formatos .avx-list,
.avx-card--rutas .avx-list,
.avx-card--alianzas .avx-list{
  flex:1;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.avx-card--formatos .avx-list li,
.avx-card--rutas .avx-list li,
.avx-card--alianzas .avx-list li{ margin-bottom:0; }

.avx-card--rutas .avx-list li{ color:var(--avx-text); }
.avx-card--rutas .avx-list li b,
.avx-card--rutas .avx-list li strong{
  color:var(--avx-title);
  font-weight:600;
}

/* ===================================================
   RESPONSIVE  (@container sobre el ancho del widget)
   =================================================== */
@container (max-width: 900px){
  .avx-mm__grid{ grid-template-columns:1fr; gap:16px; }
  .avx-card{ border-radius:8px; padding:18px 20px; }
  .avx-card__head{ font-size:14px; line-height:18px; padding-bottom:12px; margin-bottom:14px; }

  .avx-cats{ grid-template-columns:repeat(2,1fr); gap:18px 22px; flex:none; }
  .avx-cats__col{ gap:18px; height:auto; justify-content:flex-start; }
  .avx-cat__icon{ width:18px;height:18px; }
  .avx-cat__name{ font-size:14px; line-height:18px; }
  .avx-list li{ font-size:14px; line-height:18px; padding-left:14px; margin-bottom:6px; }
  .avx-list li::before{ width:4px;height:4px; top:7px; }
  .avx-cta{ font-size:14px; padding:12px; border-radius:10px; margin-top:10px; white-space:normal; }

  /* en móvil las listas vuelven a flujo normal (sin reparto) */
  .avx-mm__mid{ height:auto; }
  .avx-mm__mid .avx-card{ flex:none; }
  .avx-card--formatos .avx-list,
  .avx-card--rutas .avx-list,
  .avx-card--alianzas .avx-list{ flex:none; display:block; }
  .avx-card--formatos .avx-list li,
  .avx-card--rutas .avx-list li,
  .avx-card--alianzas .avx-list li{ margin-bottom:6px; }
}
@container (max-width: 520px){
  .avx-cats{ grid-template-columns:1fr; }
}

/* Pop-up en pantallas pequeñas */
@media (max-width: 680px){
  .avx-mm-overlay{ align-items:flex-start; padding:12px; }
  .avx-mm-popup{ padding:12px; }
}

/* ── Header: ocultar top bar y subir nav bar al abrir el megamenú ──────────
   Solo escritorio (≥ 1025px). La variable --avxm-topbar-height se mide en JS
   para que la transición de max-height use exactamente la altura real.
   Al colapsar header_top, header_main sube en el flujo normal sin CSS extra.
── */
@media (min-width:1025px){
  #header > div.header_top{
    max-height:var(--avxm-topbar-height, 120px);
    overflow:hidden;
    transition:max-height .3s ease, opacity .3s ease;
  }
  body.avxm-menu-open #header > div.header_top{
    max-height:0 !important;
    opacity:0;
    pointer-events:none;
  }
}

/* ── Links dentro del megamenú: heredan color y tipografía, sin subrayado ── */
.avx-cat__top[href],
.avx-list a{
  color:inherit;
  text-decoration:none;
  font:inherit;
}
.avx-list a:hover{ text-decoration:underline; }

/* ── Breakpoint responsivo: ≤ 1024px = tablet / móvil ────────────────────── */
@media (max-width:1024px){
  /* Ocultar disparador y overlay del megamenú */
  .avx-mm-trigger{ display:none !important; }
  #avxMegamenu   { display:none !important; }
  /* Mostrar hamburguesa */
  .avxm-hamburger{ display:flex !important; }
}
@media (min-width:1025px){
  /* Ocultar hamburguesa, backdrop y panel del drawer */
  .avxm-hamburger{ display:none !important; }
  .avxm-backdrop { display:none !important; }
  #avxDrawer     { display:none !important; }
}
