:root {
  --sg-azul: #2f8fe8;
  --sg-azul-claro: #5ba9ff;
  --sg-azul-oscuro: #162c9a;
  --sg-tinta: #1f2937;
  --sg-suave: #5b6472;
  --sg-curva: cubic-bezier(.22, .61, .36, 1);
}

html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

/* Barra superior: se compacta y gana sombra al bajar */
.site-header .navbar { transition: box-shadow .3s ease, padding .3s ease, background-color .3s ease; }
.site-header.compacta .navbar { box-shadow: 0 6px 20px rgba(22, 44, 154, .12); padding-top: 2px; padding-bottom: 2px; background-color: rgba(255, 255, 255, .92) !important; }
.site-header .navbar-brand img { transition: transform .3s var(--sg-curva); }
.site-header.compacta .navbar-brand img { transform: scale(.85); }
.site-header .nav-link { position: relative; }
.site-header .nav-link::after {
  content: ""; position: absolute; left: .5rem; right: .5rem; bottom: .2rem; height: 2px;
  background: var(--sg-azul); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--sg-curva);
}
.site-header .nav-link:hover::after { transform: scaleX(1); }

/* Portada */
.hero {
  position: relative; overflow: hidden; min-height: calc(100vh - 66px);
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 64px 16px 96px; color: #fff;
  background: linear-gradient(-45deg, var(--sg-azul-oscuro), var(--sg-azul), var(--sg-azul-claro), #7b6cf6);
  background-size: 400% 400%; animation: degradado 18s ease infinite;
}
@keyframes degradado { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.hero-contenido { position: relative; z-index: 1; max-width: 760px; }
.hero-saludo { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: .04em; margin-bottom: 12px; opacity: .95; }
.hero-logo {
  display: inline-block; background: #fff; border-radius: 28px; padding: 18px 34px;
  box-shadow: 0 20px 50px rgba(10, 20, 80, .3);
}
.hero-logo img { width: clamp(180px, 32vw, 300px); height: auto; display: block; animation: flotar 6s ease-in-out infinite; }
.hero-lema { font-size: clamp(1rem, 2.2vw, 1.25rem); margin: 28px auto 32px; max-width: 560px; opacity: .95; }
.hero-acciones { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn-hero {
  display: inline-block; padding: 12px 26px; border-radius: 999px; font-weight: 700; text-decoration: none;
  transition: transform .25s var(--sg-curva), box-shadow .25s ease, background-color .25s ease, color .25s ease;
}
.btn-hero:hover { transform: translateY(-3px); }
.btn-hero-principal { background: #fff; color: var(--sg-azul-oscuro); box-shadow: 0 10px 24px rgba(10, 20, 80, .25); }
.btn-hero-principal:hover { color: var(--sg-azul-oscuro); box-shadow: 0 16px 30px rgba(10, 20, 80, .35); }
.btn-hero-secundario { color: #fff; border: 2px solid rgba(255, 255, 255, .85); }
.btn-hero-secundario:hover { color: var(--sg-azul-oscuro); background: #fff; }

/* Burbujas que suben (reutiliza la idea de .circles) */
.hero-burbujas { position: absolute; inset: 0; margin: 0; padding: 0; overflow: hidden; }
.hero-burbujas li {
  position: absolute; display: block; list-style: none; bottom: -160px; width: 20px; height: 20px;
  background: rgba(255, 255, 255, .16); border-radius: 30%; animation: subir 25s linear infinite;
}
.hero-burbujas li:nth-child(1)  { left: 25%; width: 80px;  height: 80px;  animation-delay: 0s; }
.hero-burbujas li:nth-child(2)  { left: 10%; animation-delay: 2s; animation-duration: 12s; }
.hero-burbujas li:nth-child(3)  { left: 70%; animation-delay: 4s; }
.hero-burbujas li:nth-child(4)  { left: 40%; width: 60px;  height: 60px;  animation-duration: 18s; }
.hero-burbujas li:nth-child(5)  { left: 65%; animation-delay: 0s; }
.hero-burbujas li:nth-child(6)  { left: 75%; width: 110px; height: 110px; animation-delay: 3s; }
.hero-burbujas li:nth-child(7)  { left: 35%; width: 150px; height: 150px; animation-delay: 7s; }
.hero-burbujas li:nth-child(8)  { left: 50%; width: 25px;  height: 25px;  animation-delay: 15s; animation-duration: 45s; }
.hero-burbujas li:nth-child(9)  { left: 20%; width: 15px;  height: 15px;  animation-delay: 2s;  animation-duration: 35s; }
.hero-burbujas li:nth-child(10) { left: 85%; width: 150px; height: 150px; animation-duration: 11s; }
@keyframes subir {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-1100px) rotate(720deg); opacity: 0; border-radius: 50%; }
}

.hero-bajar { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 1; width: 30px; height: 48px; border: 2px solid rgba(255, 255, 255, .85); border-radius: 18px; }
.hero-bajar span { position: absolute; top: 9px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #fff; animation: rueda 1.8s ease-in-out infinite; }
@keyframes rueda { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(20px); opacity: 0; } 100% { opacity: 0; } }

@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Entrada al cargar */
.entrada { opacity: 0; transform: translateY(24px); animation: aparecer .9s var(--sg-curva) forwards; animation-delay: var(--retraso, 0s); }
@keyframes aparecer { to { opacity: 1; transform: none; } }

/* Secciones */
.seccion { padding: 88px 16px; max-width: 1140px; margin: 0 auto; text-align: center; }
.seccion-titulo { font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--sg-azul-oscuro); margin-bottom: 8px; }
.seccion-subtitulo { color: var(--sg-suave); font-size: 1.1rem; margin-bottom: 40px; }

.video-marco {
  position: relative; max-width: 820px; margin: 0 auto; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(22, 44, 154, .2);
}
.video-marco iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Tarjetas de producto */
.productos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; text-align: center; }
@media (max-width: 767px) { .productos { grid-template-columns: 1fr; } }

.producto {
  border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; padding: 40px 28px 0;
  transition: transform .35s var(--sg-curva), box-shadow .35s ease;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}
.producto:hover { transform: translateY(-8px); box-shadow: 0 22px 46px rgba(15, 23, 42, .18); }
.producto h3 { font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 10px; }
.producto p { font-size: 1.1rem; margin-bottom: 28px; }
.producto-oscuro { background: #1f2329; color: #fff; }
.producto-claro { background: #f3f6fa; color: var(--sg-tinta); }
.producto-azul { background: linear-gradient(135deg, var(--sg-azul), var(--sg-azul-oscuro)); color: #fff; }
.producto-imagen {
  margin-top: auto; height: 240px; border-radius: 18px 18px 0 0; overflow: hidden; background: #fff;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, .12);
}
.producto-imagen img { width: 100%; height: 100%; object-fit: contain; padding: 12px; transition: transform .6s var(--sg-curva); }
.producto:hover .producto-imagen img { transform: scale(1.06); }

/* Aparición al bajar (la activa nav.js) */
.js .revelar { opacity: 0; transform: translateY(40px); transition: opacity .8s var(--sg-curva), transform .8s var(--sg-curva); transition-delay: var(--retraso, 0s); }
.js .revelar.visible { opacity: 1; transform: none; }
.js .producto.revelar.visible:hover { transform: translateY(-8px); transition-delay: 0s; }

/* Mascota */
.mascota { position: fixed; right: 0; bottom: 0; height: 15%; z-index: 20; animation: flotar 4s ease-in-out infinite; cursor: pointer; }

/* Quien prefiere menos movimiento lo ve todo quieto */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .entrada, .js .revelar { opacity: 1 !important; transform: none !important; }
}
