/* ============================================================
   Interna de categoría — fondo con el color de cada categoría
   El color se define por página con la variable --cat-color.
   ============================================================ */

/* Logo en blanco sobre el banner oscuro de las categorías.
   Al hacer scroll (barra glass clara) vuelve al logo oscuro para que se vea. */
.site-brand__logo img {
  filter: brightness(0) invert(1);
  transition: filter .38s var(--mil976-ease);
}

.site-header.is-scrolled .site-brand__logo img {
  filter: none;
}

/* Sobre el banner (sin scroll): redes, hamburguesa y "Volver" en blanco,
   con vidrio más transparente para que el blanco resalte. Al hacer scroll
   (barra glass clara) vuelven a su estado oscuro por defecto. */
.site-header:not(.is-scrolled) .social-dot,
.site-header:not(.is-scrolled) .nav-toggle__box,
.site-header:not(.is-scrolled) .nav-back {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .62);
  transition: background .38s var(--mil976-ease), border-color .38s var(--mil976-ease), color .38s var(--mil976-ease);
}

.site-header:not(.is-scrolled) .social-dot,
.site-header:not(.is-scrolled) .nav-back {
  color: #fff;
}

.site-header:not(.is-scrolled) .nav-toggle__bar {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .28);
}

body {
  --cat-color: #85b2ca;
  margin: 0;
  min-height: 100vh;
  font-family: var(--mil976-font);
  font-weight: var(--mil976-weight-body);
  color: var(--mil976-title);
  /* Base sólida = sin cortes al final por más largo que sea el contenido. */
  background: var(--cat-color);
  -webkit-font-smoothing: antialiased;
}

/* Resplandor blanco fijo a la pantalla (no al scroll): da profundidad sin
   dejar la franja/corte que provocaba background-attachment: fixed en el body. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(75% 60% at 50% 40%, rgba(255, 255, 255, .6) 0%, rgba(255, 255, 255, .18) 42%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, 0) 55%);
}

/* Aire para el header y el footer fijos. */
.category-main {
  position: relative;
  padding-top: clamp(150px, 20vh, 210px);
  padding-bottom: clamp(44px, 6vw, 80px);
  padding-inline: clamp(20px, 5vw, 48px);
  overflow: hidden;
}

/* Burbuja decorativa difusa de fondo (aporta profundidad). */
.category-main::before {
  content: "";
  position: absolute;
  top: -10vh;
  right: -12vw;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .35), transparent 62%);
  pointer-events: none;
  animation: catBlob 14s ease-in-out infinite;
}

.category-wrap {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin-inline: auto;
}

/* --- Hero --- */
.category-hero {
  text-align: center;
  margin-bottom: clamp(34px, 6vw, 64px);
  animation: catFadeUp .7s var(--mil976-ease) both;
}

.category-hero__eyebrow {
  margin: 0 0 14px;
  color: var(--mil976-accent-strong);
  font-size: clamp(11px, 1.4vw, 13px);
  font-weight: 900;
  letter-spacing: .34em;
  text-transform: uppercase;
  opacity: .8;
}

.category-hero__title {
  margin: 0 auto;
  max-width: 16ch;
  color: var(--mil976-title);
  font-size: clamp(42px, 8vw, 92px);
  font-weight: 900;
  line-height: .96;
  letter-spacing: -.03em;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .35);
}

.category-hero__intro {
  margin: 18px auto 0;
  max-width: 52ch;
  color: var(--mil976-text);
  font-size: clamp(16px, 2vw, 20px);
  font-weight: var(--mil976-weight-body);
  line-height: 1.5;
}

/* --- Banner de categoría (hero full-width con el título encima) --- */
.category-banner {
  position: relative;
  /* Full-bleed sin transform (para no chocar con animaciones de transform):
     ocupa todo el ancho de la pantalla y sube a pegarse bajo la cabecera. */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: calc(-1 * clamp(150px, 20vh, 210px));
  margin-bottom: clamp(38px, 5vw, 64px);
  display: grid;
  place-items: center;
  min-height: clamp(360px, 46vw, 620px);
  overflow: hidden;
  animation: bannerFade .8s var(--mil976-ease) both;
}

@keyframes bannerFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.category-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.2s var(--mil976-ease);
}

.category-banner:hover img {
  transform: scale(1.04);
}

/* Overlay leve para que el título se lea sobre la foto. */
.category-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 68, 82, .34) 0%, rgba(6, 68, 82, .16) 42%, rgba(6, 68, 82, .46) 100%);
}

/* Título + eyebrow dentro del banner. */
.category-banner__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: clamp(24px, 5vw, 56px) clamp(20px, 5vw, 48px);
}

.category-banner__content .category-hero__eyebrow {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, .92);
  opacity: 1;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .3);
}

.category-banner__content .category-hero__title {
  color: #fff;
  text-shadow: 0 2px 22px rgba(0, 0, 0, .38);
}

/* --- Grid de productos (centrado y organizado con 3 o 4) --- */
.product-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(18px, 2.6vw, 30px);
}

.product-card {
  position: relative;
  flex: 1 1 240px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(22px, 3vw, 34px) clamp(16px, 2vw, 24px) clamp(20px, 2.4vw, 28px);
  border-radius: var(--mil976-radius);
  border: 1px solid rgba(255, 255, 255, .6);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .2));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .8),
    0 22px 48px rgba(6, 68, 82, .18);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  text-decoration: none;
  color: inherit;
  transform: translateY(28px);
  opacity: 0;
  animation: catFadeUp .6s var(--mil976-ease) forwards;
  transition: transform .4s var(--mil976-ease), box-shadow .4s ease;
}

.product-card:nth-child(1) { animation-delay: .10s; }
.product-card:nth-child(2) { animation-delay: .18s; }
.product-card:nth-child(3) { animation-delay: .26s; }
.product-card:nth-child(4) { animation-delay: .34s; }
.product-card:nth-child(5) { animation-delay: .42s; }
.product-card:nth-child(6) { animation-delay: .50s; }
.product-card:nth-child(7) { animation-delay: .58s; }
.product-card:nth-child(8) { animation-delay: .66s; }

.product-card:hover,
.product-card:focus-visible {
  transform: translateY(-8px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 32px 66px rgba(6, 68, 82, .26);
}

.product-card__media {
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.product-card__media img {
  /* Altura limitada con valor absoluto (no %) para que la botella nunca
     desborde la tarjeta ni se recorte. */
  max-height: clamp(190px, 22vw, 250px);
  max-width: 100%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 20px 22px rgba(6, 68, 82, .28));
  transition: transform .5s var(--mil976-ease);
}

.product-card:hover .product-card__media img,
.product-card:focus-visible .product-card__media img {
  transform: translateY(-6px) scale(1.04);
}

/* Tarjetas fotográficas: tile a sangre (3/4) con el nombre superpuesto. */
.product-card--photo {
  padding: 0;
  /* Proporción real de las fotos (616×925) para mostrarlas completas. */
  aspect-ratio: 616 / 925;
  overflow: hidden;
  align-items: stretch;
  justify-content: flex-end;
}

.product-card--photo .product-card__media {
  position: absolute;
  inset: 0;
  margin: 0;
  display: block;
  z-index: 0;
}

.product-card--photo .product-card__media img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  filter: none;
}

/* Variante Indi Z: botella recortada sobre fondo estudio, mismo formato. */
.product-card--bottle .product-card__media {
  background: linear-gradient(180deg, #6ba4ca 0%, #a9cfe3 58%, #e2eef4 100%);
}

.product-card--bottle .product-card__media img {
  object-fit: contain;
  padding: clamp(30px, 5vw, 54px) clamp(20px, 4vw, 40px) clamp(74px, 10vw, 112px);
  filter: drop-shadow(0 24px 26px rgba(6, 68, 82, .3));
}

/* Velo inferior para que el nombre se lea sobre la foto. */
.product-card--photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 62%, rgba(6, 68, 82, .04) 74%, rgba(6, 68, 82, .4) 100%);
}

.product-card--photo .product-card__name,
.product-card--photo .product-card__tag {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: left;
  padding-inline: clamp(18px, 2.4vw, 24px);
  color: #fff;
}

.product-card--photo .product-card__name {
  font-size: clamp(19px, 2.2vw, 24px);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 2px 16px rgba(0, 0, 0, .4);
}

.product-card--photo .product-card__tag {
  margin-top: 3px;
  padding-bottom: clamp(18px, 2.4vw, 26px);
  color: rgba(255, 255, 255, .88);
  opacity: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}

.product-card--photo:hover .product-card__media img,
.product-card--photo:focus-visible .product-card__media img {
  transform: scale(1.05);
}

.product-card__name {
  color: var(--mil976-title);
  font-size: clamp(16px, 1.9vw, 20px);
  font-weight: 900;
  letter-spacing: -.01em;
  text-align: center;
}

.product-card__tag {
  margin-top: 6px;
  color: var(--mil976-accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .8;
}

/* --- Animaciones --- */
@keyframes catFadeUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes catBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-3vw, 3vh) scale(1.06); }
}

/* --- Responsive --- */
@media (max-width: 520px) {
  .product-card { flex-basis: 100%; max-width: 360px; }
}

@media (prefers-reduced-motion: reduce) {
  .category-hero,
  .product-card {
    animation: none;
    transform: none;
    opacity: 1;
  }

  .category-main::before { animation: none; }
  .product-card__media img { transition: none; }
  .category-banner { animation: none; }
  .category-banner img { transition: none; }
  .category-banner:hover img { transform: none; }
}
