/* PGA — Barra de las Pestañas nativas de Elementor (e-tabs) en el tour: diseño cerrado de la maqueta
   (pga/tour-tabs-bar.css). Gancho: data-class="tt-tabs" en las Pestañas; data-class="tt-aside" en la columna
   del formulario de la plantilla. Los iconos los pone tabs.js según el nombre de la tab.
   Variables que mide tabs.js en :root: --tt-top (alto del menú del sitio pegado), --tt-bar-h (alto de la barra). */

:root { --tt-top: 0px; --tt-bar-h: 5.5rem; }

.elementor [data-class~="tt-tabs"] { gap: 0; padding: 0; }
.elementor [data-class~="tt-tabs"] > .e-tabs-content-area-base { padding: 0; }

/* ── Barra: el menú de las Pestañas, pegado bajo el menú del sitio ── */
.elementor [data-class~="tt-tabs"] > .e-tabs-menu-base {
  position: sticky;
  top: var(--tt-top);
  z-index: 20;
  margin: 0 0 2.5rem;
  padding: .3125rem 0;
  display: flex;
  justify-content: flex-start;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  background: var(--idx-white);
  box-shadow: inset 0 -1px 0 var(--idx-border);
  transition: top .5s cubic-bezier(.22, 1, .36, 1), margin-bottom .35s cubic-bezier(.22, 1, .36, 1);
}
.elementor [data-class~="tt-tabs"] > .e-tabs-menu-base::-webkit-scrollbar { display: none; }

/* pegada: fondo blanco de borde a borde de la pantalla + línea + sombra suave, también de borde a borde.
   Son sombras (la barra se desliza de lado en celular y recortaría una capa aparte). Cada una se estira 100vmax
   a los lados y hacia ARRIBA pero no hacia abajo (desplazada -100vmax con 100vmax de extensión): así la blanca,
   que se dibuja encima, no tapa la línea gris (1px más abajo) ni la sombra suave. clip-path corta lo de arriba. */
.elementor [data-class~="tt-tabs"] > .e-tabs-menu-base.is-stuck {
  box-shadow:
    0 -100vmax 0 100vmax var(--idx-white),
    0 calc(1px - 100vmax) 0 100vmax var(--idx-border),
    0 calc(3px - 100vmax) 10px 100vmax var(--idx-shadow);
  clip-path: inset(0 -100vmax -16px);
}

/* compu: la barra a todo el ancho, también encima de la columna del formulario (20rem + 2rem de separación) */
@media (min-width: 1025px) {
  .elementor [data-class~="tt-tabs"] > .e-tabs-menu-base { width: calc(100% + 22rem); max-width: none; }   /* Elementor fija width:100% en sus contenedores */
  .elementor [data-class~="tt-aside"] {
    margin-top: calc(var(--tt-bar-h) + 2.5rem);
    top: calc(var(--tt-top) + var(--tt-bar-h) + 1.5rem);
  }
}

/* ── Cada tab: círculo con icono arriba + nombre + barrita bajo el nombre ── */
.elementor [data-class~="tt-tabs"] .e-tab-base {
  flex: 1 1 0;
  width: auto;
  min-width: 6.25rem;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: .4375rem;
  padding: .625rem .5rem calc(.5625rem + 6px);
  border: 0;
  border-radius: 12px;
  outline-offset: -2px;
  background: transparent;
  color: var(--idx-text);
  font-family: var(--idx-font-title), sans-serif;
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: color .25s ease, background-color .25s ease, padding .35s cubic-bezier(.22, 1, .36, 1), gap .35s cubic-bezier(.22, 1, .36, 1);
}
.elementor [data-class~="tt-tabs"] .e-tab-base:focus-visible { outline: 2px solid var(--idx-secondary); }
.elementor [data-class~="tt-tabs"] .e-tab-base > .e-paragraph-base {
  position: relative;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

/* círculo del icono: el SVG nativo de la tab (e-svg) o, si no trae, el que pone tabs.js (.tt-tab__ic) */
.elementor [data-class~="tt-tabs"] .e-tab-base > .e-svg-base {
  order: -1;                                  /* siempre ARRIBA del nombre, aunque en Elementor esté después del texto */
  box-sizing: border-box;
  width: 2.625rem;
  height: 2.625rem;
  padding: .6875rem;
  display: block;
  border-radius: 50%;
  background: var(--idx-soft);
  color: var(--idx-secondary);
  transition: background-color .25s ease, color .25s ease, width .35s cubic-bezier(.22, 1, .36, 1), height .35s cubic-bezier(.22, 1, .36, 1), padding .35s cubic-bezier(.22, 1, .36, 1);
}
.elementor [data-class~="tt-tabs"] .e-tab-base > .e-svg-base svg {
  display: block; width: 100%; height: 100%;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;   /* e-svg pone fill="currentColor" */
}
.elementor [data-class~="tt-tabs"] .e-tab-base[aria-selected="true"] > .e-svg-base { background: var(--idx-secondary); color: var(--idx-white); }
@media (hover: hover) {
  .elementor [data-class~="tt-tabs"] .e-tab-base:not([aria-selected="true"]):hover > .e-svg-base { background: var(--idx-secondary-soft); }
}
.elementor [data-class~="tt-tabs"] > .is-stuck .e-tab-base > .e-svg-base { width: 2.125rem; height: 2.125rem; padding: .53rem; }
@media (max-width: 767px) {
  .elementor [data-class~="tt-tabs"] .e-tab-base > .e-svg-base { width: 2.125rem; height: 2.125rem; padding: .53rem; }
  .elementor [data-class~="tt-tabs"] > .is-stuck .e-tab-base > .e-svg-base { width: 1.75rem; height: 1.75rem; padding: .41rem; }
}

.elementor [data-class~="tt-tabs"] .tt-tab__ic {
  order: -1;
  width: 2.625rem;
  height: 2.625rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--idx-soft);
  transition: background-color .25s ease, width .35s cubic-bezier(.22, 1, .36, 1), height .35s cubic-bezier(.22, 1, .36, 1);
}
.elementor [data-class~="tt-tabs"] .tt-tab__ico {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--idx-secondary);
  transition: color .25s ease, width .35s cubic-bezier(.22, 1, .36, 1), height .35s cubic-bezier(.22, 1, .36, 1);
}

/* barrita bajo el nombre */
.elementor [data-class~="tt-tabs"] .e-tab-base > .e-paragraph-base::after {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  width: 1.25rem;
  height: 3px;
  margin-left: -.625rem;
  border-radius: 3px;
  content: "";
  background: var(--idx-secondary);
  transform: scaleX(0);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}

/* activa: casilla gris azulado, círculo azul con icono blanco, barrita */
.elementor [data-class~="tt-tabs"] .e-tab-base[aria-selected="true"] { background: var(--idx-soft); color: var(--idx-title); }
.elementor [data-class~="tt-tabs"] .e-tab-base[aria-selected="true"] .tt-tab__ic { background: var(--idx-secondary); }
.elementor [data-class~="tt-tabs"] .e-tab-base[aria-selected="true"] .tt-tab__ico { color: var(--idx-white); }
.elementor [data-class~="tt-tabs"] .e-tab-base[aria-selected="true"] > .e-paragraph-base::after { transform: none; }
@media (hover: hover) {
  .elementor [data-class~="tt-tabs"] .e-tab-base:not([aria-selected="true"]):hover { background: var(--idx-soft-light); color: var(--idx-title); }
  .elementor [data-class~="tt-tabs"] .e-tab-base:not([aria-selected="true"]):hover .tt-tab__ic { background: var(--idx-secondary-soft); }
}

/* pegada: círculo e icono más chicos, barra más baja; lo que encoge (18px) se suma abajo para que nada salte */
.elementor [data-class~="tt-tabs"] > .e-tabs-menu-base.is-stuck { margin-bottom: calc(2.5rem + 18px); }
.elementor [data-class~="tt-tabs"] > .is-stuck .e-tab-base { gap: .3125rem; padding-block: .375rem calc(.3125rem + 6px); }
.elementor [data-class~="tt-tabs"] > .is-stuck .tt-tab__ic { width: 2.125rem; height: 2.125rem; }
.elementor [data-class~="tt-tabs"] > .is-stuck .tt-tab__ico { width: 1.0625rem; height: 1.0625rem; }

/* ── Celular: barra de borde a borde, compacta y deslizable ── */
@media (max-width: 767px) {
  .elementor [data-class~="tt-tabs"] > .e-tabs-menu-base {
    width: calc(100% + 40px);   /* de borde a borde (Elementor fija width:100%) */
    max-width: none;
    margin-inline: -20px;
    padding: .25rem 20px;
    scroll-padding-inline: 20px;
  }
  .elementor [data-class~="tt-tabs"] .e-tab-base {
    flex: none;
    min-width: 5.25rem;
    gap: .3125rem;
    padding: .375rem .5rem calc(.375rem + 6px);
    font-size: .6875rem;
  }
  .elementor [data-class~="tt-tabs"] .tt-tab__ic { width: 2.125rem; height: 2.125rem; }
  .elementor [data-class~="tt-tabs"] .tt-tab__ico { width: 1.0625rem; height: 1.0625rem; }
  .elementor [data-class~="tt-tabs"] .e-tab-base > .e-paragraph-base::after { top: calc(100% + 4px); }

  .elementor [data-class~="tt-tabs"] > .e-tabs-menu-base.is-stuck { margin-bottom: calc(2.5rem + 11px); clip-path: none; box-shadow: 0 6px 8px -6px var(--idx-shadow); }
  .elementor [data-class~="tt-tabs"] > .is-stuck .e-tab-base { gap: .25rem; padding-block: .25rem calc(.25rem + 6px); }
  .elementor [data-class~="tt-tabs"] > .is-stuck .tt-tab__ic { width: 1.75rem; height: 1.75rem; }
  .elementor [data-class~="tt-tabs"] > .is-stuck .tt-tab__ico { width: .9375rem; height: .9375rem; }
}

/* ── Secciones: la que quedó solo con su título (el widget no pintó nada porque el campo está vacío) se oculta ── */
.elementor .idx-tt-section:not(:has(> :not(h1, h2, h3, h4, h5, h6))),
.elementor .idx-tt-half:not(:has(> :not(h1, h2, h3, h4, h5, h6))) { display: none; }
/* la pareja Incluye | No incluye cuando las dos quedaron vacías (si no, deja el hueco del espacio entre secciones) */
.elementor .idx-tt-pair:not(:has(> * > :not(h1, h2, h3, h4, h5, h6))) { display: none; }

/* ── Pestañas: la que no tiene contenido en su panel (todas sus secciones vacías) se oculta — sin JS, sin salto ──
   Se pregunta al revés: "las Pestañas NO tienen contenido en el panel N" → :not(:has(...)).
   (CSS no permite un :has dentro de otro :has; así hay uno solo. Navegador sin :has → ignora la regla y muestra todo.)
   En el editor el widget vacío pinta su aviso (.pga-tt), así que allí todas las pestañas se ven. Hasta 8 pestañas. */
.elementor [data-class~="tt-tabs"]:not(:has(> .e-tabs-content-area-base > .e-tab-content-base:nth-child(1) :is(.pga-tt, img, iframe, video, p, ul, ol, table, form))) > .e-tabs-menu-base > .e-tab-base:nth-child(1),
.elementor [data-class~="tt-tabs"]:not(:has(> .e-tabs-content-area-base > .e-tab-content-base:nth-child(2) :is(.pga-tt, img, iframe, video, p, ul, ol, table, form))) > .e-tabs-menu-base > .e-tab-base:nth-child(2),
.elementor [data-class~="tt-tabs"]:not(:has(> .e-tabs-content-area-base > .e-tab-content-base:nth-child(3) :is(.pga-tt, img, iframe, video, p, ul, ol, table, form))) > .e-tabs-menu-base > .e-tab-base:nth-child(3),
.elementor [data-class~="tt-tabs"]:not(:has(> .e-tabs-content-area-base > .e-tab-content-base:nth-child(4) :is(.pga-tt, img, iframe, video, p, ul, ol, table, form))) > .e-tabs-menu-base > .e-tab-base:nth-child(4),
.elementor [data-class~="tt-tabs"]:not(:has(> .e-tabs-content-area-base > .e-tab-content-base:nth-child(5) :is(.pga-tt, img, iframe, video, p, ul, ol, table, form))) > .e-tabs-menu-base > .e-tab-base:nth-child(5),
.elementor [data-class~="tt-tabs"]:not(:has(> .e-tabs-content-area-base > .e-tab-content-base:nth-child(6) :is(.pga-tt, img, iframe, video, p, ul, ol, table, form))) > .e-tabs-menu-base > .e-tab-base:nth-child(6),
.elementor [data-class~="tt-tabs"]:not(:has(> .e-tabs-content-area-base > .e-tab-content-base:nth-child(7) :is(.pga-tt, img, iframe, video, p, ul, ol, table, form))) > .e-tabs-menu-base > .e-tab-base:nth-child(7),
.elementor [data-class~="tt-tabs"]:not(:has(> .e-tabs-content-area-base > .e-tab-content-base:nth-child(8) :is(.pga-tt, img, iframe, video, p, ul, ol, table, form))) > .e-tabs-menu-base > .e-tab-base:nth-child(8) { display: none; }

/* ── Menú del sitio que se esconde al bajar (tabs.js, clase html.pga-nav-hidden; solo en los tours) ── */
.elementor-location-header #nav-container { transition: transform .5s cubic-bezier(.22, 1, .36, 1), background-color .3s ease, box-shadow .3s ease; }
html.pga-nav-hidden .elementor-location-header #nav-container { transform: translateY(-100%); }
.elementor [data-class~="tt-aside"] { transition: top .5s cubic-bezier(.22, 1, .36, 1); }   /* el formulario sube junto con la barra */
@media (prefers-reduced-motion: reduce) {
  .elementor-location-header #nav-container, .elementor [data-class~="tt-aside"] { transition: none; }
}
