:root {
  --green: #90d000;
  --green-brand: #6aa300;
  --green-dark: #4c7300;
  --text: #212529;
  --muted: #6c757d;
  --bg: #ffffff;
  --bg-soft: #f5f8ec;
  --border: #e2e8e2;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text); background: var(--bg); line-height: 1.6;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }
img { max-width: 100%; height: auto; }
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header { border-bottom: 3px solid var(--green); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; gap: 2rem; padding: .6rem 1.25rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-size: 1.75rem; font-weight: 700; color: var(--green-brand, #6aa300); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.main-nav { display: flex; gap: 1.4rem; margin-left: auto; }
.main-nav a { color: var(--text); font-weight: 500; }
.main-nav a:hover { color: var(--green-dark); text-decoration: none; }
.lang-switch a { font-size: .85rem; color: var(--muted); margin-left: .6rem; display: inline-flex; align-items: center; gap: .35rem; }
.lang-switch .flag { width: 20px; height: auto; border-radius: 2px; box-shadow: 0 0 1px rgba(0,0,0,.4); }

.hero { background: linear-gradient(135deg, var(--green), #b5e549); color: #223a00; padding: 4.5rem 0; text-align: center; }
.hero h1 { font-size: 2.8rem; letter-spacing: .5px; }
.tagline { font-size: 1.2rem; opacity: .92; margin: .8rem 0 1.6rem; }
.btn { display: inline-block; background: #fff; color: var(--green-dark); font-weight: 600; padding: .7rem 1.6rem; border-radius: 999px; }
.btn:hover { text-decoration: none; background: var(--bg-soft); }

main section { padding: 2.5rem 0; }
h2 { font-size: 1.6rem; margin-bottom: 1.2rem; color: var(--green-dark); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.4rem; }
.product-card { border: 1px solid var(--border); border-radius: 12px; padding: 1.2rem; text-align: center; color: var(--text); background: var(--bg); transition: box-shadow .15s ease; }
.product-card:hover { text-decoration: none; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.product-card img { height: 180px; object-fit: contain; margin-bottom: .8rem; }
.product-card h3 { font-size: 1.05rem; font-weight: 600; }
.price { margin-top: .5rem; font-size: 1.15rem; font-weight: 700; color: var(--green-dark); }
.price span { display: block; font-size: .72rem; font-weight: 400; color: var(--muted); }

.post-list { display: grid; gap: 1.4rem; }
.post-item { border-bottom: 1px solid var(--border); padding-bottom: 1.2rem; }
.post-item h3 { font-size: 1.15rem; }
.post-item time { font-size: .8rem; color: var(--muted); }
.read-more { font-size: .9rem; font-weight: 500; }
.pagination { margin-top: 2rem; display: flex; gap: 1rem; justify-content: center; }

.article { max-width: 760px; padding-top: 2.5rem; padding-bottom: 3rem; }
.article h1 { font-size: 2rem; line-height: 1.25; margin-bottom: .4rem; }
.article-date { color: var(--muted); font-size: .85rem; }
.article-main-img { margin: 1.4rem 0; border-radius: 10px; }
.article-body { margin-top: 1.4rem; }
.article-body p { margin-bottom: 1rem; }
.article-body img { border-radius: 8px; }

.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; padding-top: 2.5rem; padding-bottom: 3rem; }
.product-gallery img { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 1rem; }
.sku { color: var(--muted); font-size: .85rem; }
.stock.ok { color: var(--green-dark); font-weight: 600; }
.stock.no { color: #b71c1c; font-weight: 600; }
.shop-note { background: #eef7d6; border: 1px solid var(--green); border-radius: 8px; padding: .7rem 1rem; font-size: .9rem; color: #2b4500; margin: 1rem 0; }

.site-footer { border-top: 1px solid var(--border); background: #f1f3f4; padding: 2rem 0; margin-top: 2rem; font-size: .9rem; color: var(--muted); }
.footer-nav { display: flex; gap: 1.4rem; margin-bottom: .6rem; flex-wrap: wrap; }

@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; gap: .8rem; }
  .main-nav { margin-left: 0; }
  .hero { padding: 3rem 0; }
  .hero h1 { font-size: 2.1rem; }
  .product-detail { grid-template-columns: 1fr; }
}

/* galería de producto y zoom (vanilla, sin librerías) */
.gallery-main { cursor: zoom-in; border: 1px solid var(--border); border-radius: 12px; }
.gallery-thumbs { display: flex; gap: .6rem; margin-top: .8rem; }
.gallery-thumbs .thumb { width: 64px; height: 64px; object-fit: contain; border: 2px solid var(--border); border-radius: 8px; cursor: pointer; padding: 4px; }
.gallery-thumbs .thumb.active { border-color: var(--green); }
#gw-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 100; cursor: zoom-out; }
#gw-lightbox[hidden] { display: none; }
#gw-lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 10px; background: #fff; }

/* carrusel home (vanilla, sin librerías) */
.gw-carousel { position: relative; overflow: hidden; background: var(--bg-soft); }
.gw-slides { position: relative; }
.gw-slide { display: none; }
.gw-slide.active { display: block; animation: gw-fade .5s ease; }
@media (prefers-reduced-motion: reduce) { .gw-slide.active { animation: none; } }
.gw-slide img { width: 100%; display: block; aspect-ratio: 1180 / 569; object-fit: contain; }
@media (min-width: 768px) {
  .gw-carousel { max-width: 1080px; margin: 1.5rem auto 0; border-radius: 12px; }
}
@keyframes gw-fade { from { opacity: .4; } to { opacity: 1; } }
.gw-prev, .gw-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.85); border: none; border-radius: 50%; width: 42px; height: 42px; font-size: 1.1rem; cursor: pointer; color: var(--green-dark); }
.gw-prev { left: 12px; } .gw-next { right: 12px; }
.gw-prev:hover, .gw-next:hover { background: #fff; }
.gw-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; gap: 7px; justify-content: center; }
.gw-dot { width: 10px; height: 10px; border-radius: 50%; border: none; background: rgba(255,255,255,.75); box-shadow: 0 0 4px rgba(0,0,0,.45); cursor: pointer; padding: 0; }
.gw-dot.active { background: var(--green); }
.hero-small { padding: 1.4rem 0; }
.hero-small .tagline { margin: 0; font-size: 1.05rem; }

/* tipografía self-hosted (variable fonts, sin servicios externos) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-var.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/sora-var.woff2') format('woff2-variations');
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.02rem;
}
h1, h2, h3, h4, .brand, .btn, .hero h1, .product-card h3 {
  font-family: 'Sora', 'Inter', -apple-system, sans-serif;
  letter-spacing: -0.01em;
}
.hero h1 { font-weight: 700; }
h2 { font-weight: 600; }
.article-body h2, .article-body h3 { font-family: 'Sora', sans-serif; }

/* --- Banner de cookies --- */
.gw-consent { position: fixed; inset: auto 0 0 0; z-index: 9999; }
.gw-consent-box {
  background: #fff; border-top: 2px solid var(--green, #90d000);
  box-shadow: 0 -4px 18px rgba(0,0,0,.15); padding: 14px 18px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
}
.gw-consent-text { margin: 0; font-size: .9rem; line-height: 1.45; flex: 1 1 320px; }
.gw-consent-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gw-btn { border: 1px solid var(--green, #90d000); border-radius: 6px; padding: 8px 14px; font-size: .9rem; cursor: pointer; background: #fff; color: var(--green-dark, #4c7300); }
.gw-btn-accept { background: var(--green, #90d000); color: #223a00; border-color: var(--green, #90d000); }
.gw-btn:hover { filter: brightness(.95); }
.gw-consent-config {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.gw-consent-config[hidden] { display: none; }
.gw-consent[hidden] { display: none; }
.gw-consent-config-inner {
  background: #fff; border-radius: 10px; max-width: 480px; width: 100%;
  padding: 20px; max-height: 85vh; overflow: auto;
}
.gw-consent-config-inner h2 { margin-top: 0; font-size: 1.15rem; }
.gw-consent-opt { display: flex; gap: 10px; margin: 12px 0; font-size: .9rem; line-height: 1.4; }
.gw-consent-opt input { margin-top: 3px; }

/* --- Miniaturas en listados de posts --- */
.post-item { display: flex; gap: 14px; align-items: flex-start; }
.post-thumb-link { flex: 0 0 120px; }
.post-thumb { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; display: block; }
.post-item-body { flex: 1 1 auto; min-width: 0; }
@media (max-width: 480px) {
  .post-thumb-link { flex-basis: 96px; }
  .post-thumb { width: 96px; height: 96px; }
}

/* --- Aviso de afiliado --- */
.affiliate-note {
  font-size: .82rem; color: #666; background: #f4f6f4;
  border-left: 3px solid var(--green, #90d000);
  padding: 8px 12px; border-radius: 0 6px 6px 0; margin: 14px 0;
}

/* Ficha: anterior/siguiente y otras botellas */
.prevnext { display: flex; justify-content: space-between; gap: 1rem; margin: 0 auto 2.2rem; }
.prevnext a { color: var(--green-dark); font-weight: 600; }
.prevnext a:hover { text-decoration: underline; }
.other-bottles { padding-bottom: 3rem; }
.other-bottles h2 { margin-bottom: 1.2rem; }
.product-grid.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.product-grid.compact .product-card { padding: .8rem; }
.product-grid.compact .product-card img { height: 110px; }
.product-grid.compact .product-card h3 { font-size: .95rem; }
