/* Tipografía y variables */
:root {
--wine-bg: #080204;
--wine-bg-deep: #080204;
--text: #f3eaea;
--muted: #c9b7b7;
--accent: #c23a3a;
--accent-soft: #d86a6a;
}

* {
box-sizing: border-box;
}

html, body {
height: 100%;
}

body {
margin: 0;
font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
color: var(--text);
background: #080204;
}

.container {
width: min(1100px, 92%);
margin: 0 auto;
}

/* Header container más ancho para llevar elementos a los extremos */
.site-header .container {
width: min(1400px, 98%);
}

/* Header */
.site-header {
position: sticky;
top: 0;
z-index: 20;
backdrop-filter: saturate(140%) blur(8px);
-webkit-backdrop-filter: saturate(140%) blur(8px);
background: rgba(8, 2, 4, 0.35);
border-bottom: none;
}

.header-content {
display: flex;
align-items: center;
justify-content: space-between;
padding: 22px 0;
}

.brand {
display: inline-flex;
align-items: center;
gap: 10px;
text-decoration: none;
color: var(--text);
}

.brand-logo {
height: clamp(56px, 6vw, 104px);
width: auto;
object-fit: contain;
filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.brand-name {
font-weight: 700;
letter-spacing: 0.5px;
}

.nav a {
font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
color: var(--text);
text-decoration: none;
margin-left: 22px;
padding: 10px 12px;
border-radius: 0;
background: transparent;
font-size: 20px;
font-weight: 600;
letter-spacing: 0.3px;
transition: color 0.18s ease, text-shadow 0.18s ease, transform 0.18s ease;
}

.nav a:hover {
color: #ffffff;
text-shadow: 0 0 6px rgba(255, 188, 219, 0.35);
transform: translateY(-1px);
}

/* Hero */
.hero {
padding: 90px 0 40px;
text-align: center;
}

.hero h1 {
font-family: 'Gloria Hallelujah', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
font-size: clamp(32px, 6vw, 56px);
line-height: 1.05;
margin: 0 0 10px;
}

.hero p {
color: var(--muted);
margin: 0;
}

/* Parallax section */
.parallax-section {
position: relative;
min-height: 130vh;
display: grid;
place-items: center;
overflow: hidden;
}

/* Offset de anclas para evitar solaparse con el header sticky */
#seleccion { scroll-margin-top: 110px; }

.parallax {
position: relative;
width: 100%;
height: 85vh;
}

.parallax-layer {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}

/* Solo aplicar will-change a las capas que realmente hacen parallax */
.parallax-layer.bottle,
.parallax-layer.shadow {
will-change: transform;
}

.glow {
width: 520px;
height: 520px;
border-radius: 50%;
background: radial-gradient(closest-side, rgba(194, 58, 58, 0.22), rgba(194, 58, 58, 0) 60%);
filter: blur(6px);
}

.shadow {
width: 340px;
height: 40px;
background: radial-gradient(closest-side, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0) 70%);
border-radius: 50%;
transform: translate(-50%, 160px);
}

.bottle {
display: grid;
place-items: center;
}

.bottle-img {
width: clamp(300px, 35vw, 460px);
height: auto;
margin-top: 320px;
mix-blend-mode: normal;
filter: contrast(1.02) saturate(1.02) drop-shadow(0 16px 34px rgba(0,0,0,0.5));
user-select: none;
pointer-events: none;
}

.section-copy {
text-align: center;
margin-top: 40px;
}

.section-copy h2 {
font-size: clamp(28px, 4.6vw, 40px);
margin: 0 0 8px;
}

.section-copy p {
color: var(--muted);
font-size: clamp(16px, 2.4vw, 20px);
}

/* Grilla de productos */
.collection-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 24px;
margin-top: 24px;
}

.product-card {
position: relative;
background: rgba(8, 2, 4, 0.45);
border-radius: 18px;
border: 1px solid rgba(255, 255, 255, 0.10);
padding: 20px;
text-align: center;
transition: transform 200ms ease, box-shadow 200ms ease;
}

.product-card:hover {
transform: translateY(-3px);
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.product-card::before {
content: none;
display: none;
}

.collection-grid .product-card:nth-child(1)::before,
.collection-grid .product-card:nth-child(2)::before,
.collection-grid .product-card:nth-child(3)::before { transform: none; }

.product-card img {
width: 100%;
max-height: 320px;
object-fit: contain;
mix-blend-mode: normal;
filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
user-select: none;
pointer-events: none;
}

.product-info h3 a {
margin: 12px 0 4px;
font-size: clamp(20px, 2.5vw, 24px);
color: #ffffff;
text-decoration: none;
}

.product-info .price {
font-weight: 700;
color: var(--text);
margin-bottom: 6px;
font-size: clamp(18px, 2.3vw, 22px);
}

.product-info p {
color: var(--muted);
font-size: 15px;
line-height: 1.5;
}

@media (max-width: 980px) {
.collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
.collection-grid { grid-template-columns: 1fr; }
}

/* Contacto */
.contact {
padding: 80px 0;
text-align: center;
}

.contact-intro {
color: var(--muted);
margin: 8px 0 24px;
}

.contact-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 20px;
margin-top: 20px;
text-align: left;
}

.contact-card {
background: rgba(8, 2, 4, 0.45);
border-radius: 18px;
border: none;
padding: 20px;
}

.contact-card h3 {
font-size: clamp(18px, 2.4vw, 22px);
margin: 0 0 8px;
}

.contact-card p,
.contact-card address {
color: var(--muted);
font-size: 15px;
line-height: 1.7;
}

.contact-card a {
color: var(--text);
text-decoration: none;
transition: color 0.18s ease, text-shadow 0.18s ease;
}

.contact-card a:hover {
color: #ffffff;
text-shadow: 0 0 6px rgba(255, 188, 219, 0.35);
}

.contact-source {
margin-top: 14px;
font-size: 13px;
color: var(--muted);
}

#contacto { scroll-margin-top: 110px; }

@media (max-width: 980px) {
.contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
.contact-grid { grid-template-columns: 1fr; }
.contact { padding: 60px 0; }
}

/* Burbujas inferiores */
.bubbles-bottom {
position: relative;
height: 160px;
overflow: hidden;
background: transparent;
}

@media (max-width: 640px) {
.bubbles-bottom { height: 140px; }
}

/* Footer */
.site-footer {
margin-top: 20px;
border-top: 1px solid rgba(255, 255, 255, 0.06);
background: rgba(25, 5, 8, 0.4);
}

.footer-content {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px 0;
}

.footer-content a {
color: var(--text);
text-decoration: none;
padding: 6px 8px;
border-radius: 8px;
background: transparent;
transition: color 0.18s ease, text-shadow 0.18s ease;
}

.footer-content a:hover {
color: #ffffff;
text-shadow: 0 0 6px rgba(255, 188, 219, 0.35);
}

@media (max-width: 640px) {
.footer-content { flex-direction: column; gap: 8px; }
}

/* Página legal */
.legal {
padding: 60px 0;
}

.legal h1 {
font-size: clamp(28px, 4.6vw, 40px);
margin: 0 0 18px;
text-align: center;
}

.legal-card {
background: rgba(8, 2, 4, 0.45);
border-radius: 18px;
border: 1px solid rgba(255, 255, 255, 0.10);
padding: 24px;
}

.legal-card h2 {
font-size: clamp(18px, 2.4vw, 22px);
margin: 18px 0 8px;
}

.legal-card p {
color: var(--muted);
font-size: 15px;
line-height: 1.7;
}

.legal-card .legal-source {
margin-top: 16px;
font-size: 14px;
}

/* =============================================
   BURBUJAS — FIX SAFARI
   
   PROBLEMA: Safari no puede componer dos animaciones CSS que
   ambas usen `transform` sobre el mismo elemento. Con 120+
   burbujas en conflicto, la GPU de Safari se cae.
   
   SOLUCIÓN: Separar en dos elementos:
     .bubble-wrap → posición + bamboleo horizontal (sway / translateX)
     .bubble      → aspecto visual + ascenso vertical (rise / translateY)
   
   Cada elemento tiene solo UN transform activo → Safari feliz ✅
   ============================================= */

/* Contenedor: gestiona SOLO el bamboleo horizontal */
.bubble-wrap {
  position: absolute;
  /* tamaño asignado por JS */
  animation: sway var(--swayDur, 5s) ease-in-out infinite;
}

/* Visual: gestiona SOLO el ascenso vertical */
.bubble {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(240, 110, 160, 0.55), rgba(220, 80, 130, 0.28) 55%, rgba(220, 80, 130, 0) 100%);
  box-shadow: inset -2px -3px 8px rgba(0,0,0,0.25), 0 4px 10px rgba(0,0,0,0.25);
  opacity: 0.6;
  animation: rise var(--dur, 14s) linear infinite;
}

/* rise: solo translateY + scale → sin conflicto con sway */
@keyframes rise {
  0%   { transform: translateY(160px) scale(0.92); opacity: 0; }
  10%  { opacity: 0.6; }
  100% { transform: translateY(-110vh) scale(1.06); opacity: 0; }
}

/* sway: solo translateX → sin conflicto con rise */
@keyframes sway {
  0%, 100% { transform: translateX(-3px); }
  50%       { transform: translateX(3px); }
}

.bubble.explode {
  animation: pop 0.45s ease-out forwards;
}

@keyframes pop {
  0%   { transform: scale(1);    opacity: 0.8; }
  40%  { transform: scale(1.35); opacity: 0.9; }
  100% { transform: scale(1.6);  opacity: 0; }
}

/* También necesitamos que .bubbles tenga posición relativa */
.bubbles { width: 100%; height: 100%; position: relative; }

/* =============================================
   RESPONSIVE — móviles pequeños (RWD)
   ============================================= */
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {

  /* Imagen hero más pequeña y liviana */
  .bottle-img {
    width: 180px;
    margin-top: 160px;
  }

  /* Ocultar el brillo — alivia la GPU en móvil */
  .glow {
    display: none;
  }

  /* Sin opacidad extra en burbujas */
  .bubble {
    opacity: 0.45;
  }

  /* Hero con menos espacio */
  .hero {
    padding: 60px 0 20px;
  }

  /* Navegación más compacta */
  .nav a {
    font-size: 15px;
    margin-left: 10px;
    padding: 8px 6px;
  }

  /* Parallax más compacto en móvil */
  .parallax-section {
    min-height: auto;
  }

  .parallax {
    height: 55vh;
  }
}