:root {
  --bg: #EFEAE0;
  --paper: #FFFFFF;
  --ink: #2A2A22;
  --olive: #5B6B2F;
  --olive-dark: #465224;
  --gold: #96702F;
  --line: #E4E0D2;
  --line-strong: #B8AF93;
  --whatsapp: #25D366;
  --whatsapp-dark: #1DA851;
  --radius: 10px;
  --frame-radius: 28px;
  --frame-max: 640px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Quicksand', 'Trebuchet MS', sans-serif;
  font-weight: 500;
  line-height: 1.4;
  padding: 20px 12px 40px;
}

/* Página: siempre una sola columna, ancho fijo, sin importar el navegador */
.page {
  max-width: var(--frame-max);
  margin: 0 auto;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--frame-radius);
  padding: 28px 24px 24px;
}

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

.site-header {
  text-align: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.logo {
  width: 100%;
  max-width: 340px;
  height: auto;
  display: block;
  margin: 0 auto 4px;
}

.tagline {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.intro {
  margin: 0 auto;
  max-width: 480px;
  font-size: 0.92rem;
  color: #55554a;
  font-weight: 500;
}

/* ---------- Botones WhatsApp (reutilizados en distintos lugares) ---------- */

.wa-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--whatsapp);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
  text-align: center;
}

.wa-button:hover { background: var(--whatsapp-dark); }
.wa-button:active { transform: scale(0.98); }

.wa-button--secondary {
  background: transparent;
  color: var(--olive-dark);
  border: 2px solid var(--olive-dark);
  box-shadow: none;
}
.wa-button--secondary:hover { background: #F0EEE2; }

.wa-button--disabled {
  background: #c9c9bd;
  color: #6b6b60;
  pointer-events: none;
  box-shadow: none;
}

.wa-icon { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

/* ---------- Catalogo ---------- */

#catalogo {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.categoria-titulo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--olive-dark);
  margin: 0 0 10px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--olive);
  display: inline-block;
}

.producto {
  padding: 10px 4px;
  /*border-radius: 8px;*/
  border-bottom: 2px dotted var(--line-strong);
}

.producto:last-child { border-bottom: none; }

.producto-info {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border-radius: 8px;
  padding: 2px;
}

.producto-texto {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
}

.producto-info:hover, .producto-info:focus-visible {
  background: #F6F4EC;
}

.producto-foto {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  background: #F1EEE3;
  flex-shrink: 0;
  border: 1px solid var(--line);
}

.producto-foto--vacia {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.producto-nombre {
  flex: 0 1 auto;
  font-size: 1rem;
  font-weight: 500;
  min-width: 0;
}

.producto-leader {
  flex: 1 1 auto;
  border-bottom: 2px dotted var(--line);
  margin: 0 6px;
  min-width: 12px;
  align-self: flex-end;
}

.producto-precio {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--gold);
  font-size: 1.05rem;
  white-space: nowrap;
}

.producto-acciones {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

/* ---------- Selector de cantidad (stepper) ---------- */

.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  background: #F6F4EC;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 6px;
}

.stepper::before {
  content: "🛒";
  font-size: 0.9rem;
  margin-right: 8px;
}

.stepper-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--olive);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper-btn:hover { background: var(--olive-dark); }
.stepper-btn:active { transform: scale(0.94); }

.stepper-qty {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
}

/* ---------- Olive branch + footer ---------- */

.branch {
  display: block;
  width: 120px;
  height: auto;
  margin: 22px auto 4px;
  opacity: 0.9;
}

/* ---------- Resumen del carrito ---------- */

.resumen {
  text-align: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 4px;
  margin: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resumen-subtotal {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}

.resumen-nota {
  margin: 0 0 4px;
  font-size: 0.85rem;
  color: #6b6b5e;
}

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

.site-footer {
  text-align: center;
  padding-top: 14px;
}

.footer-note {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

.footer-meta {
  font-size: 0.8rem;
  color: #6b6b5e;
  margin: 0 0 6px;
}

.footer-copy {
  font-size: 0.78rem;
  color: #8a8a7a;
  margin: 0;
}

/* ---------- Modal de producto ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 15, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-overlay[hidden] { display: none; }

.modal-card {
  position: relative;
  background: var(--paper);
  border-radius: 14px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px 20px 24px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.modal-cerrar {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #F1EEE3;
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
}
.modal-cerrar:hover { background: #E4E0D2; }

.modal-foto-wrap {
  width: 100%;
  height: 220px;
  border-radius: 10px;
  background: #F6F4EC;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 14px;
}

.modal-foto-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-foto-wrap .producto-foto--vacia {
  width: 100%;
  height: 100%;
  font-size: 3.5rem;
  border-radius: 0;
  border: none;
}

.modal-nombre {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-precio {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
}

.modal-descripcion {
  margin: 0 0 18px;
  font-size: 0.92rem;
  color: #4a4a40;
  text-align: left;
}

.modal-stepper-wrap {
  display: flex;
  justify-content: center;
}
