/* ================================================================
   INTENSITY · NAVIGATION + HERO
   Navbar editorial integrado, glass y scroll hint responsive
   ================================================================ */


/* ================================================================
   ATMÓSFERA SUPERIOR
   ================================================================ */

.nav-atmosphere {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  height: 124px;

  z-index: 99;
  pointer-events: none;

  /*
   * En la parte superior de la página la atmósfera es ligera.
   * No encierra al navbar ni crea una tarjeta flotante.
   */
  background:
    radial-gradient(
      ellipse 62% 100% at 18% -30%,
      rgba(224, 35, 21, 0.09),
      transparent 68%
    ),
    linear-gradient(
      to bottom,
      rgba(5, 5, 5, 0.8) 0%,
      rgba(5, 5, 5, 0.53) 48%,
      rgba(5, 5, 5, 0.16) 78%,
      transparent 100%
    );

  backdrop-filter: blur(3px) saturate(0.94);
  -webkit-backdrop-filter: blur(3px) saturate(0.94);

  mask-image:
    linear-gradient(
      to bottom,
      #000 0%,
      #000 45%,
      rgba(0, 0, 0, 0.76) 68%,
      transparent 100%
    );

  -webkit-mask-image:
    linear-gradient(
      to bottom,
      #000 0%,
      #000 45%,
      rgba(0, 0, 0, 0.76) 68%,
      transparent 100%
    );

  transition:
    background 0.5s var(--ease),
    backdrop-filter 0.5s var(--ease),
    -webkit-backdrop-filter 0.5s var(--ease);
}


/*
 * Al hacer scroll se refuerza el glass de borde a borde.
 * La geometría del nav no cambia, por lo que no existe ningún salto.
 */
.nav-atmosphere.is-scrolled {
  background:
    radial-gradient(
      ellipse 58% 100% at 16% -35%,
      rgba(224, 35, 21, 0.075),
      transparent 67%
    ),
    linear-gradient(
      to bottom,
      rgba(5, 5, 5, 0.985) 0%,
      rgba(6, 6, 6, 0.88) 46%,
      rgba(6, 6, 6, 0.48) 71%,
      transparent 100%
    );

  backdrop-filter: blur(15px) saturate(0.82);
  -webkit-backdrop-filter: blur(15px) saturate(0.82);
}


/*
 * Luz ambiental discreta detrás de la marca.
 * No es una línea ni un indicador de progreso.
 */
.nav-atmosphere::after {
  content: "";

  position: absolute;
  top: -44px;
  left: clamp(20px, 7vw, 110px);

  width: 260px;
  height: 125px;

  border-radius: 50%;

  background:
    radial-gradient(
      ellipse at center,
      rgba(224, 35, 21, 0.095),
      transparent 72%
    );

  filter: blur(28px);

  opacity: 0.62;

  transition:
    opacity 0.5s var(--ease),
    transform 0.6s var(--out);
}

.nav-atmosphere.is-scrolled::after {
  opacity: 0.42;
  transform: scale(0.88);
}


/* ================================================================
   NAVBAR PRINCIPAL
   ================================================================ */

nav.top,
nav.top.scrolled {
  --nav-control-size: 44px;

  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  width: 100%;
  max-width: none;
  min-height: 78px;
  margin: 0;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;

  /*
   * El nav ocupa todo el ancho, pero su contenido conserva aire.
   */
  padding:
    max(14px, env(safe-area-inset-top))
    clamp(22px, 4.2vw, 68px)
    12px;

  border: 0;
  border-bottom: 0;
  border-radius: 0;

  background: transparent;

  box-shadow: none;

  backdrop-filter: none;
  -webkit-backdrop-filter: none;

  overflow: visible;
  isolation: isolate;

  transition:
    color 0.35s var(--ease);
}


/*
 * El efecto de scroll vive en la atmósfera.
 * El navbar conserva exactamente su posición y dimensiones.
 */
nav.top.scrolled {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}


/* ================================================================
   MARCA
   ----------------------------------------------------------------
   La marca ahora es el logo lettering PNG de Alejandro
   (images/logo-intensity.png, plata sobre transparente).
   El PNG trae aire transparente alrededor del lettering
   (~20% arriba, ~33% abajo, ~10% por lado), así que se
   compensa con márgenes negativos: el alto de layout queda
   en ~46px (como los controles del nav) mientras el lettering
   se ve grande, centrado óptico y alineado al padding izquierdo.
   ================================================================ */

.brand-logo {
  display: block;

  height: 132px;
  width: auto;

  /* -33 arriba / -53 abajo: deja 46px de layout y baja el
     lettering (cuyo centro óptico está alto en el lienzo)
     hasta el centro real del nav. -18px izq. recorta el aire
     lateral del PNG contra el borde de la página. */
  margin: -33px 0 -53px -18px;

  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));

  transition: filter 0.4s var(--ease), transform 0.45s var(--out);
}

.brand:hover .brand-logo {
  filter:
    drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45))
    drop-shadow(0 0 18px rgba(241, 237, 228, 0.22));

  transform: scale(1.02);
}

.brand {
  position: relative;
  z-index: 2;

  min-width: 0;

  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 11px;

  font-family: "Anton", sans-serif;
  font-size: 21px;
  line-height: 1;
  letter-spacing: 0.075em;

  color: var(--cream);
}

.brand-name {
  font-family: "Anton", sans-serif;
  white-space: nowrap;
}

.brand-mark {
  position: relative;

  width: 30px;
  height: 30px;
  flex: 0 0 30px;

  display: grid;
  place-items: center;

  border: 1px solid rgba(241, 237, 228, 0.76);
  border-radius: 50%;

  background: rgba(9, 9, 9, 0.26);

  box-shadow:
    inset 0 0 0 3px rgba(0, 0, 0, 0.42),
    0 4px 18px rgba(0, 0, 0, 0.17);

  transition:
    border-color 0.3s var(--ease),
    background 0.3s var(--ease),
    transform 0.45s var(--out);
}

.brand-mark::before {
  content: "";

  position: absolute;
  inset: 5px;

  border: 1px solid rgba(241, 237, 228, 0.13);
  border-radius: inherit;
}

.brand-mark::after {
  content: "";

  width: 8px;
  height: 8px;

  border-radius: 50%;
  background: var(--red);

  box-shadow:
    0 0 0 3px rgba(224, 35, 21, 0.09),
    0 0 15px rgba(224, 35, 21, 0.48);

  transition:
    transform 0.4s var(--out),
    box-shadow 0.3s var(--ease);
}

.brand:hover .brand-mark {
  border-color: var(--cream);
  background: rgba(241, 237, 228, 0.04);
  transform: rotate(-12deg);
}

.brand:hover .brand-mark::after {
  transform: scale(1.18);

  box-shadow:
    0 0 0 4px rgba(224, 35, 21, 0.12),
    0 0 22px rgba(224, 35, 21, 0.72);
}

.brand-italic {
  margin-left: -5px;

  font-family: "Fraunces", serif;
  font-size: 16px;
  font-style: italic;
  font-weight: 400;
  line-height: 1;

  color: var(--text-soft);

  opacity: 0.74;
}


/* ================================================================
   LINKS DE ESCRITORIO
   ================================================================ */

.nav-links {
  position: absolute;
  top: 50%;
  left: 50%;

  display: flex;
  align-items: center;
  gap: clamp(21px, 2.3vw, 36px);

  /*
   * Ya no están encerrados dentro de otra cápsula.
   */
  padding: 0;

  border: 0;
  border-radius: 0;

  background: transparent;

  transform: translate(-50%, -50%);
}

.nav-links a {
  position: relative;

  padding: 9px 0;

  color: rgba(241, 237, 228, 0.58);

  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1;
  text-transform: uppercase;

  white-space: nowrap;

  transition:
    color 0.25s ease,
    opacity 0.25s ease;
}

.nav-links a:hover {
  color: var(--cream);
}

.nav-links a::after {
  left: 0;
  bottom: 3px;

  height: 1px;

  background: var(--red);
}


/* ================================================================
   CONTROLES DEL NAV
   ================================================================ */

.nav-right {
  position: relative;
  z-index: 2;

  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
}


/* ================================================================
   CARRITO
   ================================================================ */

.cart-btn {
  position: relative;

  min-height: var(--nav-control-size);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  padding: 0 36px 0 15px;

  border: 1px solid rgba(241, 237, 228, 0.12);
  border-radius: 999px;

  background: rgba(14, 14, 14, 0.34);
  color: var(--cream);

  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 7px 22px rgba(0, 0, 0, 0.12);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  transition:
    color 0.3s var(--ease),
    background 0.3s var(--ease),
    border-color 0.3s var(--ease),
    transform 0.3s var(--out),
    box-shadow 0.3s var(--ease);
}

nav.top.scrolled .cart-btn {
  background: rgba(19, 19, 19, 0.56);
  border-color: rgba(241, 237, 228, 0.145);
}

.cart-btn:hover {
  color: #080808;

  background: var(--cream);
  border-color: var(--cream);

  transform: translateY(-1px);

  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.29),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.cart-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-icon circle {
  fill: currentColor;
  stroke: none;
}

.cart-label {
  white-space: nowrap;
}

.cart-btn .count {
  position: absolute;
  top: 2px;
  right: 3px;

  min-width: 19px;
  height: 19px;
  padding: 0 5px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 2px solid #111;
  border-radius: 999px;

  background: var(--red);
  color: var(--cream);

  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;

  box-shadow:
    0 4px 11px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(224, 35, 21, 0.23);

  opacity: 1;
  transform: scale(1);
  transform-origin: center;

  transition:
    opacity 0.25s var(--ease),
    transform 0.35s var(--out);
}

.cart-btn .count[data-empty="true"] {
  opacity: 0;
  transform: scale(0.45);
}


/* ================================================================
   HAMBURGER
   ================================================================ */

.burger {
  position: relative;

  width: var(--nav-control-size);
  height: var(--nav-control-size);
  flex: 0 0 var(--nav-control-size);

  display: none;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(241, 237, 228, 0.12);
  border-radius: 50%;

  background: rgba(14, 14, 14, 0.34);
  color: var(--cream);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 7px 22px rgba(0, 0, 0, 0.12);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  transition:
    color 0.3s var(--ease),
    background 0.3s var(--ease),
    border-color 0.3s var(--ease),
    transform 0.35s var(--out),
    box-shadow 0.3s var(--ease);
}

nav.top.scrolled .burger {
  background: rgba(19, 19, 19, 0.56);
  border-color: rgba(241, 237, 228, 0.145);
}

.burger:hover {
  color: #080808;

  background: var(--cream);
  border-color: var(--cream);

  transform: rotate(4deg);

  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.29),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.burger-box {
  width: 19px;
  height: 14px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.burger-box span {
  width: 100%;
  height: 1.5px;

  display: block;

  border-radius: 999px;
  background: currentColor;

  transform-origin: center;

  transition:
    width 0.3s var(--out),
    opacity 0.2s ease,
    transform 0.35s var(--out);
}

.burger-box span:nth-child(2) {
  width: 72%;
  margin-left: auto;
}

.burger:hover .burger-box span:nth-child(2) {
  width: 100%;
}

.burger[aria-expanded="true"] .burger-box span:nth-child(1) {
  transform: translateY(6.25px) rotate(45deg);
}

.burger[aria-expanded="true"] .burger-box span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.burger[aria-expanded="true"] .burger-box span:nth-child(3) {
  transform: translateY(-6.25px) rotate(-45deg);
}


/* ================================================================
   FOCO DE TECLADO
   ================================================================ */

.brand:focus-visible,
.nav-links a:focus-visible,
.cart-btn:focus-visible,
.burger:focus-visible,
.mm-close:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 4px;
}


/* ================================================================
   MENÚ MÓVIL
   ================================================================ */

.mobile-menu {
  visibility: hidden;

  background:
    radial-gradient(
      circle at 84% 8%,
      rgba(224, 35, 21, 0.15),
      transparent 35%
    ),
    radial-gradient(
      circle at 8% 92%,
      rgba(241, 237, 228, 0.025),
      transparent 34%
    ),
    #090909;

  transition:
    transform 0.5s var(--ease),
    visibility 0s linear 0.5s;
}

.mobile-menu.open {
  visibility: visible;

  transition:
    transform 0.5s var(--ease),
    visibility 0s linear 0s;
}

.mm-close {
  border: 1px solid rgba(241, 237, 228, 0.13);

  background: rgba(255, 255, 255, 0.045);

  transition:
    background 0.3s var(--ease),
    border-color 0.3s var(--ease),
    transform 0.35s var(--out);
}

.mm-close:hover {
  background: var(--red);
  border-color: var(--red);
  transform: rotate(90deg);
}


/* ================================================================
   HERO Y SCROLL HINT
   ================================================================ */

.hero {
  min-height: 100vh;
  min-height: 100svh;

  padding-bottom: 150px;
}

.scroll-hint {
  bottom: max(26px, env(safe-area-inset-bottom));

  gap: 10px;

  color: rgba(168, 163, 154, 0.7);

  font-size: 12px;

  pointer-events: none;
}

.scroll-hint::after {
  height: 40px;

  background:
    linear-gradient(
      to bottom,
      rgba(224, 35, 21, 0),
      rgba(224, 35, 21, 0.95)
    );

  transform-origin: top;
}


/*
 * En pantallas bajas el hint entra al flujo normal.
 * Así nunca se monta sobre los botones del hero.
 */
@media (max-height: 760px) {
  .hero {
    height: auto;
    min-height: 100vh;
    min-height: 100svh;

    padding-bottom: 38px;
  }

  .scroll-hint {
    position: relative;
    left: auto;
    bottom: auto;

    margin-top: 28px;

    transform: none;
  }

  .scroll-hint::after {
    height: 34px;
  }
}


/* ================================================================
   TABLET
   ================================================================ */

@media (max-width: 1100px) {
  nav.top,
  nav.top.scrolled {
    --nav-control-size: 44px;

    min-height: 74px;

    padding:
      max(12px, env(safe-area-inset-top))
      22px
      10px;
  }

  .nav-links {
    display: none;
  }

  .burger {
    display: flex;
  }

  .cart-label {
    display: none;
  }

  .cart-btn {
    width: var(--nav-control-size);
    height: var(--nav-control-size);
    min-height: var(--nav-control-size);
    flex: 0 0 var(--nav-control-size);

    padding: 0;

    border-radius: 50%;
  }

  .cart-btn .count {
    top: -3px;
    right: -3px;

    min-width: 18px;
    height: 18px;

    font-size: 8px;
  }
}


/* ================================================================
   MÓVIL
   ================================================================ */

@media (max-width: 700px) {
  .nav-atmosphere {
    height: 112px;

    background:
      radial-gradient(
        ellipse 82% 100% at 10% -32%,
        rgba(224, 35, 21, 0.09),
        transparent 68%
      ),
      linear-gradient(
        to bottom,
        rgba(5, 5, 5, 0.84) 0%,
        rgba(5, 5, 5, 0.5) 50%,
        rgba(5, 5, 5, 0.13) 79%,
        transparent 100%
      );
  }

  .nav-atmosphere.is-scrolled {
    background:
      radial-gradient(
        ellipse 76% 100% at 10% -36%,
        rgba(224, 35, 21, 0.07),
        transparent 68%
      ),
      linear-gradient(
        to bottom,
        rgba(5, 5, 5, 0.99) 0%,
        rgba(6, 6, 6, 0.88) 49%,
        rgba(6, 6, 6, 0.42) 74%,
        transparent 100%
      );

    backdrop-filter: blur(13px) saturate(0.8);
    -webkit-backdrop-filter: blur(13px) saturate(0.8);
  }

  .nav-atmosphere::after {
    top: -40px;
    left: 15px;

    width: 190px;
    height: 110px;

    opacity: 0.48;
  }

  nav.top,
  nav.top.scrolled {
    --nav-control-size: 43px;

    min-height: 72px;

    padding:
      max(11px, env(safe-area-inset-top))
      18px
      9px;
  }

  .brand-logo {
    height: 118px;
    margin: -30px 0 -47px -16px;
  }

  .hero {
    height: auto;
    min-height: 100vh;
    min-height: 100svh;

    justify-content: center;

    padding:
      112px
      20px
      calc(34px + env(safe-area-inset-bottom));
  }

  .hero-cta {
    width: min(100%, 410px);
    gap: 12px;

    margin-top: clamp(36px, 5.2vh, 46px);
  }

  .btn-hero {
    min-width: 0;
  }

  .scroll-hint {
    position: relative;
    left: auto;
    bottom: auto;

    margin-top: 26px;

    transform: none;
  }

  .scroll-hint::after {
    height: 34px;
  }
}


/* ================================================================
   MÓVIL PEQUEÑO
   ================================================================ */

@media (max-width: 380px) {
  nav.top,
  nav.top.scrolled {
    --nav-control-size: 41px;

    min-height: 68px;

    padding:
      max(10px, env(safe-area-inset-top))
      14px
      8px;
  }

  .brand {
    gap: 8px;

    font-size: 19px;
    letter-spacing: 0.06em;
  }

  .brand-logo {
    height: 108px;
    margin: -27px 0 -43px -14px;
  }

  .brand-italic {
    display: none;
  }

  .nav-right {
    gap: 7px;
  }

  .cart-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .hero {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-cta {
    gap: 9px;
  }

  .btn-hero {
    padding: 16px 10px;

    font-size: 9.5px;
    letter-spacing: 0.09em;
  }

  .btn-hero.ghost .txt::before {
    display: none;
  }
}


/* ================================================================
   NAVBAR FUERA DEL HERO
   Barra negra sólida, sin blur, viñeta ni efectos ambientales
   ================================================================ */

.nav-atmosphere.is-past-hero {
  height: 78px;

  opacity: 1;

  background: #070707;

  backdrop-filter: none;
  -webkit-backdrop-filter: none;

  mask-image: none;
  -webkit-mask-image: none;

  box-shadow: none;
}


/*
 * Apagamos completamente el resplandor ambiental
 * cuando el navbar deja atrás el hero.
 */
.nav-atmosphere.is-past-hero::after {
  opacity: 0;
  transform: scale(0.7);
}


/*
 * En móvil la barra sólida coincide con la altura
 * de la navegación compacta.
 */
@media (max-width: 700px) {
  .nav-atmosphere.is-past-hero {
    height: calc(
      72px + env(safe-area-inset-top)
    );

    background: #070707;

    backdrop-filter: none;
    -webkit-backdrop-filter: none;

    mask-image: none;
    -webkit-mask-image: none;
  }
}

@media (max-width: 380px) {
  .nav-atmosphere.is-past-hero {
    height: calc(
      68px + env(safe-area-inset-top)
    );
  }
}


/* ================================================================
   MOVIMIENTO REDUCIDO
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
  .nav-atmosphere,
  .nav-atmosphere::after,
  .brand-mark,
  .brand-mark::after,
  .cart-btn,
  .cart-btn .count,
  .burger,
  .burger-box span,
  .mobile-menu,
  .mm-close {
    transition: none !important;
  }

  .scroll-hint::after {
    animation: none !important;
  }
}
