:root {
  --bg: #f2e9f8;
  --surface: #ffffff;
  --ink: #3d2b4c;
  --muted: #8c7d97;
  --gold: #c19a3e;
  --gold-soft: #e6cf8f;
  --gold-deep: #a67c25;
  --lav: #cdb6e4;
  --lav-soft: #ece1f5;
  --purple: #5f3d70;
  --rose: #9b6fb0;
  --line: #e7dbf0;
  --shadow: 0 8px 30px rgba(95, 61, 112, 0.12);
  --radius: 16px;
  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Poppins', system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(165deg, #f1e7f9 0%, #f3ecf6 45%, #f7f0df 100%) fixed;
  background-color: var(--bg);
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---- header ---- */
.topbar {
  background: linear-gradient(90deg, var(--purple), #4a2f5a 50%, var(--purple));
  color: #f3e9f7;
  font-size: 0.8rem;
  text-align: center;
  padding: 8px 12px;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--gold);
}
header.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 238, 250, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 5vw; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
  width: 52px; height: 52px; border-radius: 50%;
  object-fit: cover; box-shadow: var(--shadow);
  border: 2px solid var(--gold-soft);
}
.brand h1 {
  font-family: var(--font-head); font-size: 1.35rem; margin: 0; font-weight: 700;
  color: var(--purple);
}
.brand small { color: var(--gold-deep); font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; }

.nav-actions { display: flex; align-items: center; gap: 18px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px; min-width: 220px;
}
.search input { border: none; outline: none; background: transparent; font-family: inherit; width: 100%; }
.cart-btn {
  position: relative; background: var(--ink); color: #fff;
  border: none; border-radius: 999px; padding: 10px 18px; cursor: pointer;
  font-family: inherit; font-size: 0.9rem; display: flex; align-items: center; gap: 8px;
}
.cart-count {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: #fff; border-radius: 999px;
  min-width: 20px; height: 20px; font-size: 0.72rem; display: grid; place-items: center; padding: 0 5px; font-weight: 600;
}

/* ---- hero ---- */
.hero {
  margin: 24px 5vw; padding: 48px; border-radius: var(--radius);
  background: linear-gradient(120deg, var(--lav-soft), #e3d2f2 45%, #f3e6c4);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  box-shadow: var(--shadow); overflow: hidden; position: relative;
  border: 1px solid var(--gold-soft);
}
.hero-text h2 { font-family: var(--font-head); font-size: 2.4rem; margin: 0 0 8px; max-width: 15ch; color: var(--purple); }
.hero-text p { color: #6c5c78; margin: 0 0 20px; max-width: 40ch; }
.hero .badge {
  display: inline-block; background: #fff; color: var(--gold-deep);
  border: 1px solid var(--gold-soft); border-radius: 999px;
  padding: 4px 14px; font-size: 0.75rem; margin-bottom: 14px; letter-spacing: 0.05em;
}
.btn-primary {
  background: linear-gradient(135deg, var(--purple), #7a4f8f); color: #fff; border: none; border-radius: 999px;
  padding: 13px 28px; font-family: inherit; font-size: 0.95rem; cursor: pointer;
  box-shadow: 0 4px 14px rgba(95, 61, 112, 0.25);
}
.btn-primary:hover { filter: brightness(1.08); }
.hero-logo { width: 190px; height: 190px; border-radius: 50%; filter: drop-shadow(0 10px 24px rgba(95,61,112,0.22)); }

/* ---- filters ---- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; padding: 8px 5vw 0; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 8px 18px; cursor: pointer; font-family: inherit; font-size: 0.85rem;
  transition: all 0.15s;
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---- grid ---- */
.section-title { padding: 28px 5vw 8px; font-family: var(--font-head); font-size: 1.6rem; }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px; padding: 12px 5vw 60px;
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform 0.18s, box-shadow 0.18s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .thumb {
  aspect-ratio: 1; background: linear-gradient(135deg, var(--lav-soft), #e3d2f2);
  display: grid; place-items: center; font-size: 3.4rem; position: relative;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .tag {
  position: absolute; top: 10px; left: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: #fff;
  font-size: 0.68rem; padding: 3px 10px; border-radius: 999px; letter-spacing: 0.05em;
  font-weight: 600;
}
.card .body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .cat { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.card .name { font-weight: 600; font-size: 0.98rem; }
.card .price-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.card .price { font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.card .compare { color: var(--muted); text-decoration: line-through; font-size: 0.82rem; }
.card .add {
  margin-top: 10px; border: 1px solid var(--ink); background: transparent; color: var(--ink);
  border-radius: 999px; padding: 9px; cursor: pointer; font-family: inherit; font-weight: 500;
  transition: all 0.15s;
}
.card .add:hover { background: var(--ink); color: #fff; }
.card .add:disabled { opacity: 0.4; cursor: not-allowed; }
.oos { color: var(--rose); font-size: 0.75rem; }

/* ---- cart drawer ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(30, 20, 15, 0.4); opacity: 0; pointer-events: none;
  transition: opacity 0.2s; z-index: 90;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 92vw);
  background: var(--bg); z-index: 100; transform: translateX(100%); transition: transform 0.25s;
  display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,0.1);
}
.drawer.open { transform: translateX(0); }
.drawer header { padding: 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.drawer header h3 { font-family: var(--font-head); margin: 0; }
.close-x { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--muted); }
.cart-items { flex: 1; overflow-y: auto; padding: 12px 20px; }
.cart-line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line .ci-thumb { width: 56px; height: 56px; border-radius: 10px; background: var(--lav-soft); display: grid; place-items: center; font-size: 1.6rem; overflow: hidden; flex: none; }
.cart-line .ci-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-line .ci-info { flex: 1; }
.cart-line .ci-name { font-weight: 600; font-size: 0.9rem; }
.qty { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 1rem; line-height: 1; }
.remove { background: none; border: none; color: var(--rose); cursor: pointer; font-size: 0.78rem; }
.cart-foot { padding: 20px; border-top: 1px solid var(--line); background: var(--surface); }
.cart-foot .row { display: flex; justify-content: space-between; margin-bottom: 12px; }
.cart-foot .total { font-size: 1.2rem; font-weight: 700; font-family: var(--font-head); }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

/* ---- checkout form ---- */
.form-field { margin-bottom: 12px; }
.form-field label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; }
.form-field input, .form-field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 0.9rem; background: #fff;
}
.hidden { display: none !important; }
.pay-note { font-size: 0.75rem; color: var(--muted); margin-top: 8px; text-align: center; }

footer.foot { background: var(--ink); color: #d8ccc2; padding: 40px 5vw; margin-top: 40px; }
footer.foot .cols { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
footer.foot h4 { font-family: var(--font-head); color: #fff; }
footer.foot a { display: block; color: #b8aca2; font-size: 0.88rem; padding: 3px 0; }
.copyright { border-top: 1px solid #4a3f38; margin-top: 24px; padding-top: 16px; font-size: 0.8rem; color: #9a8d83; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 200; font-size: 0.9rem;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .search { display: none; }
  .hero { padding: 28px; flex-direction: column; text-align: center; }
  .hero-emoji { font-size: 5rem; }
  .brand h1 { font-size: 1.1rem; }
}

/* ---- buyer's previous orders ("account") in checkout ---- */
.my-orders { margin: 4px 0 8px; }
.my-orders .mo-hint { color: var(--muted); font-size: 0.82rem; margin: 6px 0; }
.my-orders .mo-title {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gold-deep); font-weight: 600; margin: 8px 0 6px;
}
.my-orders .mo-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 8px; text-decoration: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color 0.15s, transform 0.15s;
}
.my-orders .mo-row:hover { border-color: var(--gold-soft); transform: translateY(-1px); }
.my-orders .mo-ref { font-weight: 600; color: var(--purple); font-size: 0.9rem; }
.my-orders .mo-meta { color: var(--muted); font-size: 0.76rem; margin-top: 2px; }
.my-orders .mo-right { text-align: right; }
.my-orders .mo-total { font-weight: 700; color: var(--purple); font-size: 0.9rem; }
.my-orders .mo-status {
  display: inline-block; margin-top: 3px; font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--gold-deep);
  background: var(--gold-soft); border-radius: 999px; padding: 2px 8px;
}
