/* ================= HOME (solo contenido) ================= */
.home{
  --card1: #0b2530;
  --card2: #122f3a;
  --shadow: 0 16px 40px rgba(0,0,0,.18);

  /* Deja ver el Fondo.png global (no tapar con blanco) */
  background: transparent;
  padding: 18px 0 60px;
}

/* =============== Carrusel principal =============== */
.home .hero-carousel{ padding: 10px 0 8px; }

.home .carousel{
  position: relative;
  border-radius: 18px;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.home .carousel-viewport{
  overflow: hidden;
  outline: none;
  border-radius: 18px;
  background:
    radial-gradient(1200px 420px at 18% 12%, rgba(255,255,255,.22), rgba(255,255,255,.06)),
    linear-gradient(135deg, var(--card1), var(--card2));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
  height: clamp(230px, 30vw, 380px);
}

.home .hero-img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  padding: 0;
  background: transparent;
  image-rendering: auto;
}

.home .carousel-track{
  display: flex;
  transition: transform .55s cubic-bezier(.2,.85,.2,1);
  will-change: transform;
  height: 100%;
}
.home .carousel-slide{ height: 100%; }

.home .carousel-slide{
  min-width: 100%;
  color: inherit;
  display: block;
  text-decoration: none;
  position: relative;
}

/* Skeleton loaders ligeros (carrusel + tarjetas) */
@keyframes homeShimmer{
  0%{ background-position: 100% 0; }
  100%{ background-position: 0 0; }
}

.home .carousel-slide::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background: linear-gradient(90deg,
    rgba(255,255,255,.06) 25%,
    rgba(255,255,255,.14) 37%,
    rgba(255,255,255,.06) 63%
  );
  background-size: 300% 100%;
  animation: homeShimmer 1.1s ease-in-out infinite;
  opacity: .85;
}

.home .carousel-slide img{ opacity:0; transition: opacity .22s ease; }
.home .carousel-slide.is-loaded::before{ display:none; }
.home .carousel-slide.is-loaded img{ opacity:1; }

.home .carousel-slide:focus-visible{
  outline: 3px solid rgba(199,162,74,.9);
  outline-offset: -3px;
}

.home .slide-inner{
  min-height: 290px;
  padding: 26px;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  align-items: center;
}

.home .slide-1{
  background:
    radial-gradient(1200px 500px at 20% 10%, rgba(199,162,74,.22), transparent 60%),
    radial-gradient(900px 360px at 90% 60%, rgba(140,235,255,.18), transparent 60%),
    linear-gradient(135deg, #071a2b, #0b2530);
}

.home .slide-2{
  background:
    radial-gradient(1000px 420px at 10% 40%, rgba(83,189,255,.22), transparent 55%),
    radial-gradient(900px 360px at 85% 15%, rgba(199,162,74,.18), transparent 60%),
    linear-gradient(135deg, #061821, #0a2a3a);
}

.home .slide-3{
  background:
    radial-gradient(1100px 420px at 35% 10%, rgba(199,162,74,.22), transparent 60%),
    radial-gradient(900px 360px at 95% 70%, rgba(83,189,255,.18), transparent 60%),
    linear-gradient(135deg, #071a2b, #122f3a);
}

.home .slide-copy{ color: #eef6ff; }

.home .slide-kicker{
  margin: 0 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(238,246,255,.82);
}

.home .slide-kicker::before{
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(199,162,74,.95);
  box-shadow: 0 0 0 4px rgba(199,162,74,.14);
}

.home .slide-title{
  margin: 0 0 10px;
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.home .slide-sub{
  margin: 0 0 14px;
  line-height: 1.55;
  max-width: 62ch;
  color: rgba(238,246,255,.80);
}

.home .slide-cta{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  font-weight: 900;
  color: rgba(238,246,255,.94);
}

.home .slide-illus{
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
}

.home .slide-right{
  position: relative;
  display: grid;
  align-items: center;
}

.home .slide-right .slide-badges{
  position: absolute;
  top: 14px;
  right: 14px;
}

.home .slide-right .slide-metric{
  position: absolute;
  bottom: 14px;
  right: 14px;
}

.home .slide-badges{
  display: grid;
  gap: 10px;
  justify-items: end;
}

.home .badge{
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  font-weight: 900;
  color: rgba(238,246,255,.92);
}

.home .slide-metric{
  display: flex;
  justify-content: flex-end;
}

.home .metric-card{
  width: min(280px, 100%);
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  box-shadow: 0 16px 32px rgba(0,0,0,.15);
  color: rgba(238,246,255,.92);
  display: grid;
  gap: 6px;
}

.home .metric-n{ font-size: 34px; font-weight: 1000; color: rgba(199,162,74,.95); }
.home .metric-t{ font-weight: 1000; letter-spacing: -.01em; }
.home .metric-s{ color: rgba(238,246,255,.75); font-weight: 700; }

.home .carousel-btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(7,26,43,.18);
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(8px);
  color: rgba(7,26,43,.95);
  font-size: 28px;
  font-weight: 1000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
  transition: transform .15s ease, opacity .15s ease, background .15s ease;
  z-index: 2;
}

.home .carousel-btn:hover{ background: rgba(255,255,255,.92); transform: translateY(-50%) scale(1.02); }
.home .carousel-btn:active{ opacity: .92; transform: translateY(-50%) scale(.98); }
.home .carousel-btn.prev{ left: -50px; }
.home .carousel-btn.next{ right: -50px; }

@media (max-width: 520px){
  .home .carousel-btn.prev{ left: 10px; }
  .home .carousel-btn.next{ right: 10px; }
}

.home .carousel-dots{
  position: static;
  transform: none;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px 0 0;
}

.home .carousel-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(7,26,43,.22);
  background: rgba(7,26,43,.10);
  cursor: pointer;
  padding: 0;
}

.home .carousel-dot.is-active{
  background: rgba(199,162,74,.95);
  border-color: rgba(199,162,74,.55);
  box-shadow: 0 0 0 4px rgba(199,162,74,.14);
}

/* =============== Carrusel de secciones (tarjetas) =============== */
.home .sections-carousel{ padding: 18px 0 10px; }

.home .section-head{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 8px;
}

.home .section-title{
  margin: 0;
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: -0.01em;
}

.home .section-sub{
  margin: 6px 0 0;
  color: rgba(7,26,43,.65);
}

.home .hcarousel{
  position: relative;
  display: block;
  overflow: visible;
}

.home .hviewport{
  overflow: hidden;
  outline: none;
  padding: 10px 14px 16px;
  width: 100%;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.home .hviewport.is-dragging{
  cursor: grabbing;
}

.home .htrack{
  display: flex;
  gap: 14px;
  padding: 6px 0;
  width: max-content;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  transition: transform 720ms cubic-bezier(.22,.61,.36,1);
}

.home .section-card{
  flex: 0 0 270px;
  min-width: 270px;
  max-width: 270px;
  height: 460px;
  border-radius: 18px;
  border: 1px solid rgba(7,26,43,.10);
  box-shadow: 0 14px 34px rgba(7,26,43,.10);
  padding: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: center;
  background: #0b2530;
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease, opacity .28s ease;
}

/* Fondo: imagen cubriendo TODO el cuadro */
.home .section-media{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  border: 0;
  background: #0b2530;
  z-index: 0;
}

.home .section-media::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background: linear-gradient(90deg,
    rgba(255,255,255,.05) 25%,
    rgba(255,255,255,.12) 37%,
    rgba(255,255,255,.05) 63%
  );
  background-size: 300% 100%;
  animation: homeShimmer 1.1s ease-in-out infinite;
  opacity: .65;
}

.home .section-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;         /* ✅ CORREGIDO (antes estaba roto por carácter raro) */
  object-position: center;
  display: block;
  opacity:0;
  transition: opacity .22s ease;
}

.home .section-media.is-loaded::before{ display:none; }
.home .section-media.is-loaded img{ opacity:1; }

.home .section-card::before{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 136px;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(3,12,20,.82) 0%,
    rgba(3,12,20,.52) 44%,
    rgba(3,12,20,0) 100%
  );
}

.home .section-card::after{
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      to bottom,
      rgba(255,255,255,0) 0%,
      rgba(255,255,255,.10) 50%,
      rgba(255,255,255,.94) 66%,
      rgba(255,255,255,.985) 100%
    ),
    linear-gradient(
      to bottom,
      rgba(0,0,0,.28) 0%,
      rgba(0,0,0,.18) 50%,
      rgba(0,0,0,.06) 72%,
      rgba(0,0,0,0) 100%
    );
}

.home .section-card h3{
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: min(calc(100% - 28px), 230px);
  min-height: 56px;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: clamp(14px, 1.15vw, 16px);
  line-height: 1.1;
  font-weight: 1000;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-wrap: balance;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  color: rgba(255,255,255,.98);
  background: rgba(4,10,18,.72);
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(6px);
  text-shadow: 0 3px 16px rgba(0,0,0,.55);
}

.home .section-card p{
  z-index: 2;
  margin: 0 18px 12px;
  color: rgba(7,26,43,.74);
  line-height: 1.4;
  font-weight: 800;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home .section-more{
  z-index: 2;
  position: relative;
  margin: 0 18px 18px;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 1000;
  background: rgba(11,37,48,.95);
  color: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 10px 22px rgba(0,0,0,.15);
}

.home .section-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 20px 46px rgba(7,26,43,.16);
  border-color: rgba(199,162,74,.35);
}

.home .section-card.is-active{
  border-color: rgba(199,162,74,.30);
  box-shadow: 0 18px 42px rgba(7,26,43,.15);
}

.home .section-card:focus-visible{
  outline: 3px solid rgba(199,162,74,.70);
  outline-offset: 3px;
}

.home .hbtn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(7,26,43,.12);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
  color: rgba(7,26,43,.95);
  font-size: 26px;
  font-weight: 1000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
  transition: transform .15s ease, opacity .15s ease;
  z-index: 2;
}

.home .hbtn:hover{ transform: translateY(-50%) scale(1.02); }
.home .hbtn:active{ opacity: .92; transform: translateY(-50%) scale(.98); }
.home .hbtn.prev{ left: -52px; }
.home .hbtn.next{ right: -52px; }

.home .hbtn[disabled]{ opacity: .45; cursor: not-allowed; transform: none; }

@media (max-width: 640px){
  .home .hviewport{
    padding-inline: 12px;
    scroll-padding-inline: 12px;
  }

  .home .section-card{
    flex-basis: min(330px, calc(100vw - 40px));
    min-width: min(330px, calc(100vw - 40px));
    max-width: min(330px, calc(100vw - 40px));
  }
}

/* CTA bar */
.home .home-cta{ padding: 10px 0 0; }

.home .cta-bar{
  margin: 0 auto;
  width: min(980px, 100%);
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
  border: 1px solid rgba(15,23,42,.08);
}

.home .cta-text{
  display:flex;
  flex-direction: column;
  gap: 4px;
  color: rgba(7,26,43,.65);
}

.home .cta-text strong{ color: rgba(7,26,43,.92); }

/* =============== Modal =============== */
body.modal-open{ overflow: hidden; }

.home .home-modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(7,26,43,.48);
  display: none;
  place-items: center;
  padding: 18px;
  z-index: var(--z-home-modal-backdrop, var(--z-modal-backdrop));

  /* ✅ iOS/Android: asegura centrado y evita “salirse” */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.home .home-modal-backdrop.is-open{
  display: grid;
}

.home .home-modal{
  width: min(560px, 96vw);
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(7,26,43,.12);
  box-shadow: 0 30px 90px rgba(0,0,0,.35);
  padding: 18px;
  position: relative;
  z-index: var(--z-home-modal, calc(var(--z-home-modal-backdrop, var(--z-modal-backdrop)) + 1));

  /* ✅ CLAVE: nunca más se “corta” */
  max-height: min(86dvh, 720px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.home .home-modal__close{
  position: sticky; /* ✅ se queda visible al hacer scroll dentro */
  top: 10px;
  float: right;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(7,26,43,.12);
  background: rgba(7,26,43,.04);
  font-size: 22px;
  font-weight: 1000;
  cursor: pointer;
  z-index: 5;
}

.home .home-modal__title{ margin: 6px 0 8px; font-size: 22px; letter-spacing: -0.01em; }
.home .home-modal__desc{
  margin: 0 0 16px;
  color: rgba(7,26,43,.70);
  line-height: 1.7;
  max-width: 60ch;
}

.home .home-modal__content{
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: #fff;
  box-shadow: inset 1px 0 0 rgba(7,26,43,.08);
}

.home .home-modal__text{
  padding: 24px 24px 14px;
}

.home .home-modal__benefits{
  margin-top: 18px;
}

.home .home-modal__benefitsTitle{
  margin: 0 0 10px;
  font-size: 16px;
}

.home .home-modal__benefitsList{
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
  color: rgba(7,26,43,.78);
  line-height: 1.55;
  max-width: 58ch;
}

.home .home-modal__benefitsList li{
  position: relative;
  padding-left: 20px;
}

.home .home-modal__benefitsList li::before{
  content: "•";
  position: absolute;
  left: 0;
  top: .08em;
  color: rgba(7,26,43,.58);
  font-size: 1.05em;
  line-height: 1;
}

.home .home-modal__actions{
  margin-top: auto;
  padding: 12px 24px 22px;
  border-top: 1px solid rgba(7,26,43,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.95), #fff);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 900px){
  .home .slide-inner{ grid-template-columns: 1fr; min-height: 0; }
  .home .slide-badges, .home .slide-metric{ justify-content: flex-start; }
  .home .slide-right .slide-badges,
  .home .slide-right .slide-metric{
    position: static;
    margin-top: 10px;
    justify-content: flex-start;
  }
  .home .carousel-btn{ display: none; }
  .home .hbtn{ display: none; }
  .home .cta-bar{ flex-direction: column; align-items: flex-start; }
}

/* Subnav hide (se usa en home) */
.subnav{
  transition: transform .25s ease, opacity .25s ease, max-height .25s ease, padding .25s ease;
  will-change: transform, opacity;
  max-height: 120px;
}

.subnav.is-hidden{
  transform: translateY(-120%);
  opacity: 0;
  pointer-events: none;
  max-height: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden;
}

@media (max-width: 640px){
  .home .hbtn{ width: 38px; height: 38px; font-size: 24px; }
}

/* Que el SVG no “baile” */
.home .carousel-btn svg,
.home .hbtn svg{
  width: 20px;
  height: 20px;
  display: block;
}

/* Modal split (imagen + beneficios) */
.home .home-modal--split{
  width: min(820px, 94vw);
  padding: 0;
  max-height: min(86dvh, 900px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.home .home-modal__grid{
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  min-height: min(560px, calc(86dvh - 2px));
}

.home .home-modal__media{
  background: linear-gradient(135deg, #071a2b, #0b2530);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 18px;
  overflow: hidden;
  min-height: 100%;
  height: auto;
  align-self: stretch;
}

.home .home-modal__media img{
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 820px){
  .home .home-modal-backdrop{
    padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px));
  }

  .home .home-modal--split{
    width: min(560px, 94vw);
    max-height: min(90dvh, 900px);
    padding-bottom: 0;
  }

  .home .home-modal__grid{
    grid-template-columns: 1fr;
  }

  .home .home-modal__media{
    padding: 14px 16px;
    min-height: 240px;
    height: auto;
  }

  .home .home-modal__content{
    box-shadow: none;
    border-top: 1px solid rgba(7,26,43,.08);
  }

  .home .home-modal__text{
    padding: 16px 16px 10px;
  }

  .home .home-modal__actions{
    gap: 12px;
    padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    justify-content: stretch;
  }

  .home .home-modal__actions .btn,
  .home .home-modal__actions a{
    flex: 1 1 100%;
    min-height: 44px;
  }
}

/* --- Mejora táctil (swipe) para el carrusel principal --- */
.hero-carousel .carousel-viewport{
  touch-action: pan-y;
}
.hero-carousel.is-dragging .carousel-track{
  cursor: grabbing;
}


@media (prefers-reduced-motion: reduce){
  .home .htrack{
    transition: none !important;
  }
}

.home .htrack.is-loop-jump{
  transition: none !important;
}
