:root {
  --bg: #faf7f5;
  --card: #ffffff;
  --ink: #2b2430;
  --muted: #8a8091;
  --line: #ece7ea;
  --brand: #c8477f;
  --brand-dark: #a5346a;
  --accent: #6d5bd0;
  --ok: #2f9e6b;
  --warn: #d98a00;
  --danger: #d24a4a;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(60, 30, 50, 0.06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 18px; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.site-header .container {
  display: flex; align-items: center; gap: 18px;
  height: 62px;
}
.brand {
  font-weight: 800; font-size: 1.25rem; color: var(--brand);
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nav a { color: var(--ink); font-weight: 500; font-size: 0.95rem; }
.nav a.active { color: var(--brand); }
.nav-toggle { display: none; background: none; border: none; margin-left: auto; font-size: 1.7rem; line-height: 1; color: var(--ink); cursor: pointer; padding: 2px 6px; }

/* Mobile header: collapse the nav into a tap-to-open menu */
@media (max-width: 680px) {
  .site-header .container { flex-wrap: wrap; height: auto; min-height: 54px; gap: 6px; padding: 8px 0; }
  .brand { font-size: 1.1rem; }
  .nav-toggle { display: block; }
  .nav { margin-left: 0; flex-basis: 100%; display: none; flex-direction: column; align-items: stretch; gap: 2px; padding-bottom: 6px; }
  .nav.open { display: flex; }
  .nav a, .nav .inline-form, .nav .btn { width: 100%; text-align: left; }
  .nav a { padding: 11px 8px; border-radius: 8px; font-size: 1rem; }
  .nav a:hover { background: #f6f0f4; text-decoration: none; }
  .nav .inline-form .btn { text-align: center; }
  .container { padding: 0 14px; }
  h1 { font-size: 1.45rem; }
}

/* Buttons */
.btn {
  display: inline-block; border: none; cursor: pointer;
  background: var(--brand); color: #fff; font-weight: 600;
  padding: 10px 16px; border-radius: 10px; font-size: 0.95rem;
  transition: background 0.15s; text-align: center;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.secondary { background: #f0ebef; color: var(--ink); }
.btn.secondary:hover { background: #e6dfe6; }
.btn.ghost { background: transparent; color: var(--brand-dark); padding: 8px 12px; }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 11px; font-size: 0.85rem; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Standout call-to-action (e.g. "Start selling" in the header) */
.btn.cta {
  background: linear-gradient(135deg, #ff5fa2 0%, #a24bff 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(162, 75, 255, 0.35);
}
.btn.cta:hover {
  background: linear-gradient(135deg, #ff5fa2 0%, #a24bff 100%);
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(162, 75, 255, 0.45);
}

/* Category chips */
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.chip {
  padding: 7px 14px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); color: var(--ink); font-size: 0.9rem;
}
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip:hover { text-decoration: none; border-color: var(--brand); }

/* Product grid */
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.card .thumb {
  aspect-ratio: 4 / 3; background: #f2ecef center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.85rem;
}
.card .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .title { font-weight: 600; }
.card .price { color: var(--brand-dark); font-weight: 700; }
.card .meta { color: var(--muted); font-size: 0.82rem; margin-top: auto; }
.tag {
  display: inline-block; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--accent); background: #efeafc;
  padding: 2px 8px; border-radius: 6px; font-weight: 600;
}

/* Forms */
.form-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  max-width: 520px; margin: 24px auto;
}
.form-card.wide { max-width: 760px; }
label { display: block; font-weight: 600; margin: 14px 0 5px; font-size: 0.92rem; }
input[type=text], input[type=email], input[type=password], input[type=number],
textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 1rem; font-family: inherit; background: #fff;
}
textarea { min-height: 96px; resize: vertical; }
.hint { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.radio-row { display: flex; gap: 12px; margin-top: 6px; }
.radio-row label {
  flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  display: flex; gap: 8px; align-items: center; cursor: pointer; margin: 0; font-weight: 500;
}

/* Alerts */
.flash { padding: 12px 16px; border-radius: 10px; margin: 16px 0; font-weight: 500; }
.flash-toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 2000; margin: 0; max-width: 92%; text-align: center; cursor: pointer;
  box-shadow: 0 8px 26px rgba(60, 30, 50, 0.22);
  animation: flashIn 0.25s ease;
}
@keyframes flashIn { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.flash-toast.hide { opacity: 0; transition: opacity 0.4s ease; }
.flash.success { background: #e5f6ec; color: #1c6e46; }
.flash.error { background: #fdeaea; color: #a52323; }
.form-error { background: #fdeaea; color: #a52323; padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); font-size: 0.92rem; vertical-align: middle; }
th { background: #f7f2f5; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* Status badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge.pending { background: #fff3dc; color: var(--warn); }
.badge.paid { background: #e5f6ec; color: var(--ok); }
.badge.shipped { background: #e7ecfd; color: var(--accent); }
.badge.cancelled { background: #f1eef0; color: var(--muted); }
.badge.active { background: #e5f6ec; color: var(--ok); }
.badge.sold { background: #f1eef0; color: var(--muted); }
.badge.hidden { background: #fdeaea; color: var(--danger); }

/* Layout helpers */
h1 { font-size: 1.7rem; margin: 22px 0 4px; letter-spacing: -0.02em; }
h2 { font-size: 1.2rem; margin: 28px 0 10px; }
.page-sub { color: var(--muted); margin-top: 0; }
.section { margin: 26px 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 18px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat .n { font-size: 1.6rem; font-weight: 800; color: var(--brand-dark); }
.stat .l { color: var(--muted); font-size: 0.85rem; }
.bill-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.stat.slim { padding: 9px 14px; flex: 0 1 auto; }
.stat.slim .n { font-size: 1.15rem; }
.stat.slim .l { font-size: 0.76rem; }
.muted { color: var(--muted); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.inline-form { display: inline; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
.gallery img { border-radius: 10px; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); }

/* Product detail */
.detail { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; margin: 22px 0; }
.detail .main-img { border-radius: var(--radius); border: 1px solid var(--line); aspect-ratio: 4/3; object-fit: cover; width: 100%; background: #f2ecef; }
.detail .thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.detail .thumbs img { width: 68px; height: 68px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.price-big { font-size: 1.9rem; font-weight: 800; color: var(--brand-dark); }
@media (max-width: 720px) {
  .detail { grid-template-columns: 1fr; }
}

/* Share widget */
.share { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.share .btn { padding: 5px 10px; font-size: 0.8rem; }
.share-label { font-weight: 600; color: var(--muted); font-size: 0.88rem; }
.share-box {
  background: linear-gradient(135deg, #f6e9f0, #eee9fb);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin: 18px 0;
}
.share-box h2 { margin: 0 0 4px; }
.share-link {
  display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap;
}
.share-link input {
  flex: 1; min-width: 220px; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 0.9rem; color: var(--ink);
}

/* Chat / messaging */
.chat-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin: 28px 0; }
.chat-thread { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; max-height: 380px; overflow-y: auto; padding: 4px; }
.chat-thread.big { max-height: 460px; }
.msg { max-width: 78%; padding: 8px 12px; border-radius: 14px; }
.msg .who { display: block; font-size: 0.7rem; color: var(--muted); margin-bottom: 2px; font-weight: 600; }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.them { align-self: flex-start; background: #f1eef0; border-bottom-left-radius: 4px; }
.msg.mine { align-self: flex-end; background: #efeafc; border-bottom-right-radius: 4px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; flex-wrap: wrap; }
.chat-form textarea { flex: 1; min-width: 200px; min-height: 44px; }
.chat-form input[type=text] { flex-basis: 100%; }
.chat-form .btn { flex: 0 0 auto; }
.msg-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.msg-row { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.msg-row:hover { text-decoration: none; border-color: var(--brand); }
.msg-row-top { display: flex; align-items: center; gap: 8px; }

/* Lounge (global chat) */
.lounge-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin: 18px 0; }
.lounge-msgs { height: 52vh; min-height: 320px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.lmsg { max-width: 82%; align-self: flex-start; }
.lmsg.mine { align-self: flex-end; text-align: right; }
.lmsg-head { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--muted); }
.lmsg.mine .lmsg-head { flex-direction: row-reverse; }
.lmsg-name { font-weight: 700; color: var(--ink); }
.ltag { text-transform: uppercase; font-size: 0.62rem; letter-spacing: 0.04em; background: #efeafc; color: var(--accent); padding: 1px 6px; border-radius: 6px; font-weight: 700; }
.ltag.star { background: #fff3cf; color: #a9791a; font-size: 0.75rem; text-transform: none; }
.lmsg-del { border: none; background: none; color: var(--danger); cursor: pointer; font-size: 0.75rem; padding: 0 2px; }
.lmsg-body { display: inline-block; background: #f1eef0; padding: 7px 12px; border-radius: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.lmsg.mine .lmsg-body { background: #efeafc; }
.lounge-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #faf7f9; }
.lounge-form input[type=text] { flex: 1; }
.lounge-form .btn { flex: 0 0 auto; }

/* Admin collapsible chat monitor */
.admin-chat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin: 18px 0; overflow: hidden; }
.admin-chat > summary { cursor: pointer; padding: 14px 18px; font-weight: 700; list-style: none; }
.admin-chat > summary::-webkit-details-marker { display: none; }
.admin-chat[open] > summary { border-bottom: 1px solid var(--line); }
.admin-chat-body { padding: 12px 14px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 22px 0; color: var(--muted); font-size: 0.85rem; text-align: center; }

/* Age gate */
.age-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #f6e9f0, #eee9fb); padding: 20px; }
.age-box { background: #fff; border-radius: 18px; padding: 36px; max-width: 440px; text-align: center; box-shadow: 0 10px 40px rgba(80,40,70,0.15); }
.age-box h1 { color: var(--brand); margin-top: 0; }
