:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #1c1917;
  --muted: #6f6760;
  --line: #e8e1d6;
  --dark: #141110;
  --gold: #a8844c;
  --gold-soft: #f1e8d8;
  --wa: #1f9d55;
  --wa-dark: #187a42;
  --danger: #9b3b3b;
  --radius: 14px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
}
button, input, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: var(--dark); color: #f5efe6;
}
.wordmark {
  font-family: var(--serif); font-weight: 600; font-size: 24px;
  letter-spacing: .32em; color: inherit; text-decoration: none;
}
.wordmark.small { font-size: 20px; margin: 0 0 6px; }
.bag-btn {
  position: relative; display: grid; place-items: center;
  width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: transparent; color: #f5efe6; cursor: pointer;
}
.bag-btn:hover { background: rgba(255,255,255,.08); }
.bag-count {
  position: absolute; top: 2px; right: 0;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--gold); color: #fff; font-size: 11px; font-weight: 600;
  display: grid; place-items: center;
}

/* hero */
.hero {
  padding: 44px 20px 28px; text-align: center;
  background: linear-gradient(180deg, var(--dark) 0%, #2a221c 100%);
  color: #f5efe6;
}
.eyebrow {
  margin: 0 0 8px; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: #cdb48a;
}
.hero h1 {
  margin: 0 auto 12px; max-width: 640px;
  font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 6vw, 46px); line-height: 1.1;
}
.lead { margin: 0 auto; max-width: 520px; color: #d9cfc2; }

/* controls */
.controls {
  max-width: 1120px; margin: 0 auto; padding: 20px 20px 4px;
  display: grid; gap: 14px;
}
.search {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 46px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted);
}
.search:focus-within { border-color: var(--gold); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); min-width: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; white-space: nowrap;
}
.chip[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--gold-soft); color: var(--ink); font-weight: 500; }
select {
  height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer;
}

/* grid */
main { max-width: 1120px; margin: 0 auto; padding: 8px 20px 48px; }
.result-count { margin: 6px 0 14px; color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.media { position: relative; aspect-ratio: 1 / 1; background: var(--gold-soft); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-family: var(--serif); font-size: clamp(40px, 9vw, 64px); color: rgba(255,255,255,.92);
}
.ph.perfume { background: linear-gradient(150deg, #3b2f27, #8a6a45); }
.ph.decant { background: linear-gradient(150deg, #3d3350, #8a7aa8); }
.ph.body { background: linear-gradient(150deg, #b46e7d, #e6b8a6); }
.ph.creme { background: linear-gradient(150deg, #9c8a6a, #e2d3b2); }
.ph.kit { background: linear-gradient(150deg, #1d2b2a, #5d8a7f); }
.badge {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  background: rgba(255,255,255,.92); color: var(--ink);
}
.badge.out { background: var(--danger); color: #fff; }
.info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.brand { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.name { margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.15; }
.meta { color: var(--muted); font-size: 13px; }
.desc { color: var(--muted); font-size: 13px; margin: 2px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sizes { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.sizes button {
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 13px;
}
.sizes button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.price { margin-top: auto; padding-top: 8px; font-size: 18px; font-weight: 600; }
.card .btn { margin-top: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 16px; border-radius: 10px; border: 0; cursor: pointer;
  font-weight: 600; font-size: 14px; text-decoration: none; text-align: center;
}
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #3a332e; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-dark); }

.skeleton { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.skeleton .media { animation: pulse 1.4s ease-in-out infinite; }
.skeleton .line { height: 12px; margin: 12px 14px; border-radius: 6px; background: var(--line); animation: pulse 1.4s ease-in-out infinite; }
.skeleton .line.short { width: 50%; }
@keyframes pulse { 50% { opacity: .55; } }

.empty, .error { text-align: center; padding: 48px 0; color: var(--muted); }
.link-btn { border: 0; background: none; color: var(--gold); text-decoration: underline; cursor: pointer; }

/* footer */
.footer { padding: 36px 20px 48px; text-align: center; background: var(--dark); color: #d9cfc2; }
.footer p { margin: 0 0 6px; }
.footer-wa { color: #fff; font-weight: 600; text-decoration: none; }
.fine { font-size: 12px; color: var(--muted); margin-top: 14px !important; }
.footer .fine { color: #8f857a; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(20,17,16,.45); z-index: 30; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40;
  width: min(420px, 100%); background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 600; }
.icon-btn { width: 38px; height: 38px; border: 0; background: transparent; font-size: 28px; line-height: 1; cursor: pointer; border-radius: 50%; }
.icon-btn:hover { background: var(--line); }
.bag-list { list-style: none; margin: 0; padding: 8px 20px; overflow-y: auto; flex: 1; }
.bag-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.bag-item .t { font-weight: 600; }
.bag-item .d { color: var(--muted); font-size: 13px; }
.bag-item .p { text-align: right; font-weight: 600; }
.qty { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; }
.qty button { width: 30px; height: 30px; border: 0; background: transparent; cursor: pointer; font-size: 16px; }
.qty span { min-width: 18px; text-align: center; font-size: 14px; }
.bag-empty { padding: 32px 20px; color: var(--muted); text-align: center; }
.drawer-foot { padding: 16px 20px 22px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.drawer-foot .fine { margin: 0 !important; }
.total { display: flex; justify-content: space-between; font-size: 18px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  transform: translate(-50%, 140%); transition: transform .25s ease;
  padding: 12px 18px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 420px) {
  .name { font-size: 18px; }
  .info { padding: 10px 11px 12px; }
  .btn { height: 40px; font-size: 13px; padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
