:root {
  --cacao: #392016;
  --deep: #1f100b;
  --cream: #fff8ef;
  --paper: #f5ead9;
  --gold: #c58b2f;
  --gold-soft: #ffd793;
  --leaf: #2f6b4f;
  --red: #a64632;
  --ink: #221711;
  --muted: #6b594e;
  --line: rgba(57, 32, 22, .16);
  --shadow: 0 20px 45px rgba(31, 16, 11, .16);
  --radius: 12px;
  --wa: #1f8f57;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Manrope", Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
}

body.cart-open { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, textarea { font: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

.scroll-progress {
  position: fixed;
  z-index: 65;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--red));
  transition: width .1s linear;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 60;
  padding: 12px 16px;
  border-radius: 8px;
  color: white;
  background: var(--cacao);
  font-weight: 800;
  transition: top .2s ease;
}

.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  padding: 12px clamp(16px, 4vw, 54px);
  background: rgba(255, 248, 239, .9);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color .25s ease, box-shadow .25s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 30px rgba(31, 16, 11, .08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-img {
  height: 56px;
  width: auto; /* el logo tiene fondo transparente: no necesita fusión */
}

.brand-fallback {
  display: none;
  align-items: center;
  gap: 12px;
}

body.logo-fallback .brand-fallback { display: inline-flex; }

/* si existe assets/logo.png, se usa ese y se oculta la versión vectorial */
body:not(.logo-fallback) .brand-logo { display: none; }

/* Logo Don Cacao (versión vectorial) */
.brand-logo {
  height: 54px;
  width: auto;
  overflow: visible;
}

.logo-pod { fill: #b5854f; stroke: var(--cacao); stroke-width: 7; }
.logo-vein { fill: none; stroke: var(--cacao); stroke-width: 7; stroke-linecap: round; }
.logo-leaf { fill: var(--cacao); }
.logo-swoosh { fill: none; stroke: var(--cacao); stroke-width: 7; stroke-linecap: round; }
.logo-dot { fill: var(--cacao); }

.logo-word {
  fill: var(--cacao);
  font-family: "Dancing Script", "Playfair Display", cursive;
  font-weight: 700;
}

.brand-logo.on-dark .logo-pod { stroke: var(--gold-soft); }
.brand-logo.on-dark .logo-vein,
.brand-logo.on-dark .logo-swoosh { stroke: var(--gold-soft); }
.brand-logo.on-dark .logo-leaf,
.brand-logo.on-dark .logo-dot,
.brand-logo.on-dark .logo-word { fill: var(--gold-soft); }

.brand-sub {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.2;
  max-width: 74px;
}

nav {
  justify-self: center;
  display: flex;
  gap: clamp(14px, 2.5vw, 30px);
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
}

#main-nav a {
  position: relative;
  padding: 6px 2px;
  transition: color .2s ease;
}

#main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--gold);
  transition: right .25s ease;
}

#main-nav a:hover,
#main-nav a.active { color: var(--cacao); }
#main-nav a:hover::after,
#main-nav a.active::after { right: 0; }

.menu-toggle { display: none; }

.cart-pill,
.btn,
.add-btn,
.tour-options button {
  border: 0;
  border-radius: 10px;
  font-weight: 900;
}

.cart-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 15px;
  color: white;
  background: var(--cacao);
  transition: background .2s ease, transform .15s ease;
}

.cart-pill:hover { background: var(--deep); }
.cart-pill:active { transform: scale(.97); }

.cart-pill span {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  color: var(--deep);
  background: var(--gold);
  transition: transform .2s ease;
}

.cart-pill span.bump { animation: bump .35s ease; }

@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.45); }
  100% { transform: scale(1); }
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(360px, 1.08fr);
  min-height: calc(100vh - 76px);
  background: var(--paper);
}

.hero-media {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background: var(--deep);
  touch-action: pan-y;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to right, rgba(31, 16, 11, .18), transparent 55%);
}

.slides {
  display: flex;
  height: 100%;
  position: absolute;
  inset: 0;
  transition: transform .65s cubic-bezier(.45, .05, .2, 1);
  will-change: transform;
}

.slide {
  flex: 0 0 100%;
  height: 100%;
  overflow: hidden;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: hero-zoom 14s ease-out both;
  user-select: none;
  -webkit-user-drag: none;
}

@keyframes hero-zoom {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

.slider-arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  color: white;
  background: rgba(31, 16, 11, .45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 26px;
  line-height: 1;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding-bottom: 4px;
  transition: background .2s ease, transform .15s ease;
}

.slider-arrow:hover { background: rgba(31, 16, 11, .75); }
.slider-arrow:active { transform: translateY(-50%) scale(.92); }
.slider-arrow.prev { left: 14px; }
.slider-arrow.next { right: 14px; }

.slider-dots {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 16px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.slider-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .45);
  transition: background .25s ease, width .25s ease;
}

.slider-dots button.active {
  width: 26px;
  background: var(--gold);
}

.slide-caption {
  position: absolute;
  left: 18px;
  bottom: 40px;
  z-index: 1;
  margin: 0;
  padding: 9px 16px;
  border-radius: 999px;
  color: white;
  background: rgba(31, 16, 11, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .02em;
}

/* ---------- Cinta marquee ---------- */

.marquee {
  overflow: hidden;
  padding: 15px 0;
  background: var(--deep);
  color: var(--gold-soft);
}

.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 26px;
  width: max-content;
  animation: marquee 26s linear infinite;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}

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

.marquee-track i {
  font-style: normal;
  color: var(--red);
  font-size: 10px;
}

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

.hero-panel {
  align-self: center;
  padding: clamp(42px, 7vw, 96px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(48px, 7vw, 92px);
  line-height: .95;
}

h1 em {
  font-style: italic;
  color: var(--red);
}

h2 {
  font-size: clamp(34px, 4.5vw, 62px);
  line-height: 1.02;
}

.hero-panel p:not(.eyebrow),
.section-head p,
.story-card p,
.tourism-copy p,
.contact p {
  color: var(--muted);
  line-height: 1.65;
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 13px 20px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn.primary {
  color: var(--deep);
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  box-shadow: 0 10px 24px rgba(197, 139, 47, .35);
}

.btn.ghost { color: var(--cacao); border: 1px solid var(--line); background: white; }
.btn.whatsapp { color: white; background: var(--wa); box-shadow: 0 10px 24px rgba(31, 143, 87, .28); }
.btn.full { width: 100%; }
.btn.disabled { pointer-events: none; opacity: .55; box-shadow: none; }

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.trust-row span {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--cacao);
  background: rgba(255, 255, 255, .7);
  font-weight: 800;
  font-size: 13px;
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(60px, 8vw, 108px) clamp(16px, 5vw, 72px);
}

.section-head {
  max-width: 880px;
  margin-bottom: 30px;
}

.section-head.split {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 24px;
  align-items: end;
  max-width: none;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: white;
  font-weight: 900;
  transition: background .2s ease, color .2s ease, transform .15s ease;
}

.filter-btn.active,
.filter-btn:hover {
  color: white;
  background: var(--cacao);
}

.filter-btn:active { transform: scale(.96); }

/* ---------- Products ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.product-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 12px 28px rgba(31, 16, 11, .08);
  transition: transform .25s ease, box-shadow .25s ease;
  animation: card-in .4s ease both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 44px rgba(31, 16, 11, .16);
}

.product-card[hidden] { display: none; }

.product-image {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: var(--paper);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}

.product-card:hover .product-image img { transform: scale(1.06); }

.product-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--cream);
  background: linear-gradient(135deg, var(--cacao), var(--red));
  font-family: "Playfair Display", Georgia, serif;
  font-size: 42px;
  font-weight: 800;
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--deep);
  background: var(--gold);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(31, 16, 11, .22);
}

.product-info {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
}

.product-info h3 {
  margin: 0;
  font-size: 21px;
}

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

.variant-row,
.qty-row {
  display: grid;
  gap: 7px;
}

.variant-row label,
.qty-row label,
.cart-footer label {
  color: var(--cacao);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.variant-list {
  display: grid;
  gap: 7px;
}

.variant-option {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fffaf4;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}

.variant-option:hover { border-color: var(--gold); }

.variant-option:has(input:checked) {
  border-color: var(--gold);
  background: #fff3dd;
  color: var(--cacao);
}

.variant-option input { accent-color: var(--cacao); }

.qty-control {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qty-control button {
  border: 0;
  background: var(--paper);
  font-weight: 900;
  transition: background .15s ease;
}

.qty-control button:hover { background: var(--gold-soft); }

.qty-control input {
  min-width: 0;
  border: 0;
  text-align: center;
  font-weight: 900;
  background: white;
}

.price-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.price-line strong {
  color: var(--cacao);
  font-size: 19px;
  letter-spacing: 0;
}

.pop { animation: pop .32s ease; }

@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

.add-btn {
  align-self: end;
  min-height: 44px;
  color: white;
  background: var(--cacao);
  transition: background .25s ease, transform .15s ease;
}

.add-btn:hover { background: var(--deep); }
.add-btn:active { transform: scale(.97); }

.add-btn.added {
  background: var(--wa);
  animation: pop .32s ease;
}

.fly-dot {
  position: fixed;
  z-index: 70;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 4px 12px rgba(31, 16, 11, .35);
  pointer-events: none;
  opacity: 1;
  transition: transform .7s cubic-bezier(.45, .05, .55, .95), opacity .7s ease;
}

.burst-dot {
  position: fixed;
  z-index: 69;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  pointer-events: none;
  animation: burst-fly .65s ease-out forwards;
}

@keyframes burst-fly {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; }
}

.cart-pill.shake { animation: pill-shake .5s ease; }

@keyframes pill-shake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-6deg); }
  40% { transform: rotate(5deg); }
  60% { transform: rotate(-3deg); }
  80% { transform: rotate(2deg); }
}

.qv-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  color: white;
  background: rgba(31, 16, 11, .6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}

.product-image { cursor: zoom-in; }

.product-card:hover .qv-hint,
.product-image:focus-visible .qv-hint {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Story ---------- */

.story {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(280px, .9fr);
  gap: 24px;
  background: var(--paper);
}

.story-card {
  padding: clamp(26px, 4vw, 44px);
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* dato diferenciador: cadena de producción completa */
.highlight-box {
  position: relative;
  margin: 20px 0;
  padding: 18px 20px 18px 22px;
  border-left: 5px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: linear-gradient(100deg, #fff3dd, rgba(255, 243, 221, .35));
  color: var(--cacao) !important;
  font-weight: 700;
}

.milestones {
  display: grid;
  gap: 14px;
}

.milestones article {
  padding: 22px;
  border-left: 5px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(255, 255, 255, .72);
  transition: transform .2s ease, background .2s ease;
}

.milestones article:hover {
  transform: translateX(6px);
  background: white;
}

.milestones strong {
  color: var(--red);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 22px;
}

.stats-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.stat {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 24px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease;
}

.stat:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(31, 16, 11, .12);
}

.stat strong {
  color: var(--cacao);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1;
}

.stat > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.milestones h3 { margin: 8px 0; }
.milestones p { margin: 0; color: var(--muted); line-height: 1.55; }

/* ---------- Tourism ---------- */

.tourism {
  display: grid;
  grid-template-columns: minmax(320px, 42vw) 1fr;
  color: white;
  background: var(--deep);
}

.tourism > img {
  width: 100%;
  height: 100%;
  min-height: 620px;
  object-fit: cover;
}

.tourism-copy {
  align-self: center;
  padding: clamp(42px, 7vw, 88px);
}

.tourism-copy .eyebrow { color: var(--gold-soft); }
.tourism-copy p { color: rgba(255, 255, 255, .78); }

.tour-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}

.tour-options button {
  display: grid;
  gap: 3px;
  min-height: 62px;
  padding: 12px 16px;
  text-align: left;
  color: var(--deep);
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  transition: transform .18s ease, box-shadow .18s ease;
}

.tour-options button:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(197, 139, 47, .35);
}

.tour-options button span {
  font-size: 13px;
  font-weight: 700;
  opacity: .8;
}

/* ---------- Contact ---------- */

.contact {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 520px);
  gap: 30px;
  align-items: start;
}

.contact-box {
  display: grid;
  gap: 12px;
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: white;
  box-shadow: var(--shadow);
}

.contact-box p { margin: 0; color: var(--muted); line-height: 1.55; }
.contact-box a:not(.btn) { color: var(--cacao); font-weight: 700; }
.contact-box a:not(.btn):hover { text-decoration: underline; }

/* ---------- Cart drawer ---------- */

.cart-drawer {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(440px, 100%);
  height: 100vh;
  height: 100dvh;
  background: white;
  box-shadow: -24px 0 60px rgba(0, 0, 0, .22);
  transform: translateX(104%);
  visibility: hidden; /* evita que el teclado (Tab) entre al carrito cerrado */
  transition: transform .28s cubic-bezier(.32, .72, .35, 1), visibility 0s .28s;
}

body.cart-open .cart-drawer {
  transform: translateX(0);
  visibility: visible;
  transition: transform .28s cubic-bezier(.32, .72, .35, 1);
}

.cart-backdrop {
  position: fixed;
  z-index: 45;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  background: rgba(31, 16, 11, .48);
  transition: opacity .24s ease;
}

body.cart-open .cart-backdrop {
  visibility: visible;
  opacity: 1;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.cart-header h2 {
  font-family: "Manrope", Arial, sans-serif;
  font-size: 22px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  font-weight: 900;
  transition: background .2s ease, transform .15s ease;
}

.icon-btn:hover { background: var(--gold-soft); }
.icon-btn:active { transform: scale(.94); }

.cart-items {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 18px 22px;
}

.empty-cart { color: var(--muted); }

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffaf4;
  animation: card-in .25s ease both;
}

.cart-line h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.cart-line p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.cart-line strong { color: var(--cacao); }

.cart-line-qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.cart-line-qty button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  font-weight: 900;
  line-height: 1;
}

.cart-line-qty button:hover { background: var(--gold-soft); }

.remove-line {
  align-self: start;
  border: 0;
  color: var(--red);
  background: transparent;
  font-weight: 900;
}

.remove-line:hover { text-decoration: underline; }

.cart-footer {
  display: grid;
  gap: 12px;
  padding: 18px 22px 22px;
  border-top: 1px solid var(--line);
}

textarea {
  resize: vertical;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.number-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.number-choice legend {
  padding: 0 0 7px;
  color: var(--cacao);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.number-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.number-option:hover { border-color: var(--wa); }

.number-option:has(input:checked) {
  border-color: var(--wa);
  background: #e9f7ef;
  color: var(--leaf);
}

.number-option input { accent-color: var(--wa); }

.number-option span {
  display: grid;
  gap: 2px;
  text-align: left;
}

.number-option strong { font-size: 15px; }
.number-option small { font-size: 12px; opacity: .8; }

/* ---------- Selector de contacto WhatsApp ---------- */

.wa-chooser {
  position: fixed;
  z-index: 58;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  visibility: hidden;
  pointer-events: none;
}

body.wa-chooser-open .wa-chooser {
  visibility: visible;
  pointer-events: auto;
}

body.wa-chooser-open { overflow: hidden; }

.wa-chooser-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 16, 11, .5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .22s ease;
}

body.wa-chooser-open .wa-chooser-backdrop { opacity: 1; }

.wa-chooser-card {
  position: relative;
  width: min(420px, 100%);
  padding: 26px;
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 34px 80px rgba(31, 16, 11, .4);
  opacity: 0;
  transform: translateY(20px) scale(.95);
  transition: opacity .25s ease, transform .25s cubic-bezier(.34, 1.4, .5, 1);
}

body.wa-chooser-open .wa-chooser-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.wa-chooser-card h3 {
  margin: 0 0 16px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 24px;
}

.wa-chooser-x {
  position: absolute;
  top: 12px;
  right: 12px;
}

.wa-chooser-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wa-chooser-options button {
  display: grid;
  gap: 3px;
  padding: 16px 12px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: var(--wa);
  font-weight: 900;
  font-size: 17px;
  text-align: center;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.wa-chooser-options button:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(31, 143, 87, .35);
}

.wa-chooser-options button span {
  font-size: 12px;
  font-weight: 700;
  opacity: .85;
}

@media (max-width: 420px) {
  .wa-chooser-options { grid-template-columns: 1fr; }
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 0;
  color: var(--muted);
  font-weight: 900;
}

.cart-total strong {
  color: var(--cacao);
  font-size: 24px;
}

.link-btn {
  border: 0;
  color: var(--red);
  background: transparent;
  font-weight: 900;
}

.link-btn:hover { text-decoration: underline; }

/* ---------- Vista rápida ---------- */

.quickview {
  position: fixed;
  z-index: 55;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  visibility: hidden;
  pointer-events: none;
}

body.quickview-open .quickview {
  visibility: visible;
  pointer-events: auto;
}

body.quickview-open { overflow: hidden; }

.quickview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 16, 11, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .25s ease;
}

body.quickview-open .quickview-backdrop { opacity: 1; }

.quickview-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 1fr);
  width: min(860px, 100%);
  max-height: min(640px, 92vh);
  overflow: hidden;
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 40px 90px rgba(31, 16, 11, .4);
  opacity: 0;
  transform: translateY(26px) scale(.96);
  transition: opacity .3s ease, transform .3s cubic-bezier(.34, 1.4, .5, 1);
}

body.quickview-open .quickview-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.quickview-media {
  min-height: 320px;
  background: var(--paper);
}

.quickview-media img,
.quickview-media .product-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quickview-info {
  overflow: auto;
  padding: 26px;
}

.quickview-info .product-badge {
  position: static;
  justify-self: start;
}

.quickview-info h3 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 30px;
}

.quickview-close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
}

/* ---------- Volver arriba ---------- */

.back-top {
  position: fixed;
  z-index: 24;
  right: 18px;
  bottom: 84px;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--cacao);
  background: white;
  box-shadow: 0 10px 24px rgba(31, 16, 11, .18);
  font-size: 20px;
  font-weight: 900;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
}

.back-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-top:hover { background: var(--gold-soft); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 24px;
  padding: 13px 20px;
  border-radius: 999px;
  color: white;
  background: var(--cacao);
  box-shadow: 0 14px 34px rgba(31, 16, 11, .3);
  font-weight: 800;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity .25s ease, transform .25s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Floating WhatsApp ---------- */

.floating-whatsapp {
  position: fixed;
  z-index: 25;
  right: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 13px 18px;
  border-radius: 999px;
  color: white;
  background: var(--wa);
  box-shadow: 0 12px 28px rgba(31, 143, 87, .32);
  font-weight: 900;
  transition: transform .18s ease, box-shadow .18s ease;
}

.floating-whatsapp:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(31, 143, 87, .4);
}

.floating-whatsapp::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(31, 143, 87, .45);
  animation: wa-pulse 2.6s ease-out infinite;
  pointer-events: none;
}

@keyframes wa-pulse {
  0% { box-shadow: 0 0 0 0 rgba(31, 143, 87, .45); }
  70% { box-shadow: 0 0 0 14px rgba(31, 143, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 143, 87, 0); }
}

/* ---------- Footer ---------- */

footer {
  padding: clamp(36px, 5vw, 56px) clamp(16px, 5vw, 72px) 26px;
  color: rgba(255, 255, 255, .76);
  background: var(--deep);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: white;
  font-weight: 900;
  font-size: 18px;
}

.footer-brand .brand-logo { height: 62px; }

/* el logo es marrón oscuro: sobre el pie oscuro va en una placa clara para que contraste */
.footer-logo-img {
  height: 66px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--cream);
}

body.logo-fallback .footer-logo-img { display: none; }

.footer-grid p { margin: 0; line-height: 1.6; max-width: 420px; }

footer nav {
  display: grid;
  gap: 10px;
  justify-items: start;
  color: rgba(255, 255, 255, .76);
}

footer nav a:hover { color: var(--gold-soft); }

.footer-copy {
  margin: 22px 0 0;
  text-align: center;
  font-size: 13px;
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  .site-header {
    grid-template-columns: auto auto auto;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    font-weight: 900;
  }

  nav#main-nav {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    display: none;
    justify-content: center;
    flex-wrap: wrap;
    padding: 14px;
    background: white;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 32px rgba(31, 16, 11, .12);
  }

  nav#main-nav.open { display: flex; }

  .hero,
  .story,
  .tourism,
  .contact,
  .section-head.split {
    grid-template-columns: 1fr;
  }

  .hero-media { min-height: 360px; }
  .tourism > img { min-height: 360px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .quickview-card {
    grid-template-columns: 1fr;
    max-height: 92vh;
    overflow: auto;
  }

  .quickview-media { min-height: 240px; max-height: 300px; }
}

@media (max-width: 580px) {
  .site-header {
    gap: 9px;
    padding: 10px 12px;
  }

  .brand-sub { display: none; }
  .brand-logo { height: 44px; }
  .cart-pill { padding: 9px 11px; }
  .cart-pill span { min-width: 22px; height: 22px; }

  h1 { font-size: 45px; }
  h2 { font-size: 34px; }
  .hero-panel { padding: 34px 18px 46px; }
  .section { padding: 56px 16px; }
  .product-grid,
  .tour-options { grid-template-columns: 1fr; }
  .product-image { height: 210px; }
  .floating-whatsapp { left: 18px; right: auto; justify-content: center; }
  .back-top { bottom: 18px; }
  .toast { bottom: 84px; }
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slide-caption { left: 12px; bottom: 36px; font-size: 12px; }
}
