:root {
  --ink: #1a1a1a;
  --ink-soft: #5a5a5a;
  --ink-faint: #8a8a8a;
  --paper: #ffffff;
  --paper-alt: #faf9f7;
  --line: #ececec;
  --accent: #b8763c;        /* warm bronze — elegant, not flashy */
  --accent-soft: #f0e6da;
  --accent-ink: #7a4d24;
  --danger: #c0392b;
  --success: #2e7d4f;
  --shadow: 0 1px 3px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.04);
  --shadow-hover: 0 4px 12px rgba(0,0,0,.08), 0 16px 40px rgba(0,0,0,.08);
  --radius: 14px;
  --radius-sm: 8px;
  --maxw: 1200px;
  --header-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper-alt);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  height: var(--header-h);
  display: flex;
  align-items: center;
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  border-radius: 9px; font-weight: 600; font-size: 18px;
}
.brand-text { font-size: 17px; font-weight: 600; letter-spacing: .5px; }

.search-box {
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
}
.search-box input {
  width: 100%;
  padding: 9px 40px 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-btn {
  position: absolute; right: 6px;
  width: 30px; height: 30px;
  border-radius: 50%; color: var(--ink-faint);
  font-size: 18px; display: grid; place-items: center;
}
.search-btn:hover { color: var(--accent); background: var(--accent-soft); }

.header-nav { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.nav-link {
  padding: 7px 14px; border-radius: 999px;
  font-size: 14px; color: var(--ink-soft);
  transition: background .2s, color .2s;
}
.nav-link:hover { background: var(--paper-alt); color: var(--ink); }
.nav-link--ghost { border: 1px solid var(--line); }

.menu-toggle {
  display: none;
  flex-direction: column; gap: 5px;
  width: 36px; height: 36px; justify-content: center; align-items: center;
}
.menu-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--ink); border-radius: 2px;
  transition: transform .3s, opacity .3s;
}

/* ---------- Main ---------- */
.site-main { flex: 1; max-width: var(--maxw); margin: 0 auto; width: 100%; padding: 28px 20px 48px; }

/* ---------- Flash messages ---------- */
.flash-wrap { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.flash {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px;
  border: 1px solid var(--line); background: var(--paper);
}
.flash--success { border-color: var(--success); color: var(--success); background: #f0f9f3; }
.flash--error { border-color: var(--danger); color: var(--danger); background: #fdf0ee; }

/* ---------- Hero (homepage) ---------- */
.hero {
  text-align: center;
  padding: 48px 20px 40px;
  margin-bottom: 32px;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.hero p { color: var(--ink-soft); font-size: clamp(15px, 2.5vw, 18px); max-width: 560px; margin: 0 auto; }
.hero .search-result-tag {
  display: inline-block; margin-top: 18px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 13px;
}

/* ---------- Category filter ---------- */
.category-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 28px; justify-content: center;
}
.category-chip {
  padding: 8px 18px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line);
  font-size: 14px; color: var(--ink-soft);
  transition: all .2s;
}
.category-chip:hover { border-color: var(--accent); color: var(--ink); }
.category-chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}
.product-card {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.product-card .thumb {
  aspect-ratio: 1 / 1;
  background: var(--paper-alt);
  overflow: hidden;
  position: relative;
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.product-card:hover .thumb img { transform: scale(1.04); }
.product-card .thumb-placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  color: var(--ink-faint); font-size: 40px;
}
.product-card .badge {
  position: absolute; top: 10px; left: 10px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; color: #fff;
  background: var(--accent);
}
.product-card .badge.out { background: var(--ink-faint); }
.product-card .badge.limited { background: #d4881c; }
.product-card .body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card .name {
  font-size: 15px; font-weight: 500; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card .desc {
  font-size: 13px; color: var(--ink-faint);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card .price {
  margin-top: auto; padding-top: 8px;
  font-size: 19px; font-weight: 600; color: var(--accent-ink);
  letter-spacing: -0.3px;
}
.empty-state {
  text-align: center; padding: 80px 20px; color: var(--ink-faint);
}
.empty-state .big { font-size: 48px; margin-bottom: 12px; }

/* ---------- Product detail ---------- */
.detail-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.detail-gallery .main-image {
  width: 100%; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden;
  background: var(--paper-alt); box-shadow: var(--shadow);
}
.detail-gallery .main-image img { width: 100%; height: 100%; object-fit: cover; }
.detail-gallery .main-placeholder {
  width: 100%; height: 100%; display: grid; place-items: center; color: var(--ink-faint); font-size: 64px;
}
.detail-gallery .thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.detail-gallery .thumbs img {
  width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm);
  cursor: pointer; border: 2px solid transparent; transition: border-color .2s;
}
.detail-gallery .thumbs img:hover, .detail-gallery .thumbs img.active { border-color: var(--accent); }
.detail-info h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 600; margin-bottom: 8px; }
.detail-info .cat-tag { color: var(--accent); font-size: 13px; margin-bottom: 14px; display: inline-block; }
.detail-info .price {
  font-size: 30px; font-weight: 600; color: var(--accent-ink); margin-bottom: 20px; letter-spacing: -0.5px;
}
.detail-info .stock { margin-bottom: 22px; font-size: 14px; }
.stock .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.stock.in .dot { background: var(--success); }
.stock.out .dot { background: var(--ink-faint); }
.stock.limited .dot { background: #d4881c; }
.detail-info .description {
  font-size: 15px; color: var(--ink-soft); line-height: 1.8;
  white-space: pre-wrap; padding: 20px 0; border-top: 1px solid var(--line);
}
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 24px; color: var(--ink-soft); font-size: 14px; }
.back-link:hover { color: var(--accent); }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 24px; font-size: 13px; color: var(--ink-faint); }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .bc-sep { color: var(--ink-faint); }
.breadcrumb .bc-current { color: var(--ink); font-weight: 500; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.related { margin-top: 56px; }
.related h2 { font-size: 20px; font-weight: 600; margin-bottom: 20px; }

/* ---------- Admin ---------- */
.admin-toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  justify-content: space-between; margin-bottom: 24px;
}
.admin-toolbar h1 { font-size: 24px; font-weight: 600; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  transition: all .2s; border: 1px solid transparent;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #333; }
.btn-ghost { border-color: var(--line); color: var(--ink-soft); background: var(--paper); }
.btn-ghost:hover { border-color: var(--accent); color: var(--ink); }
.btn-danger { color: var(--danger); border-color: var(--line); background: var(--paper); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
.admin-table th { background: var(--paper-alt); font-weight: 600; color: var(--ink-soft); font-size: 13px; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover { background: var(--paper-alt); }
.admin-table .row-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.admin-table .row-thumb-ph { width: 48px; height: 48px; background: var(--paper-alt); border-radius: 6px; display: grid; place-items: center; color: var(--ink-faint); }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.admin-section { margin-bottom: 40px; }
.admin-section h2 { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.admin-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-cat {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; font-size: 13px;
}
.admin-cat form { display: inline; }

/* ---------- Forms ---------- */
.form-card { max-width: 720px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 30px; }
.form-row { margin-bottom: 20px; }
.form-row label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.form-row input, .form-row textarea, .form-row select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); outline: none; transition: border-color .2s, box-shadow .2s;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-row textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.form-row .hint { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
.form-row .price-input { max-width: 200px; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.form-check input { width: auto; }

.current-image { margin-top: 8px; }
.current-image img { max-width: 180px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.current-image .placeholder { width: 180px; height: 180px; background: var(--paper-alt); border-radius: var(--radius-sm); display: grid; place-items: center; color: var(--ink-faint); }

.gallery-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 14px; }
.gallery-item { position: relative; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1/1; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item .del {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; font-size: 14px;
  display: grid; place-items: center; opacity: 0; transition: opacity .2s;
}
.gallery-item:hover .del { opacity: 1; }

/* ---------- Auth ---------- */
.auth-wrap { max-width: 380px; margin: 60px auto; }
.auth-card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px 32px; }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card .sub { color: var(--ink-faint); font-size: 14px; margin-bottom: 24px; }

/* ---------- Error page ---------- */
.error-page { text-align: center; padding: 100px 20px; }
.error-page .code { font-size: 72px; font-weight: 600; color: var(--accent); letter-spacing: -2px; }
.error-page .msg { color: var(--ink-soft); margin: 12px 0 24px; }
.error-page a { color: var(--accent); border-bottom: 1px solid var(--accent); padding-bottom: 2px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--paper); padding: 28px 20px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; text-align: center; }
.footer-inner p { font-size: 13px; color: var(--ink-faint); }
.footer-sub { margin-top: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .detail-wrap { grid-template-columns: 1fr; gap: 28px; }
  .header-inner { gap: 10px; }
  .search-box { max-width: none; }
  .brand-text { display: none; }
  .header-nav { display: none; }
  .menu-toggle { display: flex; }
  .header-nav.open {
    display: flex; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; background: var(--paper); padding: 12px 20px;
    border-bottom: 1px solid var(--line); gap: 4px; box-shadow: var(--shadow);
  }
  .header-nav.open .nav-link { width: 100%; padding: 12px 14px; }
  /* In the mobile drawer, the language/currency switches and cart should
     lay out cleanly instead of the 5 currency pills crunching into one row. */
  .header-nav.open .lang-switch { width: 100%; }
  .header-nav.open .currency-switch { width: 100%; flex-wrap: wrap; gap: 6px; padding: 4px 0; }
  .header-nav.open .cur-pill { font-size: 13px; padding: 6px 12px; }
  .header-nav.open .nav-cart { width: 100%; }
  .site-main { padding: 20px 16px 36px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .product-card .price { font-size: 17px; }
  .form-card { padding: 20px 18px; }
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
  .admin-table .hide-mobile { display: none; }
}

@media (max-width: 420px) {
  .product-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .product-card .body { padding: 10px 12px 12px; }
  .product-card .name { font-size: 14px; }
  .product-card .desc { display: none; }
  .hero { padding: 32px 16px 24px; }
}

@media (max-width: 360px) {
  .product-grid { grid-template-columns: 1fr; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* =====================================================================
   Cross-border additions — language/currency switcher, inquiry forms,
   contact FAB, admin inquiry cards, featured section, JSON-LD safe.
   ===================================================================== */

/* Language + currency switcher in header */
.lang-switch, .currency-switch { display: inline-flex; align-items: center; gap: 4px; }
.cur-pill {
  padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--line); color: var(--ink-soft); background: var(--paper);
  transition: all .15s;
}
.cur-pill:hover { border-color: var(--accent); color: var(--ink); }
.cur-pill.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.currency-switch { gap: 3px; }

/* Featured section on homepage */
.featured { margin-bottom: 40px; }
.featured > h2 { font-size: 18px; font-weight: 600; margin-bottom: 20px; }
.cat-mini { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }

/* Product detail: inquiry block + currency label */
.price-cur { font-size: 13px; color: var(--ink-faint); font-weight: 400; margin-left: 2px; }
.inquire-block {
  margin: 22px 0; padding: 20px; border: 1px solid var(--accent-soft);
  border-radius: var(--radius); background: #fdfbf7;
}
.inquire-block h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; color: var(--accent-ink); }
.inquiry-form .form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px;
}
.inquiry-form input, .inquiry-form textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--paper); outline: none;
  font-family: inherit; font-size: 14px; transition: border-color .2s, box-shadow .2s;
}
.inquiry-form input:focus, .inquiry-form textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.inquiry-form textarea { min-height: 90px; resize: vertical; }
.inquiry-msg { margin-top: 10px; font-size: 14px; min-height: 18px; }
.inquiry-msg.ok { color: var(--success); }
.inquiry-msg.err { color: var(--danger); }

/* Floating contact widget */
.contact-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  display: flex; flex-direction: column; gap: 10px;
}
.fab-btn {
  width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px;
  box-shadow: 0 4px 14px rgba(0,0,0,.18); transition: transform .2s;
  background: var(--paper);
}
.fab-btn:hover { transform: scale(1.08); }
.fab-btn.wa { background: #25D366; }
.fab-btn.mail { background: var(--accent); color: #fff; }

/* Footer contact links */
.footer-contact { margin: 8px 0; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.footer-contact a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); padding-bottom: 1px; }
.footer-brand { font-weight: 600; font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.footer-links { margin: 10px 0; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: var(--ink-soft); border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.footer-links a:hover { color: var(--accent); border-bottom-color: var(--accent-soft); }

/* Admin: inquiry cards */
.inquiry-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.inquiry-card.unread { border-left: 4px solid var(--accent); }
.inquiry-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.inquiry-meta { color: var(--ink-faint); font-size: 13px; margin-left: 10px; }
.inquiry-time { color: var(--ink-faint); font-size: 12px; white-space: nowrap; }
.inquiry-product { font-size: 13px; color: var(--accent); margin-bottom: 4px; }
.inquiry-product a { border-bottom: 1px solid var(--accent-soft); }
.inquiry-qty { font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.inquiry-message { font-size: 14px; color: var(--ink); line-height: 1.6; white-space: pre-wrap; }
.badge-country {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 600;
  margin-left: 6px;
}

/* Admin: unread count badge */
.badge-count {
  display: inline-block; min-width: 18px; padding: 1px 6px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 600; margin-left: 4px; text-align: center;
}

/* Admin body: hide the floating contact widget on admin pages */
.admin-body .contact-fab { display: none; }

/* Responsive: inquiry form grid */
@media (max-width: 560px) {
  .inquiry-form .form-grid { grid-template-columns: 1fr; }
  .inquiry-head { flex-direction: column; }
  .footer-contact { flex-direction: column; gap: 6px; }
}

/* =====================================================================
   Checkout additions — cart, checkout, order pages, buy button.
   ===================================================================== */

/* Header cart link + badge */
.nav-cart { position: relative; }
.cart-badge {
  display: inline-block; min-width: 16px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600; margin-left: 4px; text-align: center;
  vertical-align: middle; line-height: 16px;
}

/* Product detail: add-to-cart block */
.buy-block { margin: 22px 0; padding: 20px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--paper); }
.buy-form { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.qty-wrap { display: flex; align-items: center; gap: 6px; }
.qty-wrap > label { font-size: 14px; color: var(--ink-soft); margin-right: 2px; }
.qty-btn {
  width: 32px; height: 36px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--paper); font-size: 18px;
  display: grid; place-items: center; color: var(--ink-soft);
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.qty-input {
  width: 54px; height: 36px; text-align: center; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--paper); font-size: 15px;
}
.buy-btn { padding: 12px 28px; font-size: 15px; }
.buy-msg { margin-top: 10px; font-size: 14px; min-height: 18px; }
.buy-msg.ok { color: var(--success); }
.buy-msg.err { color: var(--danger); }

/* Cart page layout */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.cart-row {
  display: grid; grid-template-columns: 72px 1fr auto auto; gap: 14px;
  align-items: center; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px;
}
.cart-thumb { width: 72px; height: 72px; border-radius: var(--radius-sm); overflow: hidden; background: var(--paper-alt); }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-thumb .thumb-placeholder { width:100%;height:100%;display:grid;place-items:center;color:var(--ink-faint);font-size:24px; }
.cart-info { min-width: 0; }
.cart-name { font-size: 15px; font-weight: 500; display: block; margin-bottom: 4px; }
.cart-name:hover { color: var(--accent); }
.cart-price { font-size: 14px; color: var(--ink-soft); }
.cart-qty-form { display: flex; align-items: center; gap: 4px; }
.cart-remove-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink-faint); font-size: 16px;
  display: grid; place-items: center; transition: all .15s;
}
.cart-remove-btn:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* Cart + checkout summary sidebar */
.cart-summary, .checkout-summary {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; position: sticky; top: calc(var(--header-h) + 16px);
}
.cart-summary h3, .checkout-summary h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; color: var(--ink-soft); }
.summary-total { font-size: 17px; font-weight: 600; color: var(--ink); border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }
.summary-note { font-size: 12px; color: var(--ink-faint); margin-top: 10px; }
.link-btn { background: none; border: none; color: var(--ink-faint); font-size: 13px; cursor: pointer; }
.link-btn:hover { color: var(--danger); }

/* Checkout page */
.checkout-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pay-methods { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.pay-opt {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pay-opt:hover { border-color: var(--accent); }
.pay-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pay-opt input { width: auto; }
.pay-opt-name { font-size: 15px; font-weight: 500; }

/* Checkout trust badges (under pay button) */
.checkout-trust { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.trust-row { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.trust-item { font-size: 13px; color: var(--ink-soft); }
.trust-item a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }

/* "Why shop with us" card in checkout summary */
.why-card { margin-top: 18px; padding: 16px; background: var(--paper-alt); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.why-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--ink); }
.why-card ul { margin: 0; padding-left: 18px; }
.why-card li { font-size: 13px; color: var(--ink-soft); line-height: 1.7; }

/* Trust strip on product detail (above buy button) */
.trust-strip { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 14px 0; padding: 12px 14px; background: var(--paper-alt); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.trust-strip span { font-size: 12px; color: var(--ink-soft); font-weight: 500; }

/* Social share row on product detail */
.share-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.share-label { font-size: 13px; color: var(--ink-faint); }
.share-btn { font-size: 18px; text-decoration: none; opacity: .7; transition: opacity .15s; }
.share-btn:hover { opacity: 1; }

/* Image lightbox (click main product image to zoom) */
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.85); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: default; border-radius: 6px; }
.lightbox-close { position: fixed; top: 18px; right: 22px; color: #fff; font-size: 32px; line-height: 1; cursor: pointer; user-select: none; }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); color: #fff; font-size: 48px; line-height: 1; cursor: pointer; user-select: none; padding: 8px 14px; opacity: .7; }
.lb-nav:hover { opacity: 1; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

/* ── Chat module ── */
.chat-wrap { max-width: 680px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; height: 540px; }
.chat-header { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); background: var(--paper-alt); }
.chat-header .chat-product a { color: var(--accent); }
.chat-header .chat-status { margin-left: auto; font-size: 12px; color: var(--ink-faint); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 78%; }
.chat-msg--customer { align-self: flex-end; }
.chat-msg--staff { align-self: flex-start; }
.chat-bubble { padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.chat-msg--customer .chat-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg--staff .chat-bubble { background: var(--paper-alt); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-meta { font-size: 11px; color: var(--ink-faint); margin-top: 4px; }
.chat-form { padding: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.chat-form input { flex: 1; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; outline: none; }
.chat-form input:focus { border-color: var(--accent); }
/* admin chat */
.chat-admin-wrap { max-width: 760px; }

/* Customer chat thread list */
.chat-thread-list { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.chat-thread-item { display: block; padding: 14px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: box-shadow .2s; }
.chat-thread-item:hover { box-shadow: var(--shadow); }
.cti-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cti-product { font-weight: 600; font-size: 15px; color: var(--ink); }
.cti-preview { font-size: 13px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cti-time { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
.chat-admin-head { margin-bottom: 16px; display: flex; flex-direction: column; gap: 4px; }
.chat-admin-head a { color: var(--accent); }
.chat-reply-form { margin-top: 16px; }
.chat-reply-form select { max-width: 160px; }
.usp-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin-top: 22px; }
.usp-strip span { font-size: 14px; color: var(--ink-soft); font-weight: 500; }

/* Scarcity hint on product detail (limited stock) */
.scarcity-hint { margin-bottom: 12px; padding: 8px 12px; background: #fdf3e0; border: 1px solid #d4881c; border-radius: var(--radius-sm); font-size: 13px; color: #a66a00; font-weight: 600; }

/* Admin dashboard stats row */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-align: center; box-shadow: var(--shadow); }
.stat-num { font-size: 28px; font-weight: 700; color: var(--accent-ink); letter-spacing: -0.5px; }
.stat-label { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
@media (max-width: 520px) { .stats-row { grid-template-columns: 1fr 1fr; } .stat-num { font-size: 22px; } }

/* My orders (customer order history) */
.order-history { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.order-history-card { display: block; padding: 16px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: box-shadow .2s; }
.order-history-card:hover { box-shadow: var(--shadow); }
.oh-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.oh-no { font-weight: 600; font-size: 15px; color: var(--ink); }
.oh-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-faint); }
.oh-total { font-weight: 600; color: var(--accent-ink); }

/* Static trust pages (returns / about / faq / shipping) */
.page-content { max-width: 720px; margin: 0 auto; }
.page-content h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 600; margin: 12px 0 24px; }
.page-body { font-size: 16px; color: var(--ink-soft); line-height: 1.8; white-space: pre-wrap; }
.page-cta { margin-top: 36px; padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-align: center; }
.page-cta p { color: var(--ink-soft); margin-bottom: 14px; }
.checkout-summary .co-line { display: flex; justify-content: space-between; font-size: 14px; padding: 5px 0; }
.co-line-name { color: var(--ink-soft); }
.co-totals { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }

/* Order detail page */
.order-meta { display: flex; gap: 24px; flex-wrap: wrap; color: var(--ink-soft); font-size: 14px; margin-bottom: 4px; }
.order-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.order-status--pending { background: #fdf3e0; color: #a66a00; }
.order-status--paid { background: #e3f4ea; color: var(--success); }
.order-status--shipped { background: #e8f0fc; color: #2563a8; }
.order-status--cancelled { background: #fdeceb; color: var(--danger); }
.order-status--refunded { background: #f3e8fd; color: #7b3fb5; }
.order-totals { max-width: 320px; margin-left: auto; }
.order-address { margin-top: 20px; }
.order-address h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.order-address p { color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.link-subtle { color: var(--accent); font-size: 13px; }

/* Responsive: cart + checkout layouts */
@media (max-width: 760px) {
  .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .cart-summary, .checkout-summary { position: static; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: 56px 1fr auto; }
  .cart-row .cart-qty-form { grid-column: 1 / -1; justify-content: flex-end; }
  .cart-row .cart-remove-btn { grid-column: 3; grid-row: 1; }
  .order-admin-layout { grid-template-columns: 1fr !important; }
}
