/* ===================================================
   Oli d'Alfafara — Hoja de estilos principal
   =================================================== */

:root {
  /* Paleta de marca */
  --color-bg: #faf8f2;
  --color-bg-alt: #f1ede2;
  --color-surface: #ffffff;
  --color-text: #262a1d;
  --color-text-muted: #5b5d4d;
  --color-olive-900: #232b18;
  --color-olive-700: #3c4a26;
  --color-olive-500: #5c6e3c;
  --color-gold-600: #a9812f;
  --color-gold-500: #c49a3a;
  --color-gold-300: #e3c987;
  --color-border: rgba(38, 42, 29, 0.12);

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container-w: 1180px;
  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 28px;
  --shadow-sm: 0 2px 10px rgba(35, 43, 24, 0.06);
  --shadow-md: 0 12px 40px rgba(35, 43, 24, 0.12);
  --transition: 220ms ease;

  color-scheme: light;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #191c13;
    --color-bg-alt: #21251a;
    --color-surface: #21251a;
    --color-text: #f2efe4;
    --color-text-muted: #b9bba7;
    --color-olive-900: #f2efe4;
    --color-olive-700: #d7dcc2;
    --color-olive-500: #a7b389;
    --color-gold-600: #e3c987;
    --color-gold-500: #d9b45f;
    --color-gold-300: #f0dfb0;
    --color-border: rgba(242, 239, 228, 0.14);
  }
}

:root[data-theme="dark"] {
  --color-bg: #191c13;
  --color-bg-alt: #21251a;
  --color-surface: #21251a;
  --color-text: #f2efe4;
  --color-text-muted: #b9bba7;
  --color-olive-900: #f2efe4;
  --color-olive-700: #d7dcc2;
  --color-olive-500: #a7b389;
  --color-gold-600: #e3c987;
  --color-gold-500: #d9b45f;
  --color-gold-300: #f0dfb0;
  --color-border: rgba(242, 239, 228, 0.14);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--color-olive-900); line-height: 1.15; margin: 0 0 0.5em; font-weight: 600; }
p { margin: 0 0 1em; color: var(--color-text-muted); }
button, input, textarea { font-family: inherit; font-size: inherit; color: inherit; }

.container { max-width: var(--container-w); margin-inline: auto; padding-inline: 24px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--color-olive-900); color: var(--color-bg);
  padding: 12px 18px; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold-600);
  font-weight: 500;
  margin-bottom: 0.9em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border-radius: 999px;
  font-size: 0.95rem; font-weight: 500; letter-spacing: 0.01em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--color-olive-700); color: #fff; }
.btn-primary:hover { background: var(--color-olive-900); }
.btn-ghost { background: transparent; color: var(--color-olive-900); border-color: var(--color-border); }
.btn-ghost:hover { background: var(--color-bg-alt); }
.btn-ghost-inverse { background: transparent; color: var(--color-bg); border-color: rgba(255,255,255,0.35); }
.btn-ghost-inverse:hover { background: rgba(255,255,255,0.1); }
.btn-lg { padding: 15px 30px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset-inline: 0; top: 0; z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
  background: transparent;
  transition: background var(--transition), box-shadow var(--transition), backdrop-filter var(--transition);
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--color-bg) 90%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 18px;
}
.logo { display: inline-flex; align-items: center; color: var(--color-olive-900); }
.logo-img { height: 34px; width: auto; display: block; }

.main-nav ul { display: flex; gap: 32px; }
.main-nav a {
  font-size: 0.92rem; color: var(--color-text); position: relative; padding-block: 4px;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: var(--color-gold-600); transition: right var(--transition);
}
.main-nav a:hover::after { right: 0; }

.header-actions { display: flex; align-items: center; gap: 18px; }
.header-actions .btn-primary { display: inline-flex; }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; background: none; border: none; cursor: pointer;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--color-olive-900); transition: transform var(--transition), opacity var(--transition); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  overflow: hidden; color: #fff;
}
.hero-media {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(196, 154, 58, 0.35), transparent 45%),
    linear-gradient(135deg, #2b3520 0%, #445430 45%, #6b7c45 100%);
}
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,24,12,0.35) 0%, rgba(20,24,12,0.55) 100%);
}

.sound-toggle {
  position: absolute; z-index: 3; right: 24px; bottom: 32px;
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 24, 12, 0.45); border: 1px solid rgba(255,255,255,0.4);
  color: #fff; cursor: pointer; backdrop-filter: blur(6px);
  transition: background var(--transition), transform var(--transition);
}
.sound-toggle:hover { background: rgba(20, 24, 12, 0.65); transform: translateY(-2px); }
.sound-toggle .icon { width: 20px; height: 20px; }
.sound-toggle .icon-unmuted { display: none; }
.sound-toggle[aria-pressed="true"] .icon-muted { display: none; }
.sound-toggle[aria-pressed="true"] .icon-unmuted { display: block; }
.hero-content { position: relative; z-index: 2; max-width: 720px; padding-top: 90px; }
.hero .eyebrow {
  color: var(--color-gold-300);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  font-size: clamp(0.62rem, 1.7vw, 0.8rem);
}
.hero h1 { font-size: clamp(2.4rem, 5vw, 4rem); color: #fff; }
.hero-lead { color: rgba(255,255,255,0.85); font-size: 1.1rem; max-width: 520px; }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 1.6em; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.4); }
.hero .btn-ghost:hover { background: rgba(255,255,255,0.1); }

.scroll-cue {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 1px solid rgba(255,255,255,0.5); border-radius: 20px;
  z-index: 2;
}
.scroll-cue span {
  position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px;
  background: #fff; border-radius: 2px; animation: scrollCue 1.8s infinite;
}
@keyframes scrollCue {
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 0; }
}

/* ---------- Sections generic ---------- */
.section { padding-block: clamp(64px, 9vw, 120px); }
.section-head { max-width: 640px; margin-inline: auto; text-align: center; margin-bottom: 56px; }
.section-lead { font-size: 1.05rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.split--reverse .split-media { order: 2; }
.split--reverse .split-text { order: 1; }

.media-frame {
  aspect-ratio: 4 / 5; border-radius: var(--radius-lg); position: relative; overflow: hidden;
  box-shadow: var(--shadow-md);
}
.media-frame--finca {
  background:
    radial-gradient(circle at 70% 20%, rgba(196,154,58,0.4), transparent 50%),
    linear-gradient(160deg, #4a5a2e, #232b18 85%);
}
.media-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-caption { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 14px; text-align: center; }

.statement {
  font-family: var(--font-display); font-weight: 600; color: var(--color-olive-900);
  font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.3; margin-top: 1em;
  padding-left: 20px; border-left: 3px solid var(--color-gold-500);
}

/* ---------- Vídeo ---------- */
.video-story { background: var(--color-bg-alt); }
.video-frame {
  max-width: 1080px; margin-inline: auto; aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md);
  background: var(--color-olive-900);
}
.video-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.renewal-video { margin-top: 56px; }

/* ---------- Variedad ---------- */
.variety { background: color-mix(in srgb, var(--color-gold-300) 22%, var(--color-bg)); padding-block: clamp(40px, 5vw, 64px); }
.variety-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 48px;
}
.variety-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 30px 24px; text-align: left;
  transition: transform var(--transition), box-shadow var(--transition);
}
.variety-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.variety-icon { width: 36px; height: 36px; color: var(--color-gold-600); margin-bottom: 16px; }
.variety-card h3 { font-size: 1.05rem; margin-bottom: 0.4em; }
.variety-card p { font-size: 0.92rem; margin-bottom: 0; }

.pairing {
  max-width: 640px; margin-inline: auto; text-align: center;
  border-top: 1px solid var(--color-border); padding-top: 32px;
}

/* ---------- Proceso ---------- */
.process {
  position: relative; color: #fff;
  background:
    linear-gradient(180deg, rgba(20,24,12,0.78) 0%, rgba(20,24,12,0.88) 100%),
    url('../images/olivo-grande.jpg') center 30% / cover no-repeat;
}
.process .eyebrow { color: var(--color-gold-300); }
.process h2 { color: #fff; }

.timeline {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; counter-reset: step;
}
.timeline-step {
  position: relative; padding-top: 26px; border-top: 2px solid rgba(255,255,255,0.25);
}
.process .timeline-step h3 { color: #fff; }
.process .timeline-step p { color: rgba(255,255,255,0.78); }
.timeline-step .step-num {
  font-family: var(--font-display); font-size: 1.6rem; color: var(--color-gold-600);
  display: block; margin-bottom: 0.5em;
}
.timeline-step h3 { font-size: 1.05rem; }
.timeline-step p { font-size: 0.92rem; }

/* ---------- Producto / Tienda ---------- */
.bottle-showcase {
  aspect-ratio: 4 / 5; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md);
}
.bottle-showcase img { width: 100%; height: 100%; object-fit: cover; display: block; }

.format-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 2em 0; }
.product-cta { display: flex; gap: 16px; flex-wrap: wrap; }
.format-card {
  position: relative; border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 20px 14px; text-align: center; display: flex; flex-direction: column; gap: 4px;
}
.format-card--featured { border-color: var(--color-gold-500); background: var(--color-bg-alt); }
.format-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--color-gold-500); color: var(--color-olive-900);
  font-size: 0.7rem; padding: 3px 10px; border-radius: 999px; font-weight: 500;
}
.format-size { font-family: var(--font-display); font-size: 1.2rem; color: var(--color-olive-900); }
.format-name { font-size: 0.82rem; color: var(--color-text-muted); }

/* ---------- Sostenibilidad ---------- */
.sustainability {
  color: var(--color-bg);
  background:
    linear-gradient(180deg, rgba(20,24,12,0.82) 0%, rgba(20,24,12,0.9) 100%),
    url('../images/teaching.jpg') center 30% / cover no-repeat;
}
.sustainability .eyebrow { color: var(--color-gold-300); }
.sustainability h2 { color: var(--color-bg); }
.values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.value-card { text-align: left; }
.value-icon { font-size: 1.8rem; display: inline-block; margin-bottom: 14px; }
.value-card h3 { color: var(--color-bg); font-size: 1.05rem; }
.value-card p { color: rgba(250, 248, 242, 0.7); font-size: 0.92rem; margin-bottom: 0; }

/* ---------- Contacto ---------- */
.contact-info { margin-top: 2em; display: flex; flex-direction: column; gap: 18px; }
.contact-info li { display: flex; flex-direction: column; gap: 2px; }
.contact-info strong { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-gold-600); }
.contact-info a:hover { color: var(--color-gold-600); }

.map-embed {
  margin-top: 2em; aspect-ratio: 16 / 10; border-radius: var(--radius-md);
  overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--color-border);
}
.map-embed iframe { width: 100%; height: 100%; border: 0; display: block; }

.contact-form {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow-sm);
}
.form-row { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 0.85rem; color: var(--color-text-muted); }
.form-row input, .form-row textarea {
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 12px 14px; background: var(--color-bg); resize: vertical;
  transition: border-color var(--transition);
}
.form-row input:focus, .form-row textarea:focus {
  outline: none; border-color: var(--color-gold-500);
}
.form-status { margin-top: 14px; font-size: 0.9rem; color: var(--color-olive-700); text-align: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-olive-900); color: var(--color-bg); }
.footer-inner {
  display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 48px;
  padding-block: 64px;
}
.footer-brand p { color: rgba(250,248,242,0.65); max-width: 34ch; margin-top: 14px; }
.footer-brand .logo-img { height: 68px; }
.social-links { display: flex; gap: 12px; margin-top: 18px; }
.social-links a {
  width: 44px; height: 44px; border: 1px solid rgba(255,255,255,0.25); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.social-links a:hover { background: rgba(255,255,255,0.1); }

.footer-nav h4, .footer-newsletter h4 {
  color: var(--color-bg); font-family: var(--font-body); font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1.2em;
}
.footer-nav ul { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a { color: rgba(250,248,242,0.75); font-size: 0.92rem; }
.footer-nav a:hover { color: var(--color-gold-300); }

.footer-newsletter p { color: rgba(250,248,242,0.65); font-size: 0.9rem; }
.newsletter-form { display: flex; gap: 10px; margin-top: 14px; }
.newsletter-form input {
  flex: 1; min-width: 0; border-radius: 999px; border: 1px solid rgba(255,255,255,0.25);
  background: transparent; color: var(--color-bg); padding: 10px 16px;
}
.newsletter-form input::placeholder { color: rgba(250,248,242,0.5); }

.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); }
.footer-bottom-inner {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding-block: 22px; font-size: 0.8rem; color: rgba(250,248,242,0.6);
}
.footer-bottom-inner a:hover { color: var(--color-gold-300); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms ease, transform 700ms ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .variety-grid, .timeline, .values-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .header-actions .btn-primary { display: none; }

  .main-nav.is-open {
    display: block; position: fixed; inset: 0; top: 0; z-index: 99;
    background: var(--color-bg); padding: 110px 24px 40px;
  }
  .main-nav.is-open ul { flex-direction: column; gap: 4px; }
  .main-nav.is-open a { display: block; padding: 14px 4px; font-size: 1.15rem; border-bottom: 1px solid var(--color-border); }

  .split, .split--reverse .split-media, .split--reverse .split-text {
    grid-template-columns: 1fr; order: initial;
  }
  .split { grid-template-columns: 1fr; }

  .variety-grid, .timeline, .values-grid { grid-template-columns: 1fr; }
  .format-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; padding-block: 48px; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 420px) {
  .container { padding-inline: 18px; }
  .hero-cta { flex-direction: column; align-items: flex-start; }
}
