:root {
  --bg: #ebe8e2;
  --bg-2: #e2ded6;
  --surface: #f6f4f0;
  --line: #d5cfc5;
  --text: #3b2a1e;
  --muted: #7a6150;
  --wood: #a8713f;
  --wood-dark: #c4956a;
  --glow: #ffe2b0;
  --radius: 14px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.1; }
h1 em, h2 em, .brand em { font-style: italic; color: var(--wood); }
.muted { color: var(--muted); }
.eyebrow {
  font-size: .75rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--wood); margin-bottom: .75rem;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 2rem;
  padding: .75rem clamp(1rem, 4vw, 3rem);
  background: rgba(235, 232, 226, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: 1.05rem; letter-spacing: .14em; text-transform: uppercase; }
.brand img { object-fit: contain; }
.nav { display: flex; gap: 1.75rem; margin-left: auto; font-size: .92rem; color: var(--muted); }
.nav a:hover { color: var(--text); }
.cart-btn {
  position: relative; background: none; border: 1px solid var(--line); color: var(--text);
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
}
.cart-btn:hover { border-color: var(--wood); }
.cart-count {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--wood); color: var(--bg);
  font-size: .7rem; font-weight: 600; display: grid; place-items: center;
}
.cart-count:empty, .cart-count[data-n="0"] { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .85rem 1.5rem; border-radius: 999px; border: 1px solid transparent;
  font-weight: 500; font-size: .95rem; transition: .2s;
}
.btn-primary { background: var(--wood); color: var(--bg); }
.btn-primary:hover { background: var(--text); box-shadow: 0 0 30px rgba(168, 113, 63, .35); }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--wood); }
.btn.full { width: 100%; }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center;
  padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem);
  max-width: 1280px; margin: 0 auto;
}
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); margin-bottom: 1.25rem; }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 34rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 2rem; }
.hero-actions.center { justify-content: center; }
.hero-media { position: relative; }
.hero-media img {
  position: relative; border-radius: var(--radius); aspect-ratio: 4/5; object-fit: cover; width: 100%;
  box-shadow: 0 30px 80px rgba(80, 50, 25, .25);
}
.glow {
  position: absolute; inset: -15%;
  background: radial-gradient(circle at 40% 45%, rgba(255, 200, 130, .22), transparent 60%);
  filter: blur(20px);
}

/* Features */
.features {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.feature { padding: 1.75rem clamp(1rem, 3vw, 2rem); border-right: 1px solid var(--line); }
.feature:last-child { border-right: 0; }
.feature strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.15rem; margin-bottom: .25rem; }
.feature span { color: var(--muted); font-size: .9rem; }

/* Manifiesto artesanal */
.manifesto { text-align: center; padding: clamp(4rem, 8vw, 7rem) clamp(1rem, 4vw, 3rem) 0; max-width: 1000px; margin: 0 auto; }
.manifesto h2 { font-size: clamp(2rem, 4.5vw, 3.4rem); margin-bottom: 3rem; }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; text-align: left; }
.vs-col { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; }
.vs-col h3 { font-size: 1.4rem; margin-bottom: 1rem; }
.vs-col ul { list-style: none; padding: 0; display: grid; gap: .7rem; }
.vs-col li { display: flex; gap: .7rem; font-size: .95rem; }
.vs-col.yes { background: rgba(196, 149, 106, .1); border-color: var(--wood-dark); }
.vs-col.yes li::before { content: "✓"; color: var(--wood); }
.vs-col.no { color: var(--muted); }
.vs-col.no li::before { content: "✕"; color: #7d6f62; }
@media (max-width: 700px) { .vs { grid-template-columns: 1fr; } }

/* Sections */
section { scroll-margin-top: 70px; }
.section-head { text-align: center; margin-bottom: 3rem; }
.section-head h2, .craft h2, .contact h2 { font-size: clamp(2rem, 4vw, 3rem); }

/* Shop */
.shop { padding: clamp(4rem, 8vw, 7rem) clamp(1rem, 4vw, 3rem); max-width: 1280px; margin: 0 auto; }
.filters { justify-content: center; margin: -1.5rem 0 2.5rem; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: .25s;
}
.card:hover { transform: translateY(-4px); border-color: var(--wood-dark); }
.card-img { display: block; position: relative; aspect-ratio: 4/5; overflow: hidden; cursor: pointer; background: var(--bg-2); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.card:hover .card-img img { transform: scale(1.04); }
.badge {
  position: absolute; top: 1rem; left: 1rem; padding: .3rem .7rem; border-radius: 999px;
  background: var(--wood); color: var(--surface); font-size: .72rem; font-weight: 600; letter-spacing: .04em;
}
.card-body { padding: 1.4rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card-body h3 { font-size: 1.5rem; }
.card-body p { color: var(--muted); font-size: .92rem; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: .75rem; }
.price { font-family: var(--serif); font-size: 1.5rem; }

/* Craft */
.craft {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: center;
  padding: clamp(4rem, 8vw, 7rem) clamp(1rem, 4vw, 3rem);
  background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.craft-media img { border-radius: var(--radius); aspect-ratio: 4/5; object-fit: cover; width: 100%; max-width: 540px; margin-left: auto; }
.craft-text { max-width: 520px; }
.craft-text > p { color: var(--muted); margin: 1.25rem 0 2rem; }
.steps { list-style: none; padding: 0; display: grid; gap: 1rem; }
.steps li { display: flex; gap: 1rem; align-items: baseline; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.steps span { font-family: var(--serif); color: var(--wood); font-size: 1.1rem; }

/* FAQ */
.info { padding: clamp(4rem, 8vw, 7rem) clamp(1rem, 4vw, 3rem); max-width: 820px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 1.25rem 0; }
.faq summary {
  cursor: pointer; list-style: none; font-family: var(--serif); font-size: 1.2rem;
  display: flex; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--wood); transition: .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); margin-top: .75rem; }

/* Contact */
.contact {
  text-align: center; padding: clamp(4rem, 8vw, 7rem) 1rem;
  background: radial-gradient(ellipse at center, rgba(196, 149, 106, .12), transparent 60%);
}
.contact-logo { width: min(420px, 90%); margin: 0 auto 1rem; }
.contact > p { color: var(--muted); margin-top: .75rem; }

.site-footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding: 1.5rem clamp(1rem, 4vw, 3rem); border-top: 1px solid var(--line);
  color: var(--muted); font-size: .85rem;
}

/* Modal */
.modal {
  margin: auto;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text);
  padding: 0; width: min(980px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem);
}
.modal.small { width: min(520px, calc(100vw - 2rem)); }
.modal::backdrop { background: rgba(59, 42, 30, .55); backdrop-filter: blur(3px); }
.close {
  position: absolute; top: .75rem; right: .75rem; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 1.4rem; line-height: 1;
}
.specs { list-style: none; padding: 0; font-size: .9rem; border-top: 1px solid var(--line); }
.specs li { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.specs li span:first-child { color: var(--muted); }
.option-group { display: grid; gap: .5rem; }
.option-group > span { font-size: .85rem; color: var(--muted); }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--text); font-size: .88rem;
}
.chip.active { border-color: var(--wood); background: rgba(196, 149, 106, .15); }
.buy-row { display: flex; gap: .75rem; align-items: center; margin-top: .5rem; }
.buy-row .btn { flex: 1; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.qty button { background: none; border: 0; color: var(--text); width: 36px; height: 40px; font-size: 1.1rem; }
.qty span { min-width: 1.5rem; text-align: center; }

.chip i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); }

/* Página de producto */
.pdp { max-width: 1280px; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem); }
.crumbs { display: flex; gap: .5rem; font-size: .85rem; color: var(--muted); margin-bottom: 1.5rem; }
.crumbs a:hover { color: var(--wood); }
.pdp-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.pdp-gallery { position: sticky; top: 90px; display: grid; gap: .75rem; }
.pdp-main { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.pdp-main img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.pdp-thumbs { display: flex; gap: .75rem; }
.pdp-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: none; opacity: .6; transition: .2s; }
.pdp-thumbs button.active, .pdp-thumbs button:hover { opacity: 1; border-color: var(--wood); }
.pdp-thumbs img { width: 88px; height: 110px; object-fit: cover; }
.pdp-info { display: flex; flex-direction: column; gap: 1.25rem; }
.pdp-info h1 { font-size: clamp(2.6rem, 5vw, 4rem); margin-top: -.5rem; }
.pdp-price { display: flex; align-items: baseline; gap: .75rem; }
.pdp-price .price { font-size: 2rem; }
.pdp-price small { color: var(--muted); }
.handmade-tag {
  display: flex; gap: 1rem; align-items: center; padding: 1rem 1.25rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.handmade-tag img { width: 52px; height: 52px; flex: none; }
.handmade-tag strong { display: block; }
.handmade-tag span { color: var(--muted); font-size: .88rem; }
.pdp-desc { font-size: 1.05rem; }
.highlights { list-style: none; padding: 0; display: grid; gap: .4rem; }
.highlights li { display: flex; gap: .6rem; }
.highlights li::before { content: "✓"; color: var(--wood); }
.option-group b { color: var(--text); font-weight: 500; }
.trust { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); }
.trust li { padding: .9rem .6rem; text-align: center; font-size: .78rem; color: var(--muted); border-right: 1px solid var(--line); }
.trust li:last-child { border-right: 0; }
.trust b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.05rem; color: var(--text); }
.pdp-acc details:first-child { border-top: 1px solid var(--line); }
.pdp-acc details p + p { margin-top: .75rem; }
.pdp-acc .specs { margin-top: .75rem; border-top: 0; }

.pdp-process { padding: clamp(4rem, 8vw, 6rem) clamp(1rem, 4vw, 3rem); background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pdp-process h2 { font-size: clamp(2rem, 4vw, 3rem); }
.process { list-style: none; padding: 0; max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.process li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; color: var(--muted); font-size: .92rem; }
.process span { display: block; font-family: var(--serif); color: var(--wood); font-size: 1.6rem; margin-bottom: .5rem; }
.process strong { display: block; color: var(--text); font-family: var(--serif); font-weight: 400; font-size: 1.2rem; margin-bottom: .35rem; }

.sticky-buy { display: none; }

/* Drawer */
.overlay { position: fixed; inset: 0; background: rgba(59, 42, 30, .45); opacity: 0; pointer-events: none; transition: .3s; z-index: 30; }
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: min(420px, 100vw);
  background: var(--surface); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .35s ease;
}
.drawer.open { transform: none; }
.drawer-head { position: relative; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 1.5rem; }
.drawer-head .close { top: 1rem; }
.drawer-items { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.empty { text-align: center; color: var(--muted); padding: 3rem 0; }
.empty img { width: 90px; margin: 0 auto 1rem; opacity: .6; }
.line-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.line-item img { width: 72px; height: 90px; object-fit: cover; border-radius: 8px; }
.line-item h4 { font-family: var(--serif); font-weight: 400; font-size: 1.05rem; }
.line-item small { color: var(--muted); display: block; }
.line-item .qty { margin-top: .5rem; width: max-content; }
.line-item .qty button { height: 30px; width: 30px; }
.line-item .right { text-align: right; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; }
.remove { background: none; border: 0; color: var(--muted); font-size: .8rem; text-decoration: underline; }
.drawer-foot { padding: 1.25rem 1.5rem; border-top: 1px solid var(--line); display: grid; gap: .5rem; }
.drawer-foot .row { display: flex; justify-content: space-between; }
.drawer-foot .row.muted { color: var(--muted); font-size: .9rem; }
.drawer-foot .total { font-family: var(--serif); font-size: 1.3rem; margin-bottom: .5rem; }

/* Checkout */
.checkout { padding: 2rem; display: grid; gap: .9rem; }
.checkout h3 { font-size: 1.8rem; }
.checkout label { display: grid; gap: .3rem; font-size: .85rem; color: var(--muted); }
.checkout input, .checkout textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: .7rem .8rem; resize: vertical;
}
.checkout input:focus, .checkout textarea:focus { outline: none; border-color: var(--wood); }
.checkout-summary { background: var(--bg); border-radius: 8px; padding: 1rem; font-size: .88rem; }
.checkout-summary div { display: flex; justify-content: space-between; gap: 1rem; }
.checkout-summary .t { border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .5rem; font-weight: 600; }
.checkout-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.checkout-actions .btn { flex: 1; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 2rem; transform: translate(-50%, 300%); z-index: 50; visibility: hidden;
  background: var(--text); color: var(--bg); padding: .8rem 1.4rem; border-radius: 999px; font-weight: 500;
  transition: transform .35s; box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }

/* Responsive */
@media (max-width: 900px) {
  .nav { display: none; }
  .cart-btn { margin-left: auto; }
  .hero, .craft { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .features { grid-template-columns: 1fr 1fr; }
  .feature:nth-child(2) { border-right: 0; }
  .feature:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .craft-media img { margin: 0 auto; }
  .pdp-grid { grid-template-columns: 1fr; }
  .pdp-gallery { position: static; }
  .process { grid-template-columns: 1fr 1fr; }
  .trust { grid-template-columns: 1fr 1fr; }
  .trust li:nth-child(2) { border-right: 0; }
  .trust li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .sticky-buy {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    padding: .75rem 1rem; background: var(--surface); border-top: 1px solid var(--line);
  }
  .sticky-buy strong { display: block; font-family: var(--serif); font-weight: 400; }
  .sticky-buy .price { font-size: 1.1rem; }
  body:has(.sticky-buy) .site-footer { padding-bottom: 5rem; }
}
@media (max-width: 480px) {
  .products { grid-template-columns: 1fr; }
  .brand span { font-size: 1.15rem; }
}

/* Pedido: errores y confirmación */
.form-error { color: #a33a2a; font-size: .9rem; min-height: 1.2em; }
.form-error:empty { display: none; }
.btn:disabled { opacity: .6; cursor: wait; }
.checkout.done { text-align: center; justify-items: center; }
.checkout.done img { margin-bottom: .5rem; }
.not-found, .load-error { text-align: center; padding: 4rem 1rem; display: grid; gap: 1rem; justify-items: center; }
