:root {
  --cream: #f6efe6;
  --paper: #fffaf4;
  --ink: #2b1d14;
  --muted: #8a7766;
  --gold: #c98a3c;
  --gold-dark: #8a5a2b;
  --blue: #a9d3e0;
  --line: #e7dccd;
  --ok: #2f7a4b;
  --bad: #b3261e;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(43, 29, 20, .06), 0 8px 24px rgba(43, 29, 20, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 16px/1.55 Inter, system-ui, sans-serif; }
img, video { max-width: 100%; display: block; }
a { color: var(--gold-dark); }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
h2 { font-size: 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: var(--gold-dark); font-weight: 700; margin: 0 0 .5rem; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; background: var(--ink); color: var(--paper); position: sticky; top: 0; z-index: 10; }
.topbar a { color: var(--paper); text-decoration: none; font-weight: 600; }
.brand { font-family: Fraunces, serif; font-size: 1.4rem; display: inline-flex; align-items: center; gap: 8px; }
.brand.small { font-size: 1.15rem; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(201, 138, 60, .25); }

main { min-height: 70vh; }
.narrow { max-width: 640px; margin: 32px auto; padding: 0 16px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }

.btn { display: inline-block; border: 1px solid var(--ink); background: transparent; color: var(--ink); padding: 11px 18px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--gold); border-color: var(--gold); color: #1b120b; }
.btn-primary:hover { background: #b97a2f; }
.btn-block { width: 100%; text-align: center; padding: 14px; font-size: 1.05rem; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-link { background: none; border: 0; color: var(--gold-dark); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 40px; align-items: center; max-width: 1080px; margin: 0 auto; padding: 36px 20px; }
.hero-video video { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 22px; background: #000; box-shadow: var(--shadow); }
.lead { font-size: 1.15rem; color: #5a4636; }

/* Producto */
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; max-width: 1080px; margin: 0 auto; padding: 24px 20px 40px; }
.product-media img { width: 100%; border-radius: 22px; box-shadow: var(--shadow); background: #fff; }
.stock { display: inline-block; margin: 6px 0 16px; padding: 6px 12px; border-radius: 999px; background: #e8f3ec; color: var(--ok); font-weight: 600; font-size: .9rem; }
.stock-low { background: #fff1dc; color: #9a5b0b; }
.stock-out { background: #fbe4e2; color: var(--bad); }
.tiers { display: grid; gap: 10px; }
.tier { position: relative; display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "r name price" "r detail price"; gap: 0 12px; align-items: center; padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px; background: var(--paper); cursor: pointer; }
.tier input { grid-area: r; accent-color: var(--gold); width: 18px; height: 18px; }
.tier-name { grid-area: name; font-weight: 700; }
.tier-detail { grid-area: detail; color: var(--muted); font-size: .9rem; }
.tier-price { grid-area: price; font-family: Fraunces, serif; font-size: 1.35rem; font-weight: 700; }
.tier-badge { position: absolute; top: -10px; right: 12px; background: var(--ink); color: var(--paper); font-size: .72rem; padding: 2px 8px; border-radius: 999px; }
.tier:has(input:checked) { border-color: var(--gold); background: #fff6ea; }
.tier-featured .tier-name::after { content: " ⭐"; }
.tier-disabled { opacity: .45; cursor: not-allowed; }
.hint { margin: 4px 0; color: var(--gold-dark); font-weight: 600; }

.trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 1080px; margin: 0 auto 40px; padding: 0 20px; }
.trust div { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 4px; }
.trust span { color: var(--muted); font-size: .9rem; }

/* Formularios */
label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; margin-bottom: 12px; }
input, select, textarea { font: inherit; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin-top: 4px; accent-color: var(--gold); }
fieldset { border: 1px solid var(--line); }
legend { font-family: Fraunces, serif; font-weight: 700; font-size: 1.1rem; padding: 0 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack { display: grid; gap: 4px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { max-width: 120px; }
.error { color: var(--bad); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }

/* Checkout */
.checkout { max-width: 1080px; margin: 28px auto; padding: 0 20px; }
.checkout-grid { display: grid; grid-template-columns: 1fr 360px; gap: 22px; align-items: start; }
.checkout-summary { position: sticky; top: 80px; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 14px 0; }
.totals dd { margin: 0; text-align: right; font-weight: 600; }
.t-total { font-family: Fraunces, serif; font-size: 1.3rem; font-weight: 700; border-top: 1px solid var(--line); padding-top: 8px; }
.ship-options { display: grid; gap: 8px; }
.ship-opt { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-weight: 400; margin: 0; }
.ship-opt input { width: auto; accent-color: var(--gold); }

/* Cuenta y pedido */
.account-head { display: flex; justify-content: space-between; align-items: center; }
.addr-list, .orders, .order-items { list-style: none; padding: 0; display: grid; gap: 10px; }
.addr-list li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag { display: inline-block; background: #efe5d7; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600; }
details summary { cursor: pointer; font-weight: 600; color: var(--gold-dark); margin: 8px 0; }

/* Admin */
.admin { max-width: 1200px; margin: 24px auto; padding: 0 20px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stats .card { display: grid; gap: 4px; }
.stats b { font-family: Fraunces, serif; font-size: 1.6rem; }
.inv-row { display: grid; gap: 10px; }
.inv-nums { display: flex; gap: 18px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f1e7da; }
.log { font-size: .88rem; display: grid; gap: 4px; max-height: 320px; overflow: auto; }

/* Legal */
.legal h2 { font-size: 1.15rem; margin-top: 1.2em; }
.draft { background: #fff1dc; color: #9a5b0b; padding: 6px 10px; border-radius: 8px; font-weight: 600; display: inline-block; }

/* Footer */
.footer { background: var(--ink); color: #e9dccb; padding: 36px 20px 80px; margin-top: 40px; }
.footer-grid { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.footer a { color: #f3d9b2; display: block; margin: 4px 0; text-decoration: none; }
.footer h4 { margin: 0 0 8px; color: #fff; }
.footer .muted { color: #b9a58f; font-size: .82rem; }
.wa-float { position: fixed; right: 16px; bottom: 16px; background: #25d366; color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 700; text-decoration: none; box-shadow: var(--shadow); z-index: 20; }

@media (max-width: 860px) {
  .hero, .product, .checkout-grid { grid-template-columns: 1fr; }
  .hero-video { max-width: 360px; margin: 0 auto; }
  .trust { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .checkout-summary { position: static; }
}
