/* HEPAMIDA — Home 3D (fondo oscuro, tipografía de campaña) */

:root {
  --verde: #6aa63d;
  --lima: #8cc63f;
  --violeta: #7a63b8;
  --fondo: #0a0d08;
  --texto: #f2f5ec;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Outfit', system-ui, sans-serif;
  color: var(--texto);
  background:
    radial-gradient(ellipse 70% 55% at 50% 48%, rgba(140, 198, 63, 0.10), transparent 65%),
    radial-gradient(ellipse 40% 35% at 78% 60%, rgba(122, 99, 184, 0.10), transparent 70%),
    radial-gradient(ellipse 100% 100% at 50% 120%, #10150c, transparent 60%),
    var(--fondo);
}

#stage { position: fixed; inset: 0; z-index: 1; }
#stage canvas { display: block; }

/* Titular gigante: cruza toda la pantalla, DETRÁS de los productos */
.headline {
  position: fixed;
  top: 17%;
  left: 0; right: 0;
  transform: translateY(-50%) scaleY(1.35);
  transform-origin: center;
  z-index: 0;                 /* debajo del canvas (z-index 1) */
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  font-family: 'Montserrat', 'Outfit', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 9.2vw;
  line-height: 1;
  letter-spacing: -0.012em;
  color: var(--verde);
}
.headline .alt { color: var(--texto); opacity: 0.9; }

/* Tarjetas de producto (hover) */
.product-card {
  position: fixed;
  top: 0; left: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease;
  text-align: center;
  padding: 12px 22px 14px;
  background: rgba(14, 18, 11, 0.82);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  border: 1px solid rgba(140, 198, 63, 0.28);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  will-change: transform, opacity;
}
.product-card.visible { opacity: 1; }

.product-card h2 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--lima);
  white-space: nowrap;
}
.product-card h2::after {
  content: '';
  display: block;
  width: 44px; height: 2px;
  margin: 7px auto 5px;
  background: var(--violeta);
  border-radius: 2px;
}
.product-card p {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: rgba(242, 245, 236, 0.75);
  white-space: nowrap;
}

/* Banderas pintadas: nacen fuera de pantalla */
.flag {
  position: fixed;
  z-index: 2;
  display: block;
  text-decoration: none;
  font-family: 'Permanent Marker', cursive;
  font-size: clamp(16px, 1.7vw, 25px);
  line-height: 1.18;
  color: #fff;
  text-shadow: 1px 2px 0 rgba(0, 0, 0, 0.35);
  padding: 20px 34px;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.55));
  transition: transform 0.3s ease;
  will-change: transform;
}
.flag::after {   /* salpicaduras de aerosol */
  content: '';
  position: absolute;
  inset: -14px;
  pointer-events: none;
  background:
    radial-gradient(circle 3px at 12% 18%, rgba(255,255,255,0.5), transparent 70%),
    radial-gradient(circle 2px at 88% 12%, rgba(255,255,255,0.45), transparent 70%),
    radial-gradient(circle 4px at 82% 86%, rgba(0,0,0,0.28), transparent 70%),
    radial-gradient(circle 2px at 22% 88%, rgba(255,255,255,0.4), transparent 70%);
}

.flag::after { opacity: 0.7; transition: opacity 0.3s, transform 0.3s; }
.flag:hover::after, .flag:focus-visible::after { opacity: 1; transform: scale(1.25); }

.flag-left {
  left: 0;
  top: 66%;
  padding-left: 30px;
  background: linear-gradient(100deg, #4c3a7d 0%, #6a55a4 100%);
  clip-path: polygon(0 0, 95% 3%, 100% 13%, 93% 25%, 99% 38%, 92% 51%, 100% 64%, 93% 77%, 98% 89%, 91% 100%, 0 100%);
  transform: translateX(-110%) rotate(-2.5deg);
  transition: transform 0.85s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.flag-left.in { transform: translateX(0) rotate(-2.5deg); }

.flag-right {
  right: 0;
  top: 63%;
  text-align: right;
  padding-right: 30px;
  background: linear-gradient(260deg, #57923a 0%, #74b04a 100%);
  clip-path: polygon(5% 3%, 100% 0, 100% 100%, 9% 100%, 2% 89%, 7% 77%, 0 64%, 8% 51%, 1% 38%, 7% 25%, 0 13%);
  transform: translateX(110%) rotate(2.5deg);
  transition: transform 0.85s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.flag-right.in { transform: translateX(0) rotate(2.5deg); }

/* intercambio de texto en la cinta */
.flag { position: fixed; }
.flag .t1, .flag .t2 { transition: opacity 0.3s ease; display: block; }
.flag .t1 .d { display: inline; }
.flag .t1 .m { display: none; }
.flag .t2 {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: inherit;
  opacity: 0;
}
.flag:hover .t1, .flag:focus-visible .t1 { opacity: 0; }
.flag:hover .t2, .flag:focus-visible .t2 { opacity: 1; }

.flag .t2 { flex-direction: column; gap: 8px; }
.flag .cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'Outfit', sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  padding: 7px 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
}
.flag .cta svg { width: 13px; height: 13px; fill: #fff; }

/* Globo de WhatsApp */
.wa-float {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 6;
  width: 58px; height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #25d366;
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.wa-float:hover { transform: scale(1.08); box-shadow: 0 14px 40px rgba(37, 211, 102, 0.5); }
.wa-float svg { width: 30px; height: 30px; fill: #fff; }

footer {
  position: fixed;
  bottom: 16px; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3vw, 44px);
  flex-wrap: wrap;
  text-align: center;
  pointer-events: none;
  z-index: 2;
  padding: 0 16px;
}
.footer-brand { pointer-events: none; }
.footer-brand { display: none; }  /* oculto en desktop, visible en mobile */
footer .brand {
  height: clamp(30px, 4.5vh, 42px);
  width: auto;
  display: block;
  margin: 0 auto 8px;
  filter: drop-shadow(0 2px 14px rgba(0,0,0,0.6));
}
footer p {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(242, 245, 236, 0.45);
}
.nav-group { display: flex; gap: 10px; pointer-events: auto; }
.nav-btn {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--texto);
  text-decoration: none;
  padding: 10px 18px;
  border: 1px solid rgba(242, 245, 236, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.nav-btn:hover, .nav-btn:focus-visible {
  color: var(--lima);
  border-color: var(--lima);
  background: rgba(140, 198, 63, 0.08);
}

@media (max-width: 820px) {
  .flag { font-size: 14px; padding: 14px 22px; }
  .flag-left { top: 68%; }
  .flag-right { top: 60%; }
  .nav-btn { font-size: 11px; padding: 8px 13px; }
}

.mobilebar, .mobile-menu { display: none; }

/* ---------- Mobile (portrait): composición re-armada ---------- */
@media (orientation: portrait) {
  .wa-float { bottom: 96px; }   /* despejar la cinta verde inferior */

  /* Tarjetas de producto: que no se corten contra el borde */
  .product-card { max-width: 80vw; }
  .product-card h2, .product-card p { white-space: normal; }

  /* Navbar superior: logo a la izquierda, hamburguesa a la derecha */
  .mobilebar {
    display: flex;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 5;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(10, 13, 8, 0.72);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(140, 198, 63, 0.15);
  }
  .mlogo { height: 30px; width: auto; }
  .burger {
    width: 42px; height: 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 0 8px;
    background: none;
    border: none;
    cursor: pointer;
  }
  .burger span {
    display: block;
    height: 2.5px;
    border-radius: 2px;
    background: var(--texto);
    transition: transform 0.3s, opacity 0.3s;
  }
  .burger.open span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
  .burger.open span:nth-child(2) { opacity: 0; }
  .burger.open span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

  .mobile-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 62px; right: 12px;
    z-index: 5;
    min-width: 230px;
    padding: 10px;
    gap: 4px;
    background: rgba(14, 18, 11, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(140, 198, 63, 0.25);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
  }
  .mobile-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .mobile-menu a {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--texto);
    text-decoration: none;
    padding: 13px 16px;
    border-radius: 10px;
  }
  .mobile-menu a:active { background: rgba(140, 198, 63, 0.12); color: var(--lima); }

  /* Slogan bajo la navbar, sin flotar en el vacío */
  .headline {
    white-space: normal;
    top: 21%;
    font-size: 11.5vw !important;
    line-height: 0.96;
    padding: 0 5vw;
    transform: translateY(-50%) scaleY(1.08);
  }

  /* Cintas a lo ancho: texto en una sola línea repartido, bien abajo */
  .flag {
    font-size: 17px;
    padding: 16px 6vw;
    max-width: none;
    width: 100%;
    text-align: center;
    line-height: 1.3;
  }
  /* versión mobile del texto (con espacios) reemplaza a la desktop (con br) */
  .flag .t1 .d { display: none; }
  .flag .t1 .m { display: inline; }
  .flag-left  { top: 74%; }
  .flag-right { top: 85.5%; }
  .flag-right { text-align: center; }

  /* En portrait la navegación vive en la hamburguesa */
  footer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .flag { transition: none; }
  .flag-left:hover, .flag-right:hover,
  .flag-left:focus-visible, .flag-right:focus-visible { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .product-card { transition: none; }
}
