.hgc-section,
.hgc-section * {
  box-sizing: border-box;
}

/* Fuerza el widget a ocupar todo el ancho de la ventana aunque el tema use contenedor boxed. */
.elementor-widget-hero_glass_carousel {
  --hgc-outer-top: 0px;
  --hgc-outer-right: 0px;
  --hgc-outer-bottom: 0px;
  --hgc-outer-left: 0px;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.elementor-widget-hero_glass_carousel > .elementor-widget-container {
  width: 100%;
  max-width: 100%;
}

.elementor-widget-hero_glass_carousel .hgc-section {
  width: calc(100vw - var(--hgc-outer-left) - var(--hgc-outer-right));
  max-width: calc(100vw - var(--hgc-outer-left) - var(--hgc-outer-right));
  margin: var(--hgc-outer-top) var(--hgc-outer-right) var(--hgc-outer-bottom) var(--hgc-outer-left);
}

.hgc-section {
  --hgc-pearl: #f5f5f2;
  --hgc-black: #101010;
  --hgc-glass-blur: 15px;
  --hgc-glass-saturate: 130%;
  --hgc-glass-brightness: 100%;
  --hgc-bg-image: none;
  --hgc-bg-image-tablet: var(--hgc-bg-image);
  --hgc-bg-image-mobile: var(--hgc-bg-image-tablet);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  max-height: 100dvh;
  position: relative;
  overflow: clip;
  background: var(--hgc-black);
  isolation: isolate;
}

.hgc-bg,
.hgc-overlay,
.hgc-content-wrap,
.hgc-carousel {
  position: absolute;
}

.hgc-bg,
.hgc-overlay,
.hgc-content-wrap {
  inset: 0;
}

.hgc-bg {
  z-index: 1;
  overflow: hidden;
  background-image: var(--hgc-bg-image);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.hgc-bg-img {
  /* La imagen real ya se aplica como background-image en .hgc-bg.
     Ocultamos el <img> auxiliar para evitar duplicados en preview responsive,
     donde Elementor/tema puede forzar height:auto sobre las imágenes. */
  display: none !important;
}

.hgc-bg-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
}

.hgc-overlay {
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.42), rgba(0,0,0,.08) 48%, rgba(0,0,0,.18));
}

.hgc-content-wrap {
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 4vw;
  pointer-events: none;
}

.hgc-content {
  --hgc-content-y: 0px;
  width: 100%;
  max-width: 22vw;
  display: flex;
  flex-direction: column;
  gap: 1.5vw;
  transform: translate(0px, var(--hgc-content-y));
  color: var(--hgc-pearl);
  pointer-events: auto;
}

.hgc-eyebrow,
.hgc-title,
.hgc-subtitle,
.hgc-description,
.hgc-card-eyebrow,
.hgc-card-title,
.hgc-card-description {
  margin: 0;
}

.hgc-eyebrow {
  color: var(--hgc-pearl);
  font-family: Nbarchitekproneue, "Inter Tight", Arial, sans-serif;
  font-size: clamp(10px, 0.7vw, 14px);
  line-height: 1.1;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hgc-title {
  color: var(--hgc-pearl);
  font-family: Magnetik, "Inter Tight", Arial, sans-serif;
  font-size: 3.5vw;
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.023em;
}

.hgc-subtitle {
  color: var(--hgc-pearl);
  font-family: "Roobert Regular", "Inter Tight", Arial, sans-serif;
  font-size: 1.45vw;
  line-height: 1.2;
  opacity: 0.82;
}

.hgc-description {
  color: var(--hgc-pearl);
  font-family: "Roobert Regular", "Inter Tight", Arial, sans-serif;
  font-size: 1.15vw;
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -0.01em;
  opacity: 0.6;
}

.hgc-carousel {
  --hgc-carousel-width: 100%;
  --hgc-carousel-offset-x: 0px;
  --hgc-card-safe-max: calc(100vw - 24px);
  z-index: 5;
  left: 50%;
  right: auto;
  bottom: 1.4vw;
  width: var(--hgc-carousel-width);
  max-width: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  transform: translateX(calc(-50% + var(--hgc-carousel-offset-x)));
}

.hgc-carousel.is-dragging {
  cursor: grabbing;
}

.hgc-track-wrap {
  width: 100%;
  overflow: visible;
}

.hgc-track {
  display: flex;
  align-items: stretch;
  padding-left: 0;
  padding-right: 0;
  will-change: transform;
  user-select: none;
}

.hgc-item {
  flex: 0 0 auto;
  padding-left: .5vw;
  padding-right: .5vw;
}

.hgc-card {
  position: relative;
  width: 28vw;
  max-width: var(--hgc-card-safe-max, calc(100vw - 24px));
  min-height: 17.5vw;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  gap: 2vw;
  overflow: hidden;
  padding: 2vw;
  border-radius: 2vw;
  color: var(--hgc-pearl);
  text-decoration: none;
  background-color: rgba(33, 33, 33, 0.35);
  background-image: linear-gradient(rgba(169, 194, 242, 0.08), rgba(98, 113, 140, 0.14));
  border: .1vw solid rgba(169, 194, 242, 0.10);
  backdrop-filter: blur(var(--hgc-glass-blur)) saturate(var(--hgc-glass-saturate)) brightness(var(--hgc-glass-brightness));
  -webkit-backdrop-filter: blur(var(--hgc-glass-blur)) saturate(var(--hgc-glass-saturate)) brightness(var(--hgc-glass-brightness));
}

.hgc-card:hover,
.hgc-card:focus {
  color: var(--hgc-pearl);
  text-decoration: none;
}

.hgc-card-top {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.hgc-card-text {
  display: flex;
  flex-direction: column;
  gap: .5vw;
  min-width: 0;
}

.hgc-card-eyebrow {
  color: var(--hgc-pearl);
  font-family: Nbarchitekproneue, "Inter Tight", Arial, sans-serif;
  font-size: clamp(10px, .7vw, 14px);
  line-height: 1.1;
  letter-spacing: .07em;
  text-transform: uppercase;
  opacity: .5;
}

.hgc-card-title {
  color: var(--hgc-pearl);
  font-family: Magnetik, "Inter Tight", Arial, sans-serif;
  font-size: 1.85vw;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0;
}

.hgc-card-description {
  position: relative;
  z-index: 2;
  color: var(--hgc-pearl);
  font-family: "Roobert Regular", "Inter Tight", Arial, sans-serif;
  font-size: .9vw;
  line-height: 1.22;
  letter-spacing: .01em;
  opacity: .6;
}

.hgc-card-icon {
  position: relative;
  z-index: 2;
  width: 15%;
  min-width: 15%;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.hgc-card-icon img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

.hgc-card-icon span,
.hgc-card-icon i,
.hgc-card-icon svg {
  display: block;
  line-height: 1;
}

.hgc-card-glow {
  position: absolute;
  z-index: 1;
  top: -3vw;
  right: -2vw;
  width: 8vw;
  height: 8vw;
  border-radius: 999px;
  opacity: .5;
  filter: blur(40px);
  pointer-events: none;
}

.hgc-arrow {
  position: absolute;
  z-index: 8;
  top: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  border: 1px solid rgba(245,245,242,.18);
  border-radius: 999px;
  color: var(--hgc-pearl);
  background-color: rgba(33,33,33,.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(-50%);
  cursor: pointer;
  transition: opacity .2s ease, transform .2s ease;
}

.hgc-arrow:hover {
  transform: translateY(-50%) scale(1.04);
}

.hgc-arrow-prev { left: 24px; }
.hgc-arrow-next { right: 24px; }

.hgc-arrow svg {
  width: 20px;
  height: 20px;
}

.hgc-hide-arrows .hgc-arrow {
  display: none;
}

.hgc-dots {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: -34px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
}

.hgc-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(245,245,242,.35);
  cursor: pointer;
  transition: opacity .2s ease, transform .2s ease, background-color .2s ease;
}

.hgc-dot.is-active {
  background: var(--hgc-pearl);
  transform: scale(1.2);
}

.hgc-hide-dots .hgc-dots {
  display: none;
}

@media (max-width: 1024px) {
  .hgc-bg {
    background-image: var(--hgc-bg-image-tablet);
  }
}

@media (max-width: 767px) {
  .hgc-bg {
    background-image: var(--hgc-bg-image-mobile);
  }

  .hgc-video-mobile-fallback .hgc-bg-video {
    display: none;
  }
}

@media (max-width: 1024px) {
  .hgc-content {
    max-width: 40vw;
  }

  .hgc-title {
    font-size: 5.2vw;
  }

  .hgc-subtitle {
    font-size: 2.2vw;
  }

  .hgc-description {
    font-size: 1.8vw;
  }

  .hgc-track {
    padding-left: 0;
  }

  .hgc-card {
    width: 42vw;
    min-height: 260px;
  }

  .hgc-card-title {
    font-size: 2.9vw;
  }

  .hgc-card-description {
    font-size: 1.55vw;
  }
}

@media (max-width: 767px) {
  .hgc-content-wrap {
    align-items: center;
    padding: 32px 4vw;
  }

  .hgc-content {
    max-width: 92%;
    gap: 14px;
    text-align: center;
  }

  .hgc-title {
    font-size: 46px;
    line-height: .95;
  }

  .hgc-subtitle {
    font-size: 19px;
  }

  .hgc-description {
    font-size: 16px;
    line-height: 1.35;
  }

  .hgc-carousel {
    bottom: 24px;
  }

  .hgc-track {
    padding-left: 0;
  }

  .hgc-item {
    padding-left: 6px;
    padding-right: 6px;
  }

  .hgc-card {
    width: 86vw;
    min-height: 280px;
    gap: 26px;
    padding: 22px;
    border-radius: 24px;
  }

  .hgc-card-text {
    gap: 8px;
  }

  .hgc-card-title {
    font-size: 28px;
  }

  .hgc-card-description {
    font-size: 15px;
    line-height: 1.35;
  }

  .hgc-card-icon {
    width: 52px;
    min-width: 52px;
  }

  .hgc-card-glow {
    width: 120px;
    height: 120px;
  }
}

.hgc-bg-iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 100vw;
  height: 56.25vw;
  min-width: 177.78vh;
  min-height: 100vh;
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}

.hgc-video-mobile-fallback .hgc-bg-iframe {
  display: block;
}

@media (max-width: 767px) {
  .hgc-video-mobile-fallback .hgc-bg-iframe {
    display: none !important;
  }
}


/* Audio toggle glass button - añadido sin alterar el carrusel */
.hgc-section {
  --hgc-audio-button-size: 46px;
  --hgc-audio-icon-size: 22px;
  --hgc-audio-offset-x: 22px;
  --hgc-audio-offset-y: 22px;
  --hgc-audio-glass-blur: 16px;
}

.hgc-audio-toggle {
  position: absolute;
  z-index: 7;
  width: var(--hgc-audio-button-size);
  height: var(--hgc-audio-button-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 999px;
  color: var(--hgc-pearl);
  background-color: rgba(255,255,255,.16);
  backdrop-filter: blur(var(--hgc-audio-glass-blur));
  -webkit-backdrop-filter: blur(var(--hgc-audio-glass-blur));
  box-shadow: 0 10px 28px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.22);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1;
  transition: transform .18s ease, opacity .18s ease;
}

.hgc-audio-toggle:hover,
.hgc-audio-toggle:focus-visible {
  transform: scale(1.04);
}

.hgc-audio-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.hgc-audio-position-bottom-right {
  right: var(--hgc-audio-offset-x);
  bottom: var(--hgc-audio-offset-y);
  top: auto;
  left: auto;
}

.hgc-audio-position-bottom-left {
  left: var(--hgc-audio-offset-x);
  bottom: var(--hgc-audio-offset-y);
  top: auto;
  right: auto;
}

.hgc-audio-position-top-right {
  right: var(--hgc-audio-offset-x);
  top: var(--hgc-audio-offset-y);
  bottom: auto;
  left: auto;
}

.hgc-audio-position-top-left {
  left: var(--hgc-audio-offset-x);
  top: var(--hgc-audio-offset-y);
  right: auto;
  bottom: auto;
}

.hgc-audio-icon {
  display: none;
  width: var(--hgc-audio-icon-size);
  height: var(--hgc-audio-icon-size);
  line-height: 0;
}

.hgc-audio-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.hgc-audio-toggle.is-muted .hgc-audio-icon-off,
.hgc-audio-toggle.is-on .hgc-audio-icon-on {
  display: block;
}

@media (max-width: 767px) {
  .hgc-section {
    --hgc-audio-button-size: 42px;
    --hgc-audio-icon-size: 20px;
    --hgc-audio-offset-x: 16px;
    --hgc-audio-offset-y: 16px;
  }

  .hgc-video-mobile-fallback .hgc-audio-toggle {
    display: none !important;
  }
}

/* ==========================================================================
   Altura "encaje exacto" (v1.3.0)
   La sección ocupa EXACTAMENTE el alto visible de la pantalla, en cualquier
   dispositivo, restando: márgenes exteriores, barra de admin de WordPress y
   el ajuste manual por dispositivo (p. ej. cabecera fija).
   Solo afecta a la ALTURA. Todo lo demás queda igual.
   ========================================================================== */
.elementor-widget-hero_glass_carousel {
  --hgc-fit-offset: 0px;   /* editable por dispositivo */
  --hgc-fit-min: 480px;    /* editable por dispositivo */
  --hgc-fit-max: 9999px;   /* editable por dispositivo */
  --hgc-adminbar: 0px;
}

body.admin-bar .elementor-widget-hero_glass_carousel { --hgc-adminbar: 32px; }
@media (max-width: 782px) {
  body.admin-bar .elementor-widget-hero_glass_carousel { --hgc-adminbar: 46px; }
}
/* En el editor de Elementor no hay barra de admin dentro del iframe */
body.elementor-editor-active .elementor-widget-hero_glass_carousel,
body.elementor-editor-preview .elementor-widget-hero_glass_carousel { --hgc-adminbar: 0px; }

.elementor-widget-hero_glass_carousel .hgc-section.hgc-smart-height,
.hgc-section.hgc-smart-height {
  --hgc-fit-h: calc(100vh - var(--hgc-outer-top, 0px) - var(--hgc-outer-bottom, 0px) - var(--hgc-adminbar, 0px) - var(--hgc-fit-offset, 0px));
  height: clamp(var(--hgc-fit-min), var(--hgc-fit-h), var(--hgc-fit-max)) !important;
  min-height: 0 !important;
  max-height: none !important;
}

/* svh = alto visible real con las barras del navegador móvil desplegadas
   (no salta al hacer scroll). Si el navegador lo soporta, se usa. */
@supports (height: 100svh) {
  .elementor-widget-hero_glass_carousel .hgc-section.hgc-smart-height,
  .hgc-section.hgc-smart-height {
    --hgc-fit-h: calc(100svh - var(--hgc-outer-top, 0px) - var(--hgc-outer-bottom, 0px) - var(--hgc-adminbar, 0px) - var(--hgc-fit-offset, 0px));
  }
}

/* Pantallas horizontales muy bajas (móvil tumbado): mínimo legible */
@media (max-height: 500px) and (orientation: landscape) {
  .elementor-widget-hero_glass_carousel { --hgc-fit-min: 420px; }
}
