/* =========================================================
   PGA — MENÚ MÓVIL 02 = el CSS que llevará el shortcode
   Solo el CONTENIDO del menú (niveles + Back + Contact).
   Vive dentro del contenedor de Elementor (#offcanvas-menu),
   que pone el fondo, la hamburguesa y la X.
   Cerrado: grupos con CONTADOR · activo = NARANJA + PUNTO.
   Todo va con ".pga-mm …" delante (2 clases) para ganarle al Kit
   de Elementor, que pinta botones y enlaces (.elementor-kit-9 button).
   ========================================================= */

.pga-mm {
  /* letras para FONDO OSCURO (por defecto) */
  --pga-mm-ink: rgba(255, 255, 255, .9);              /* grupos */
  --pga-mm-ink-strong: var(--idx-white);              /* hover, título */
  --pga-mm-ink-soft: var(--idx-on-dark-muted);        /* enlaces, Back, número */
  --pga-mm-line: rgba(255, 255, 255, .12);
  --pga-mm-chip: rgba(255, 255, 255, .08);            /* pastilla "5 ›" */
  --pga-mm-ease: cubic-bezier(.25, 1, .5, 1);
  --pga-mm-pad: 1.5rem;

  /* llena el contenedor de Elementor (que es flex en columna) */
  width: 100%;
  max-width: 30rem;
  min-height: 0;
  margin-inline: auto;
  flex: 1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  font-family: var(--idx-font-body), sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* letras para FONDO BLANCO */
.pga-mm[data-theme="white"] {
  --pga-mm-ink: #2F3B4A;
  --pga-mm-ink-strong: var(--idx-title);
  --pga-mm-ink-soft: var(--idx-text);
  --pga-mm-line: var(--idx-border);
  --pga-mm-chip: var(--idx-soft);
}

/* ── limpieza: lo que el Kit le pone a botones/enlaces/listas ── */
.pga-mm button,
.pga-mm a {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  text-shadow: none;
  letter-spacing: normal;
  text-decoration: none;
  cursor: pointer;
}

.pga-mm ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pga-mm .pga-mm__ico {
  display: block;
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── escenario: los niveles se apilan y se deslizan ── */
.pga-mm .pga-mm__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.pga-mm .pga-mm__level {
  position: absolute;
  inset: 0;
  padding: 1rem var(--pga-mm-pad) 2rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  visibility: hidden;
  transform: translateX(100%);
  transition: transform .4s var(--pga-mm-ease), opacity .3s ease, visibility 0s linear .4s;
}

.pga-mm .pga-mm__level.is-active {
  visibility: visible;
  transform: none;
  transition: transform .4s var(--pga-mm-ease), opacity .3s ease, visibility 0s;
}

.pga-mm .pga-mm__level.is-left {
  opacity: 0;
  transform: translateX(-30%);
}

/* ── NIVEL 1: grupos ── */
.pga-mm .pga-mm__list li { border-bottom: 1px solid var(--pga-mm-line); }

.pga-mm .pga-mm__group {
  position: relative;
  width: 100%;
  min-height: 3.75rem;                                /* 60 */
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--pga-mm-ink);
  font-family: var(--idx-font-body), sans-serif;
  font-size: 1.125rem;                                /* 18 */
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  text-align: start;
  transition: color .2s ease;
}

/* "tiene páginas adentro": cuántas + flecha */
.pga-mm .pga-mm__more {
  min-height: 2rem;
  padding: 0 .375rem 0 .75rem;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: .25rem;
  border-radius: 999px;
  background: var(--pga-mm-chip);
  color: var(--pga-mm-ink-soft);
  font-size: .8125rem;                                /* 13 */
  font-weight: 700;
  line-height: 1;
}

.pga-mm .pga-mm__more .pga-mm__ico {
  font-size: 1rem;
  color: var(--idx-primary);
  transition: transform .3s var(--pga-mm-ease);
}

/* ── NIVEL 2 ── */
.pga-mm .pga-mm__back {
  min-height: 2.75rem;
  margin-inline-start: -.375rem;
  padding: 0 .625rem 0 .25rem;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  border-radius: 6px;
  color: var(--pga-mm-ink-soft);
  font-family: var(--idx-font-body), sans-serif;
  font-size: .875rem;                                 /* 14 */
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  transition: color .2s ease;
}

.pga-mm .pga-mm__back .pga-mm__ico {
  font-size: 1.125rem;
  color: var(--idx-primary);
  transition: transform .3s var(--pga-mm-ease);
}

.pga-mm .pga-mm__title {
  margin: .5rem 0 .75rem;
  padding: 0;
  color: var(--pga-mm-ink-strong);
  font-family: var(--idx-font-title), sans-serif;
  font-size: 1.5rem;                                  /* 24 */
  font-weight: 600;
  line-height: 1.2;
}

.pga-mm .pga-mm__links li { border-bottom: 1px solid var(--pga-mm-line); }
.pga-mm .pga-mm__links li:last-child { border-bottom: 0; }

.pga-mm .pga-mm__link {
  position: relative;
  min-height: 3.25rem;                                /* 52 */
  padding: .625rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--pga-mm-ink-soft);
  font-family: var(--idx-font-body), sans-serif;
  font-size: 1rem;                                    /* 16 */
  font-weight: 500;
  line-height: 1.35;
  transition: color .2s ease;
}

.pga-mm .pga-mm__link .pga-mm__ico {
  font-size: 1rem;
  opacity: .35;
  transition: transform .3s var(--pga-mm-ease), opacity .2s ease, color .2s ease;
}

/* ── ACTIVO: naranja + punto en el margen (mismo en los 2 niveles) ── */
.pga-mm .pga-mm__group.is-current,
.pga-mm .pga-mm__link[aria-current="page"] { color: var(--idx-primary); }

.pga-mm .pga-mm__link[aria-current="page"] { font-weight: 600; }
.pga-mm .pga-mm__link[aria-current="page"] .pga-mm__ico { color: var(--idx-primary); opacity: 1; }

.pga-mm .pga-mm__group.is-current::before,
.pga-mm .pga-mm__link[aria-current="page"]::before {
  position: absolute;
  top: 50%;
  left: calc(-1 * var(--pga-mm-pad) / 2 - 3px);
  width: 6px;
  height: 6px;
  content: "";
  border-radius: 50%;
  background: var(--idx-primary);
  transform: translateY(-50%);
}

/* ── tocar / pasar ── */
.pga-mm .pga-mm__group:active .pga-mm__more .pga-mm__ico,
.pga-mm .pga-mm__link:active .pga-mm__ico { transform: translateX(3px); }

@media (hover: hover) {
  .pga-mm .pga-mm__group:hover:not(.is-current),
  .pga-mm .pga-mm__link:hover:not([aria-current]),
  .pga-mm .pga-mm__back:hover { color: var(--pga-mm-ink-strong); background: none; }
  .pga-mm .pga-mm__group:hover .pga-mm__more .pga-mm__ico { transform: translateX(3px); }
  .pga-mm .pga-mm__link:hover .pga-mm__ico { transform: translateX(3px); opacity: 1; color: var(--idx-primary); }
  .pga-mm .pga-mm__back:hover .pga-mm__ico { transform: translateX(-3px); }
}

/* ── Contact abajo ──
   SOLO en ≤340px: ahí el header de Elementor esconde su botón Contact
   (header-all #310, widget HTML: @media (max-width: 340px)
   [data-custom-class="btn-contact-nav-aea"] { display: none }).
   Si cambias ese corte en Elementor, cambia también este. */
.pga-mm .pga-mm__foot {
  display: none;
  flex: none;
  padding: 1rem var(--pga-mm-pad) calc(1rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--pga-mm-line);
}

.pga-mm .pga-mm__cta {
  width: 100%;
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: 6px;
  background: var(--idx-primary);
  color: var(--idx-white);
  font-family: var(--idx-font-body), sans-serif;
  font-size: .9375rem;                                /* 15 */
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  transition: background-color .2s ease;
}

.pga-mm .pga-mm__cta .pga-mm__ico { font-size: 1rem; stroke-width: 2.75; }

@media (hover: hover) {
  .pga-mm .pga-mm__cta:hover { background: var(--idx-primary-hover); color: var(--idx-white); }
}

.pga-mm .pga-mm__group:focus-visible,
.pga-mm .pga-mm__back:focus-visible,
.pga-mm .pga-mm__link:focus-visible,
.pga-mm .pga-mm__cta:focus-visible {
  outline: 2px solid var(--idx-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (max-width: 340px) {
  .pga-mm .pga-mm__foot { display: block; }
}

@media (min-width: 768px) {
  .pga-mm { --pga-mm-pad: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pga-mm .pga-mm__level { transition-duration: 0s; }
}

/* vuelta al nivel 1 sin animación (cuando el menú ya se cerró) */
.pga-mm.is-reset .pga-mm__level { transition: none !important; }

/* El widget Shortcode que contiene el menu llena su contenedor de Elementor. */
.elementor-widget-shortcode:has(> .elementor-shortcode > .pga-mm),
.elementor-shortcode:has(> .pga-mm) {
  flex: 1;
  width: 100%;
  min-height: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}
