/* ==========================================================================
   VINOTECA — SISTEMA DE ESTILOS Y ANIMACIONES
   Paleta vino: dark #08040A · card #140810 · border #2C1422
   accent wine #9B1D3A · gold #C9A84C · cream #F5E6C8
   ========================================================================== */

:root {
  /* --bg-dark/--bg-card/--bg-border/--text-main son ALIAS a las variables
     que header.php ya deja wireadas al panel "Colores y tipografía"
     (--brand-dark/--brand-card/--brand-border/--brand-texto, cada una con
     su cadena var(--dsn-X, valor-de-PHP)) — antes estaban hardcodeadas acá
     con el mismo valor por defecto, y como este archivo carga DESPUÉS del
     <style> de header.php, esas líneas fijas pisaban silenciosamente el
     sync en vivo (accent/accent2/texto no seguían el color elegido en el
     panel). Con el alias, si header.php no llegara a definirlas por algún
     motivo, el fallback semicolon-separado mantiene el mismo look de hoy. */
  --bg-dark:     var(--brand-dark,   #08040A);
  --bg-card:     var(--brand-card,   #140810);
  --bg-border:   var(--brand-border, #2C1422);
  /* --brand-wine/--brand-gold NO se redeclaran acá a propósito — header.php
     ya las define con la cadena var(--dsn-accent, ...)/var(--dsn-accent2, ...)
     wireada al panel; volver a declararlas acá (aunque sea con el mismo
     valor) rompía esa cadena por el mismo motivo que --bg-dark de arriba. */
  --brand-cream: #F5E6C8;
  --brand-green: #25D366;
  --text-main:   var(--brand-texto, #F3F4F6);
  --text-muted:  #9CA3AF;
  /* Colores por defecto de la "palabra destacada" (Diseño Web > Efectos) —
     al no pisarse --brand-wine/--brand-gold arriba, estos ya heredan el
     sync en vivo de header.php sin ningún cambio acá. */
  --pd-color:  var(--brand-wine);
  --pd-color2: var(--brand-gold);
}

/* ── Efectos de "palabra destacada" (elegibles desde Diseño Web) ─────────── */
.text-efecto-arcoiris {
  background: linear-gradient(90deg,#ff3b30,#ff9500,#ffcc00,#34c759,#00c7be,#007aff,#af52de,#ff3b30);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@media (prefers-reduced-motion: no-preference) {
  .text-efecto-arcoiris { animation: vnRainbow 5s linear infinite; }
  @keyframes vnRainbow { to { background-position: 300% center; } }
}
.text-efecto-solido { color: var(--pd-color, var(--brand-wine)); }
.text-efecto-degradado {
  background: linear-gradient(90deg, var(--pd-color, var(--brand-wine)), var(--pd-color2, var(--brand-gold)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.text-efecto-subrayado {
  color: inherit;
  background-image: linear-gradient(120deg, var(--pd-color, var(--brand-wine)) 0%, var(--pd-color, var(--brand-wine)) 100%);
  background-repeat: no-repeat;
  background-size: 100% .35em;
  background-position: 0 88%;
}
.text-efecto-contorno {
  color: var(--pd-color, var(--brand-wine));
  -webkit-text-stroke: 1.5px var(--pd-color, var(--brand-wine));
  -webkit-text-fill-color: transparent;
}

/* Fondo oscuro base en html para que no haya flash blanco */
html {
  background-color: var(--bg-dark);
}

body {
  /* font-family NO se declara acá a propósito — header.php ya pone
     `body, p, span, ... { font-family: var(--font-body); }`; si este
     archivo (que carga después) volvía a declararlo acá con un valor fijo
     ('Inter'), pisaba ese var() y el <body> dejaba de seguir la fuente
     elegida en "Fuente de texto" del panel (los hijos con su propia regla
     — p/span/a/input/etc. — sí la seguían, pero el body en sí no). */
  background-color: transparent;
  color: var(--text-main);
  overflow-x: hidden;
  position: relative;
}

/* ==========================================================================
   FONDO: BODEGA / VIÑEDO — Ken Burns suave
   ========================================================================== */
body::before {
  content: "";
  position: fixed;
  top: -5vh;
  left: -5vw;
  width: 110vw;
  height: 110vh;

  background-image:
    radial-gradient(ellipse at center, transparent 10%, #08040A 100%),
    linear-gradient(to bottom, #08040A 0%, rgba(8,4,10,0.15) 30%, rgba(8,4,10,0.15) 70%, #08040A 100%),
    url('https://images.unsplash.com/photo-1516594915697-87eb3b1c14ea?auto=format&fit=crop&w=1920&q=80');

  background-size: cover;
  background-position: center 60%;
  background-repeat: no-repeat;

  filter: brightness(0.7) contrast(1.1) saturate(0.9);
  opacity: 0.45;
  z-index: -1;
  pointer-events: none;

  animation: vineyardMotion 36s ease-in-out infinite alternate;
  will-change: transform;
  transform-origin: center center;
}

@keyframes vineyardMotion {
  0%   { transform: scale(1)    translate(0, 0); }
  50%  { transform: scale(1.06) translate(-6px, -10px); }
  100% { transform: scale(1.02) translate(5px, -3px); }
}

@media (min-width: 1024px) {
  body::before {
    background-position: center 50%;
  }
}

/* Fase 45: apaga el fondo animado de fábrica (viñedo) cuando el admin lo
   desactiva desde Diseño Web → Colores. La clase la pone el propio
   header.php en el <body> según colores.fondo_fabrica, y
   dsn-editor-hotspots.js la togglea en vivo dentro del iframe de preview
   antes de publicar. Queda solo el color "Fondo" de --bg-dark. */
body.dsn-sin-fondo-fabrica::before {
  content: none !important;
  display: none !important;
}

/* ==========================================================================
   TIPOGRAFÍA DISPLAY
   ========================================================================== */
.font-display {
  font-family: 'Playfair Display', Georgia, serif;
}

/* ==========================================================================
   MARQUEE BANNER
   ========================================================================== */
.marquee-container {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  display: flex;
  align-items: center;
}

.marquee-content {
  display: inline-flex;
  animation: marquee 24s linear infinite;
  will-change: transform;
}

.marquee-container:hover .marquee-content {
  animation-play-state: paused;
}

@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ==========================================================================
   HEADER / NAV GLASS
   ========================================================================== */
.nav-glass {
  background: rgba(8, 4, 10, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--bg-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}

/* Mega menús */
.mega-menu-content {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease-in-out;
  pointer-events: none;
}

.has-mega-menu:hover .mega-menu-content,
.group:hover .mega-menu-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* ==========================================================================
   SWIPER — ESTILOS PERSONALIZADOS
   ========================================================================== */
.swiper-button-next,
.swiper-button-prev {
  color: var(--brand-wine) !important;
  background: rgba(8, 4, 10, 0.85);
  width: 44px !important;
  height: 44px !important;
  border-radius: 50%;
  border: 1px solid rgba(155, 29, 58, 0.35);
  transition: all 0.3s ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  background: var(--brand-wine);
  color: #ffffff !important;
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(155, 29, 58, 0.5);
}

.swiper-pagination-bullet-active {
  background: var(--brand-wine) !important;
  width: 28px !important;
  border-radius: 4px !important;
}

/* ==========================================================================
   SCROLLBAR
   ========================================================================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--bg-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-wine); }

/* ==========================================================================
   HIDE SCROLLBAR UTILITY
   ========================================================================== */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ==========================================================================
   RESEÑAS — CARRUSEL INFINITO
   ========================================================================== */
@keyframes resenas-slide {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.resenas-track { animation: resenas-slide 44s linear infinite; }
.resenas-track:hover { animation-play-state: paused; }
/* :hover no existe en touch — sin esto, en celular el carrusel de reseñas
   nunca se puede pausar para leer una tranquilo (ver main.js initResenasTouchPause). */
.resenas-track.is-touch-paused { animation-play-state: paused; }

.resena-card {
  flex: 0 0 clamp(260px, 80vw, 320px);
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
}

.resena-stars  { color: #fbbc04; font-size: 15px; letter-spacing: 2px; }
.resena-texto  { font-size: 13px; line-height: 1.65; color: rgba(255,255,255,.75); flex: 1; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.resena-autor  { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.resena-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.resena-avatar-initial { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0; }
.resena-name   { font-size: 12px; font-weight: 700; color: #fff; }
.resena-fecha  { font-size: 10px; color: rgba(255,255,255,.38); }

/* ==========================================================================
   VARIANTES DE PRODUCTO (talle/color)
   ========================================================================== */
.pv-selector { margin-top: 4px; }
.pv-label { font-size: 10px; font-weight: 700; color: #9CA3AF; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.pv-selected-label { color: var(--brand-wine); }
.pv-options { display: flex; flex-wrap: wrap; gap: 4px; }
.pv-chip {
  padding: 2px 8px; font-size: 10px; font-weight: 700;
  border: 1px solid var(--bg-border); border-radius: 4px;
  color: #9CA3AF; background: transparent; cursor: pointer; transition: all .15s;
}
.pv-chip:hover { border-color: var(--brand-wine); color: #fff; }
.pv-chip.pv-active { border-color: var(--brand-wine); color: #fff; background: rgba(155,29,58,.2); }
.pv-swatch {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer; transition: all .15s;
  box-shadow: 0 0 0 1px rgba(255,255,255,.15);
}
.pv-swatch:hover { box-shadow: 0 0 0 2px var(--brand-wine); }
.pv-swatch.pv-active { box-shadow: 0 0 0 2px var(--brand-wine), 0 0 0 4px rgba(155,29,58,.25); }

/* Antes solo se veía la foto de la variedad elegida (recién después de
   clickearla) y el stock solo se mostraba de a una — ahora, si la opción
   tiene foto propia, se muestra como miniatura clickeable desde el
   principio, y toda opción (con o sin foto) lleva su propio stock a la
   vista, no solo la seleccionada. */
.pv-swatch, .pv-chip { position: relative; }
.pv-thumb {
  width: 28px; height: 28px; border-radius: 6px; overflow: hidden;
  border: 2px solid transparent; cursor: pointer; padding: 0;
  background: rgba(255,255,255,.06); position: relative; transition: all .15s;
}
.pv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-thumb:hover { box-shadow: 0 0 0 2px var(--brand-wine); }
.pv-thumb.pv-active { border-color: var(--brand-wine); box-shadow: 0 0 0 2px var(--brand-wine), 0 0 0 4px rgba(155,29,58,.25); }
.pv-stock-badge {
  position: absolute; bottom: -4px; right: -4px;
  min-width: 14px; height: 14px; padding: 0 3px; border-radius: 999px;
  font-size: 8px; line-height: 13px; font-weight: 800; text-align: center;
  border: 1.5px solid var(--bg-dark, #0f0f13);
}
.pv-chip-stock {
  display: inline-block; margin-left: 4px; font-size: 9px; font-weight: 800;
  padding: 0 4px; border-radius: 999px; vertical-align: middle;
}
.pv-stock-ok  { background: #25d366; color: #06210f; }
.pv-stock-low { background: #ffb020; color: #2b1900; }
.pv-stock-out { background: #6b7280; color: #fff; }

/* ==========================================================================
   SELLO DATA FISCAL (ARCA) — tamaño configurable desde admin > Datos del negocio
   ========================================================================== */
.footer-data-fiscal img,
.footer-data-fiscal a img {
  height: var(--data-fiscal-h, 36px) !important;
  width: auto !important;
  display: block;
}

/* ══════════════════════════════════════════════════════════════════════
   Fase 82 — transiciones mezcladas del hero (pedido del usuario: que no
   todas las fotos del hero transicionen igual/lateral). Cada foto puede
   tener su propio efecto de entrada, elegido por slide desde Diseño Web
   (Productos → botón ⚙ de cada imagen del hero). 'fade' = comportamiento
   de siempre (fundido), sin cambios visibles hasta que se elija otro
   efecto. Se respeta prefers-reduced-motion: con esa preferencia activada
   en el sistema operativo del visitante, todas las fotos quedan con el
   fundido simple de siempre, sin las animaciones de zoom/deslizar/flip.
   ══════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {
  @keyframes heroFxZoom       { from { transform: scale(1);         } to { transform: scale(1.12); } }
  @keyframes heroFxSlideLeft  { from { transform: translateX(5%);  opacity: .35; } to { transform: translateX(0); opacity: 1; } }
  @keyframes heroFxSlideRight { from { transform: translateX(-5%); opacity: .35; } to { transform: translateX(0); opacity: 1; } }
  @keyframes heroFxFlip       { from { transform: perspective(1200px) rotateY(14deg) scale(.94); opacity: .3; } to { transform: perspective(1200px) rotateY(0) scale(1); opacity: 1; } }

  .fer-hero-slide.active[data-fx="zoom"],
  .cs-hero-slide.active[data-fx="zoom"],
  .swiper-slide-active .hero-fx-inner[data-fx="zoom"] { animation: heroFxZoom 6.5s ease-out forwards; }

  .fer-hero-slide.active[data-fx="slide-left"],
  .cs-hero-slide.active[data-fx="slide-left"],
  .swiper-slide-active .hero-fx-inner[data-fx="slide-left"] { animation: heroFxSlideLeft .9s ease-out; }

  .fer-hero-slide.active[data-fx="slide-right"],
  .cs-hero-slide.active[data-fx="slide-right"],
  .swiper-slide-active .hero-fx-inner[data-fx="slide-right"] { animation: heroFxSlideRight .9s ease-out; }

  .fer-hero-slide.active[data-fx="flip"],
  .cs-hero-slide.active[data-fx="flip"],
  .swiper-slide-active .hero-fx-inner[data-fx="flip"] { animation: heroFxFlip 1s ease-out; }

  /* Fase 85 — pedido del usuario: sumar más variedad de transiciones al
     hero además de las 5 de Fase 82. 'elastico' y 'cubo' son variantes del
     mismo transform+perspective que zoom/slide/flip; 'iris' usa clip-path
     circle() (interpola de forma nativa igual que transform/opacity).
     'cortina' usa clip-path polygon() con el MISMO número de vértices en
     los dos extremos del keyframe (8 franjas verticales, cada una como
     sub-lazo cerrado que vuelve a su propio borde superior antes de pasar
     a la siguiente franja, para que el "conector" entre franjas no
     encierre un triángulo diagonal) — es la técnica que sí funciona:
     probamos primero animar los stops de un repeating-linear-gradient()
     en mask-image, pero eso NO interpola en los navegadores probados
     (queda "todo o nada" de golpe a la mitad de la animación, sin
     transición real), por eso se descartó esa vía. 'desenfoque' anima
     filter:blur, también soportado de forma nativa. */
  @keyframes heroFxElastico   { from { transform: translateX(10%); opacity: .35; } to { transform: translateX(0); opacity: 1; } }
  @keyframes heroFxCortina    { 0% { clip-path: polygon(0.0% 0%, 0.25% 0%, 0.25% 100%, 0.0% 100%, 0.0% 0%, 12.5% 0%, 12.75% 0%, 12.75% 100%, 12.5% 100%, 12.5% 0%, 25.0% 0%, 25.25% 0%, 25.25% 100%, 25.0% 100%, 25.0% 0%, 37.5% 0%, 37.75% 0%, 37.75% 100%, 37.5% 100%, 37.5% 0%, 50.0% 0%, 50.25% 0%, 50.25% 100%, 50.0% 100%, 50.0% 0%, 62.5% 0%, 62.75% 0%, 62.75% 100%, 62.5% 100%, 62.5% 0%, 75.0% 0%, 75.25% 0%, 75.25% 100%, 75.0% 100%, 75.0% 0%, 87.5% 0%, 87.75% 0%, 87.75% 100%, 87.5% 100%, 87.5% 0%); } 100% { clip-path: polygon(0.0% 0%, 12.5% 0%, 12.5% 100%, 0.0% 100%, 0.0% 0%, 12.5% 0%, 25.0% 0%, 25.0% 100%, 12.5% 100%, 12.5% 0%, 25.0% 0%, 37.5% 0%, 37.5% 100%, 25.0% 100%, 25.0% 0%, 37.5% 0%, 50.0% 0%, 50.0% 100%, 37.5% 100%, 37.5% 0%, 50.0% 0%, 62.5% 0%, 62.5% 100%, 50.0% 100%, 50.0% 0%, 62.5% 0%, 75.0% 0%, 75.0% 100%, 62.5% 100%, 62.5% 0%, 75.0% 0%, 87.5% 0%, 87.5% 100%, 75.0% 100%, 75.0% 0%, 87.5% 0%, 100.0% 0%, 100.0% 100%, 87.5% 100%, 87.5% 0%); } }
  @keyframes heroFxIris       { from { clip-path: circle(0% at 50% 50%); opacity: .6; } to { clip-path: circle(100% at 50% 50%); opacity: 1; } }
  @keyframes heroFxDesenfoque { from { filter: blur(18px); opacity: .5; transform: scale(1.03); } to { filter: blur(0); opacity: 1; transform: scale(1); } }
  @keyframes heroFxCubo       { from { transform: perspective(1000px) rotateY(70deg); opacity: .25; } to { transform: perspective(1000px) rotateY(0deg); opacity: 1; } }

  .fer-hero-slide.active[data-fx="elastico"],
  .cs-hero-slide.active[data-fx="elastico"],
  .swiper-slide-active .hero-fx-inner[data-fx="elastico"] { animation: heroFxElastico 1.1s cubic-bezier(.34,1.56,.64,1); }

  .fer-hero-slide.active[data-fx="cortina"],
  .cs-hero-slide.active[data-fx="cortina"],
  .swiper-slide-active .hero-fx-inner[data-fx="cortina"] { animation: heroFxCortina 1.1s steps(8, end); }

  .fer-hero-slide.active[data-fx="iris"],
  .cs-hero-slide.active[data-fx="iris"],
  .swiper-slide-active .hero-fx-inner[data-fx="iris"] { animation: heroFxIris .9s ease-out; }

  .fer-hero-slide.active[data-fx="desenfoque"],
  .cs-hero-slide.active[data-fx="desenfoque"],
  .swiper-slide-active .hero-fx-inner[data-fx="desenfoque"] { animation: heroFxDesenfoque .9s ease-out; }

  .fer-hero-slide.active[data-fx="cubo"],
  .cs-hero-slide.active[data-fx="cubo"],
  .swiper-slide-active .hero-fx-inner[data-fx="cubo"] { animation: heroFxCubo 1s ease-out; transform-origin: left center; }
}
/* Envoltorio interno usado solo en las plantillas con Swiper (equinobike,
   vinoteca, la cuadra) para no pisar el transform que Swiper controla en
   el .swiper-slide — el efecto se anima acá adentro, no en el slide. */
.hero-fx-inner { position: absolute; inset: 0; background-size: cover; background-position: center; }
