:root {
  --cream: #fbf6ef;
  --paper: #ffffff;
  --ink: #3b2f2a;
  --muted: #7a6a61;
  --terracotta: #c8643b;
  --terracotta-dark: #a94f2b;
  --sage: #8fa58a;
  --rose: #f2d7cf;
  --line: #ecdfd3;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(59, 47, 42, 0.08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; line-height: 1.15; margin: 0 0 0.4em; }
a { color: inherit; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(251, 246, 239, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: "Fraunces", serif; font-weight: 700; font-size: 1.3rem; }
.brand-yarn { width: 34px; height: 34px; fill: var(--terracotta); stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }
.brand-yarn path { fill: none; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 600; color: var(--muted); }
.nav a:hover { color: var(--terracotta); }
.cart-btn {
  position: relative; border: 0; background: var(--paper); width: 44px; height: 44px;
  border-radius: 50%; cursor: pointer; box-shadow: var(--shadow); display: grid; place-items: center;
}
.cart-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cart-count {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--terracotta); color: #fff; font-size: 0.75rem; font-weight: 700;
  display: grid; place-items: center;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font: inherit; font-weight: 700;
  border: 2px solid transparent; cursor: pointer; text-decoration: none; transition: 0.15s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.btn-primary { background: var(--terracotta); color: #fff; }
.btn-primary:hover { background: var(--terracotta-dark); }
.btn-primary:disabled { background: #d9c7bd; cursor: not-allowed; }
.btn-ghost { border-color: var(--terracotta); color: var(--terracotta); background: transparent; }
.btn-ghost:hover { background: var(--rose); }
.btn-block { width: 100%; }
.link { background: none; border: 0; color: var(--terracotta); font: inherit; font-weight: 700; cursor: pointer; padding: 0; }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(24px, 5vw, 64px); align-items: center;
  padding: clamp(32px, 7vw, 90px) clamp(16px, 6vw, 80px);
  max-width: 1200px; margin: 0 auto;
}
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; color: var(--sage); font-size: 0.85rem; margin: 0 0 8px; }
.hero h1 { font-size: clamp(2.8rem, 7vw, 5rem); }
.hero h1 em { color: var(--terracotta); font-style: italic; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 36ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-photo { position: relative; justify-self: center; }
.hero-photo img {
  width: min(420px, 80vw); aspect-ratio: 1; object-fit: cover; object-position: center 20%;
  border-radius: 50%; border: 10px solid var(--paper); box-shadow: var(--shadow);
}
.hero-badge {
  position: absolute; bottom: 18px; left: -6px; background: var(--paper); padding: 8px 16px;
  border-radius: 999px; font-weight: 700; box-shadow: var(--shadow); font-family: "Fraunces", serif;
}

/* Sections */
.section { padding: clamp(48px, 7vw, 90px) clamp(16px, 6vw, 80px); max-width: 1200px; margin: 0 auto; }
.section-alt { max-width: none; background: var(--paper); }
.section-alt > * { max-width: 1040px; margin-left: auto; margin-right: auto; }
.section-head { text-align: center; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(2rem, 4vw, 2.6rem); }
.section-head p { color: var(--muted); max-width: 60ch; margin: 0 auto; }

/* Catalog */
.filters { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.chip {
  border: 1px solid var(--line); background: var(--paper); padding: 8px 16px; border-radius: 999px;
  font: inherit; font-weight: 600; cursor: pointer; color: var(--muted);
}
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.card {
  background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform 0.15s;
}
.card:hover { transform: translateY(-3px); }
.card-img { background: #fff; aspect-ratio: 1; border: 0; padding: 0; cursor: zoom-in; position: relative; }
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.card-img .more {
  position: absolute; bottom: 10px; right: 10px; background: rgba(59, 47, 42, 0.75); color: #fff;
  font-size: 0.75rem; padding: 2px 8px; border-radius: 999px;
}
.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; border-top: 1px solid var(--line); }
.code {
  align-self: flex-start; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em;
  background: var(--rose); color: var(--terracotta-dark); padding: 2px 10px; border-radius: 999px;
}
.card h3 { font-size: 1.1rem; margin: 2px 0 0; }
.price { font-weight: 700; font-size: 1.1rem; margin: 0; }
.price.pending { color: var(--muted); font-weight: 600; font-size: 0.95rem; }
.card .btn { margin-top: auto; padding: 10px 16px; }

/* Special orders */
.special { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 36px; align-items: start; }
.special-info { list-style: none; padding: 24px; margin: 0; background: var(--cream); border-radius: var(--radius); display: grid; gap: 14px; }
.form { display: grid; gap: 14px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 0.92rem; min-width: 0; }
.form input, .form textarea, .form select {
  width: 100%; min-width: 0; font: inherit; font-weight: 400; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.form input:focus, .form textarea:focus, .form select:focus { outline: 2px solid var(--terracotta); border-color: transparent; }
.form .invalid { border-color: #c0392b; }
.upload { border: 2px dashed var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 10px; justify-items: start; }
.upload.dragover { border-color: var(--terracotta); background: var(--rose); }
.upload.invalid { border-color: #c0392b; }
.upload-preview { display: flex; align-items: center; gap: 12px; }
.upload-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0; }
.date-warning { background: #fff4e5; color: #8a5300; padding: 10px 14px; border-radius: 12px; margin: 0; font-size: 0.9rem; }
.form-status { margin: 0; font-weight: 600; }
.form-status.ok { color: #2e7d4f; }
.form-status.err { color: #c0392b; }

/* Payments */
.steps { list-style: none; padding: 0; margin: 0 0 36px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.steps li { background: var(--paper); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.steps span {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--sage); color: #fff; font-weight: 700; margin-bottom: 10px;
}
.steps h3 { font-size: 1.1rem; }
.steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.bank {
  background: var(--ink); color: #fff; border-radius: var(--radius); padding: 26px 28px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; max-width: 820px; margin: 0 auto;
}
.bank div { display: grid; gap: 2px; }
.bank small { text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.65; font-size: 0.72rem; }
.bank strong { font-size: 1.05rem; word-break: break-all; display: flex; align-items: center; gap: 8px; }
.copy { background: rgba(255, 255, 255, 0.15); border: 0; color: #fff; border-radius: 8px; padding: 2px 8px; font: inherit; font-size: 0.75rem; cursor: pointer; }
.bank-compact { padding: 18px 20px; margin: 16px 0; }

/* Footer */
.footer { text-align: center; padding: 36px 16px; color: var(--muted); border-top: 1px solid var(--line); }
.footer p { margin: 4px 0; }

/* Modals */
.modal {
  border: 0; border-radius: 22px; padding: 28px; width: min(860px, 94vw); max-height: 92vh;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25); color: var(--ink);
}
.modal::backdrop { background: rgba(59, 47, 42, 0.5); }
.modal-close { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 2rem; cursor: pointer; color: var(--muted); line-height: 1; }
.product-view { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; }
.pv-gallery img#pvMain { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 14px; border: 1px solid var(--line); }
.pv-thumbs { display: flex; gap: 8px; margin-top: 10px; }
.pv-thumbs button { width: 64px; height: 64px; padding: 0; border: 2px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; overflow: hidden; }
.pv-thumbs button.active { border-color: var(--terracotta); }
.pv-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.pv-info { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding-top: 12px; }
.pv-info h3 { font-size: 1.7rem; }
.pv-info p { margin: 0; color: var(--muted); }
.pv-info .price { color: var(--ink); }
#checkoutModal { width: min(560px, 94vw); }
.order-id { margin: 0 0 10px; color: var(--muted); }
.summary { border: 1px solid var(--line); border-radius: 14px; padding: 6px 14px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.summary div:last-child { border-bottom: 0; font-weight: 700; }

/* Cart drawer */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100vw); background: var(--paper); z-index: 40;
  transform: translateX(100%); transition: transform 0.25s; display: flex; flex-direction: column;
  visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15); }
.drawer-head { position: relative; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 24px; }
.drawer-foot { padding: 18px 24px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.total { display: flex; justify-content: space-between; font-size: 1.15rem; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); }
.cart-item h4 { margin: 0; font-size: 0.95rem; }
.cart-item small { color: var(--muted); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 700; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.scrim { position: fixed; inset: 0; background: rgba(59, 47, 42, 0.4); z-index: 30; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.scrim.open { opacity: 1; pointer-events: auto; }

/* WhatsApp flotante */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 25;
  display: flex; align-items: center; gap: 10px; padding: 12px 18px 12px 14px;
  background: #25d366; color: #fff; text-decoration: none; font-weight: 700;
  border-radius: 999px; box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
  transition: transform 0.15s;
}
.wa-float:hover { transform: scale(1.05); }
.wa-float svg { width: 30px; height: 30px; fill: #fff; flex: none; }
.footer { padding-bottom: 90px; }

@media (max-width: 860px) {
  .wa-float { padding: 14px; right: 16px; bottom: 16px; }
  .wa-float span { display: none; }
  .hero, .special, .product-view { grid-template-columns: 1fr; }
  .hero { text-align: center; }
  .lead { margin: 0 auto; }
  .hero-cta { justify-content: center; }
  .hero-photo { order: -1; }
  .steps { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
  .cart-btn { margin-left: auto; }
}
@media (max-width: 520px) {
  .form .row, .steps { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card-body { padding: 10px 12px 14px; }
  .card h3 { font-size: 0.95rem; }
}
