:root {
  --cream: #F6EFE9;
  --cream-2: #EFD5CF;
  --paper: #FFFFFF;
  --ink: #1A1414;
  --ink-2: #5B3A32;
  --muted: #B07F78;
  --line: #EFD5CF;
  --accent: #5B3A32;
  --wa: #1f8f4e;
  --choco: #5B3A32;
  --rose: #D9A39B;
  --radius: 4px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", system-ui, -apple-system, Segoe UI, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: .01em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
[hidden] { display: none !important; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: rgba(246, 239, 233, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-logo img { height: 34px; width: auto; }
.topbar-nav { display: flex; align-items: center; gap: 22px; font-size: .88rem; letter-spacing: .08em; text-transform: uppercase; }
.topbar-nav a { text-decoration: none; }
.topbar-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.bag-btn {
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--choco); color: var(--cream);
  border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer;
}
.bag-count {
  min-width: 20px; height: 20px; border-radius: 999px; padding: 0 6px;
  background: var(--cream); color: var(--ink);
  display: inline-grid; place-items: center; font-size: .75rem; font-weight: 500;
}
.bag-btn.bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.08); } }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 64px 20px 56px;
  border-bottom: 1px solid var(--line);
  background-image: radial-gradient(ellipse at top, var(--paper), transparent 70%);
}
.hero-logo { width: min(560px, 88vw); margin: 0 auto; }
.hero-text { max-width: 520px; margin: 22px auto 26px; color: var(--ink-2); font-size: 1.05rem; font-weight: 300; }

.btn {
  display: inline-block; font-family: var(--sans); font-size: .85rem; letter-spacing: .12em; text-transform: uppercase;
  padding: 13px 26px; border-radius: var(--radius); text-decoration: none; cursor: pointer; border: 1px solid var(--choco);
  transition: background .15s, color .15s;
}
.btn-dark { background: var(--choco); color: var(--cream); }
.btn-dark:hover { background: transparent; color: var(--choco); }

/* ---------- Catalog ---------- */
.catalog { max-width: 1180px; margin: 0 auto; padding: 48px 20px 32px; }
.catalog-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.catalog-head h2, .how h2 { font-size: 2.4rem; }
.search input {
  font: inherit; width: min(300px, 100%);
  padding: 10px 14px; border: 1px solid var(--rose); border-radius: var(--radius);
  background: var(--paper); color: var(--ink);
}
.search input:focus { outline: 2px solid var(--choco); outline-offset: 1px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 26px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; font: inherit; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--rose);
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.chip[aria-selected="true"] { background: var(--choco); border-color: var(--choco); color: var(--cream); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden;
}
.card.out { opacity: .6; }
.photo {
  position: relative; aspect-ratio: 1 / 1; background: var(--cream-2);
  display: grid; place-items: center; overflow: hidden;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .ph { font-family: var(--serif); font-size: 4rem; color: rgba(91,58,50,.28); font-style: italic; }
.tag {
  position: absolute; top: 10px; left: 10px; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  background: var(--rose); color: var(--ink); padding: 4px 9px; border-radius: 2px;
}
.tag.soldout { background: var(--muted); color: #fff; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-cat { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.card h3 { font-size: 1.35rem; line-height: 1.15; }
.card-desc { font-size: .88rem; color: var(--ink-2); margin: 0; font-weight: 300; }
.prices { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 4px; }
.price { font-size: 1.15rem; font-weight: 500; }
.price-mm { font-size: .8rem; color: var(--accent); }
.card select, .field input {
  font: inherit; font-size: .88rem; width: 100%;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink);
}
.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 10px; }
.qty {
  display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
.qty button { font: inherit; width: 30px; height: 36px; border: 0; background: none; cursor: pointer; color: var(--ink); }
.qty input { width: 34px; text-align: center; border: 0; font: inherit; background: none; color: var(--ink); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.add-btn {
  flex: 1; font: inherit; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  background: var(--choco); color: var(--cream); border: 0; border-radius: var(--radius); cursor: pointer;
}
.add-btn:disabled { background: var(--muted); cursor: not-allowed; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- How ---------- */
.how { max-width: 1180px; margin: 0 auto; padding: 40px 20px 64px; border-top: 1px solid var(--line); }
.steps { list-style: none; padding: 0; margin: 26px 0 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; }
.steps li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.steps .num { font-family: var(--serif); font-size: 2.2rem; line-height: 1; color: var(--rose); }
.steps h3 { font-size: 1.4rem; margin: 8px 0 4px; }
.steps p { margin: 0; color: var(--ink-2); font-weight: 300; }
.wholesale { border-left: 2px solid var(--choco); padding: 4px 0 4px 18px; max-width: 640px; }
.wholesale h3 { font-size: 1.5rem; }
.wholesale p { margin: 6px 0; font-weight: 300; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 40px 20px 90px; border-top: 1px solid var(--line); background: var(--cream-2); }
.footer-logo { width: 220px; margin: 0 auto 16px; }
.social { display: flex; justify-content: center; gap: 22px; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }

/* ---------- Bag panel ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20,20,20,.35); z-index: 40; }
.bag {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(420px, 100vw); background: var(--paper);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
  box-shadow: -8px 0 30px rgba(0,0,0,.08);
}
.bag.open { transform: none; }
.bag-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.bag-head h2 { font-size: 1.8rem; }
.icon-btn { font-size: 1.8rem; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--ink); }
.bag-body { flex: 1; overflow-y: auto; padding: 8px 20px; }
.bag-empty { color: var(--muted); text-align: center; padding: 40px 0; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line-name { font-family: var(--serif); font-size: 1.15rem; line-height: 1.2; }
.line-meta { font-size: .8rem; color: var(--muted); }
.line-price { text-align: right; font-weight: 500; }
.line-controls { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
.link-btn { font: inherit; font-size: .8rem; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 4px 0; }
.bag-foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.bag-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1rem; }
.bag-total strong { font-size: 1.4rem; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--ink-2); }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; width: 100%; }
.btn-wa:hover { filter: brightness(1.08); }
.btn-wa:disabled { background: var(--muted); border-color: var(--muted); cursor: not-allowed; }

/* ---------- Floating WhatsApp + toast ---------- */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 20;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--wa); color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%);
  background: var(--choco); color: var(--cream); padding: 10px 18px; border-radius: 999px; font-size: .88rem;
  transition: transform .25s ease, opacity .25s ease; z-index: 60; white-space: nowrap; opacity: 0;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 640px) {
  .topbar-nav a { display: none; }
  .topbar-logo img { height: 28px; }
  .hero { padding: 44px 16px 40px; }
  .catalog, .how { padding-left: 16px; padding-right: 16px; }
  .catalog-head h2, .how h2 { font-size: 2rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-body { padding: 10px 10px 12px; }
  .card h3 { font-size: 1.1rem; }
  .card-desc { display: none; }
  .card-actions { flex-direction: column; }
  .qty { justify-content: space-between; }
  .add-btn { padding: 10px 0; }
  .search, .search input { width: 100%; }
}
