/* Color principal actualizado para la identidad de marca. */
:root {
  --gold: #f6b616;
}

/* Logo amplio sobre el hero y compacto cuando aparece la barra. */
.brand img {
  width: 150px;
  transform: translateY(20px);
  transition: width .3s ease, transform .3s ease;
}

.site-header.scrolled .brand img {
  width: 96px;
  transform: translateY(0);
}

/* Encuadre adaptado al póster y futuro video: parrillero izquierda, producto derecha. */
.hero {
  background-image: url('public/images/hero-parrillero-chorizos.png');
}

.hero-video {
  object-position: center;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(5,5,5,.48) 0%, rgba(8,8,8,.84) 28%, rgba(8,8,8,.78) 62%, rgba(8,8,8,.22) 100%),
    linear-gradient(0deg, rgba(8,8,8,.72), transparent 45%);
}

.hero-content {
  padding-left: clamp(190px, 18vw, 260px);
}

@media (max-width: 820px) {
  .brand img { width: 105px; }
  .site-header.scrolled .brand img { width: 76px; }
  .hero-content { padding-left: 0; }
  .hero-video { object-position: 58% center; }
  .hero-overlay {
    background:
      linear-gradient(90deg, rgba(5,5,5,.9), rgba(5,5,5,.55)),
      linear-gradient(0deg, #090909b8, transparent);
  }
}

/* Carrusel continuo, contenido dentro del margen general de la página. */
.product-carousel {
  position: relative;
}

.product-carousel-viewport {
  width: 100%;
  overflow: hidden;
}

.product-grid.carousel-track {
  --carousel-gap: 18px;
  --carousel-card-width: calc((min(1180px, 100vw - 40px) - (var(--carousel-gap) * 2)) / 3);
  display: flex;
  grid-template-columns: none;
  width: max-content;
  gap: var(--carousel-gap);
  animation: product-carousel-loop 84s linear infinite;
  will-change: transform;
}

.carousel-track .product-card {
  flex: 0 0 var(--carousel-card-width);
  width: var(--carousel-card-width);
}

.catalog-card {
  padding: 0;
  min-height: 570px;
  background: #151515;
  justify-content: flex-start;
}

.catalog-card::before {
  content: none;
}

.catalog-image {
  width: 100%;
  height: 445px;
  overflow: hidden;
  /*background: #fff; */
}

.catalog-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.catalog-info {
  flex: 1;
  min-height: 125px;
  padding: 18px 22px 20px;
  background: #151515;
  border-top: 3px solid var(--gold);
}

/* Prelanding de marca: fuego dorado y revelado del logo. */
.intro-active {
  overflow: hidden;
}

.brand-intro {
  position: fixed;
  inset: 0;
  z-index: 99999; /* Se eleva el z-index para evitar superposiciones de otros elementos */
  isolation: isolate; /* Se crea un contexto de apilamiento propio para móviles */
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(73, 48, 12, .42), transparent 33%),
    #050505;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  color: #fff;
  opacity: 1;
  visibility: visible;
  transition: opacity .8s ease, visibility .8s ease;
  will-change: opacity, visibility;
}

.brand-intro.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.brand-intro-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.brand-intro-particles span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--particle-size);
  height: var(--particle-size);
  border-radius: 50%;
  background: #f6b616;
  box-shadow: 0 0 5px #f6b616, 0 0 12px rgba(246,182,22,.65);
  opacity: 0;
  transform: translate(-50%, -50%) translate(var(--particle-start-x), var(--particle-start-y)) scale(.35);
  animation: intro-particle var(--particle-duration) var(--particle-delay) ease-out infinite;
}

@keyframes intro-particle {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--particle-start-x), var(--particle-start-y)) scale(.35);
  }
  18% { opacity: 1; }
  68% { opacity: .72; }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--particle-end-x), var(--particle-end-y)) scale(1.15);
  }
}

.brand-intro-content {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  padding: 24px;
  text-align: center;
}

.brand-intro-content img {
  position: relative;
  display: block;
  width: clamp(210px, 25vw, 330px);
  height: auto;
  background: transparent !important;
  opacity: 0;
  transform: scale(.72);
  /* Se añade backface-visibility para prevenir fallos de composición en pantallas táctiles */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  filter: drop-shadow(0 18px 38px rgba(0,0,0,.92));
  animation: intro-logo 1.15s .35s cubic-bezier(.16,.8,.25,1) forwards;
}

.brand-intro-progress {
  position: absolute;
  left: 50%;
  bottom: 32px;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(150px, 260px) auto;
  align-items: center;
  gap: 10px;
  width: min(82vw, 310px);
  transform: translateX(-50%);
}

.brand-intro-track {
  height: 7px;
  padding: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  box-shadow: 0 0 16px rgba(246,182,22,.15);
}

.brand-intro-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d58b04, #f6b616, #ffe19a);
  box-shadow: 0 0 12px rgba(246,182,22,.7);
}

.brand-intro-progress strong {
  min-width: 38px;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
  text-align: left;
}

/* Optimización de Keyframes para móviles: se remueve 'blur' que causa el cuadro blanco */
@keyframes intro-logo {
  0% { 
    opacity: 0; 
    transform: scale(.72) rotate(-3deg); 
    filter: drop-shadow(0 18px 38px rgba(0,0,0,.92)); 
  }
  65% { 
    opacity: 1; 
    transform: scale(1.04) rotate(0); 
    filter: drop-shadow(0 18px 38px rgba(0,0,0,.92)); 
  }
  100% { 
    opacity: 1; 
    transform: scale(1); 
    filter: drop-shadow(0 18px 38px rgba(0,0,0,.92)); 
  }
}

@media (max-width: 600px) {
  .brand-intro {
    display: grid;
  }

  .brand-intro-content img { width: min(64vw, 270px); }
  .brand-intro-progress { bottom: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-intro-particles {
    display: none;
  }

  .brand-intro-content img {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.catalog-info > span {
  color: var(--gold);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.catalog-card .catalog-info h3 {
  margin: 11px 0 8px;
  font-family: var(--body);
  font-size: 1.38rem;
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: .065em;
}

.catalog-card .catalog-info p {
  margin: 0;
  font-size: .85rem;
}

.product-carousel:hover .carousel-track,
.product-carousel:focus-within .carousel-track,
.product-carousel.is-paused .carousel-track {
  animation-play-state: paused;
}

.carousel-toggle {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--gold);
  background: rgba(10, 10, 10, .86);
  color: var(--gold);
  font: inherit;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}

@keyframes product-carousel-loop {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-50% - (var(--carousel-gap) / 2))); }
}

@media (max-width: 820px) {
  .product-grid.carousel-track {
    --carousel-card-width: calc(100vw - 40px);
    animation-duration: 72s;
  }

  .catalog-card { min-height: 540px; }
  .catalog-image { height: 415px; }
}

@media (prefers-reduced-motion: reduce) {
  .product-grid.carousel-track {
    width: 100%;
    overflow-x: auto;
    animation: none;
    scroll-snap-type: x mandatory;
  }

  .carousel-track .product-card {
    scroll-snap-align: start;
  }

  .carousel-toggle {
    display: none;
  }
}

.privacy-consents {
  display: grid;
  gap: 2px;
  margin: 24px 0 16px;
}

.privacy-consents .consent {
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.privacy-consents a,
.privacy-notice a,
footer a {
  color: var(--gold);
  text-underline-offset: 3px;
}

.privacy-notice {
  margin: 0 0 22px;
  border: 1px solid var(--border);
  background: #111;
  color: var(--muted);
  font-size: .78rem;
}

.privacy-notice summary {
  padding: 13px 15px;
  color: var(--white);
  cursor: pointer;
  font-weight: 700;
}

.privacy-notice > div {
  padding: 0 15px 12px;
  border-top: 1px solid var(--border);
}

.privacy-notice p {
  margin: 12px 0;
}

/* Fotografías reales dentro de las tarjetas de calidad. */
.quality-grid article {
  padding: 0 0 30px;
  overflow: hidden;
}

.quality-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0 0 28px;
  overflow: hidden;
  background: #0e0e0e;
}

.quality-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .7s cubic-bezier(.2,.7,.2,1), filter .4s ease;
}

.quality-grid article:hover .quality-photo img {
  transform: scale(1.035);
  filter: contrast(1.04);
}

.quality-grid article h3,
.quality-grid article > p {
  margin-left: 30px;
  margin-right: 30px;
}

.quality-grid article .number {
  z-index: 2;
  top: 16px;
  right: 16px;
  padding: 5px 8px;
  background: rgba(10,10,10,.82);
  color: var(--gold);
}

@media (prefers-reduced-motion: reduce) {
  .quality-photo img { transition: none; }
  .quality-grid article:hover .quality-photo img { transform: none; }
}

/* Apariciones cinematográficas al recorrer la página. */
.motion-ready .reveal-on-scroll {
  opacity: 0;
  transform: translateY(56px) scale(.985);
  filter: blur(5px);
  transition:
    opacity .85s cubic-bezier(.2,.75,.25,1),
    transform .85s cubic-bezier(.2,.75,.25,1),
    filter .7s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.motion-ready .reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.button,
.nav-cta,
.mobile-cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color .25s ease, border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}

.button::before,
.nav-cta::before,
.mobile-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.32) 48%, transparent 76%);
  transform: translateX(-130%);
  transition: transform .65s ease;
}

.button:hover,
.nav-cta:hover,
.mobile-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(246,182,22,.2);
}

.button:hover::before,
.nav-cta:hover::before,
.mobile-cta:hover::before {
  transform: translateX(130%);
}

.section.section-highlight::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 12%, rgba(246,182,22,.12), transparent 42%);
  animation: section-flash .9s ease-out both;
}

.section { position: relative; }

@keyframes section-flash {
  from { opacity: 0; }
  45% { opacity: 1; }
  to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .motion-ready .reveal-on-scroll,
  .motion-ready .reveal-on-scroll.is-visible {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  .button:hover,
  .nav-cta:hover,
  .mobile-cta:hover {
    transform: none;
  }
}
