/* ---- tokens ---- */
:root {
  --ink: #16211d;
  --paper: #fffdf9;
  --moss: #1f6f5c;
  --moss-dark: #164f42;
  --sand: #e9e1cf;
  --line: #d9d2c0;
  --brick: #a8412f;
  --muted: #6b7269;
  --gold: #a6791a;
  --navy: #1b2f5e;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
}

button, input, select, textarea {
  font-family: var(--font-body);
  font-size: 1rem;
}

/* ---- layout shell ---- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

header.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 10px;
}
.trust-strip {
  background: var(--sand);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.trust-strip .wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  padding: 10px 24px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}
.trust-strip .item { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.trust-strip .item .ic { color: var(--moss); font-size: 0.95rem; }
@media (max-width: 700px) {
  .trust-strip .wrap { gap: 16px; justify-content: flex-start; overflow-x: auto; }
}
.brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}
.brand-mark { height: 50px; width: auto; display: block; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: row; align-items: baseline; gap: 12px; }
.brand-main {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.5rem;
  letter-spacing: -0.01em;
  color: var(--navy);
  background: linear-gradient(100deg, var(--navy) 30%, #3a5a9c 50%, var(--navy) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-sub {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.5rem;
  letter-spacing: -0.01em;
  color: var(--gold);
}
@media (max-width: 520px) {
  .brand-mark { height: 38px; }
  .brand-main, .brand-sub { font-size: 1.25rem; }
  .brand-text { gap: 6px; }
  .site-header .bar { padding: 14px 16px; }
  .cart-link { padding: 7px 13px; font-size: 0.8rem; }
}

/* ---- animated announcement bar ---- */
.announce-bar {
  background: var(--ink);
  color: var(--gold);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 9px 16px;
  overflow: hidden;
}
.announce-text { display: inline-block; transition: opacity 0.4s ease, transform 0.4s ease; }
.announce-text.swap { opacity: 0; transform: translateY(4px); }
.admin-side .brand-mark { height: 30px; width: auto; }

.nav-actions { display: flex; align-items: center; gap: 18px; }
.cart-link {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  border: 1px solid var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
}
.cart-link:hover { background: var(--ink); color: var(--paper); }

footer.site-footer {
  background: var(--ink);
  color: #cfd8d2;
  margin-top: 80px;
  padding: 0;
}
.footer-main {
  max-width: 1080px; margin: 0 auto; padding: 52px 24px 36px;
  display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px;
}
@media (max-width: 700px) { .footer-main { grid-template-columns: 1fr; gap: 32px; } }
.footer-col h4 {
  color: var(--paper); font-family: var(--font-body); font-size: 0.78rem;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 16px;
}
.footer-brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand-row img { height: 34px; width: auto; }
.footer-brand-row span { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--paper); }
.footer-col p { font-size: 0.86rem; line-height: 1.6; color: #a9b3ac; margin: 0; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a { color: #cfd8d2; text-decoration: none; font-size: 0.88rem; }
.footer-col ul a:hover { color: var(--paper); text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 24px;
  text-align: center;
  font-size: 0.78rem;
  color: #8a938c;
}

/* ---- hero ---- */
.hero {
  padding: 64px 24px 40px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 85% 20%, rgba(31,111,92,0.08), transparent 55%),
    var(--paper);
}
.hero .wrap { max-width: 760px; }
.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--moss);
  font-weight: 700;
  margin-bottom: 12px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.05;
}
.hero p { color: var(--muted); max-width: 46ch; font-size: 1.05rem; }

/* ---- product grid ---- */
.grid-section { padding: 48px 24px 24px; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 28px;
}
.card {
  text-decoration: none;
  color: var(--ink);
  display: block;
  border-radius: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-3px); }
.card .thumb {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--sand);
  margin-bottom: 12px;
  position: relative;
  box-shadow: 0 1px 3px rgba(22,33,29,0.08);
}
.card:hover .thumb { box-shadow: 0 10px 24px rgba(22,33,29,0.14); }
.badge-lowstock {
  position: absolute; top: 10px; right: 10px;
  background: var(--brick); color: var(--paper);
  font-size: 0.68rem; font-weight: 700; letter-spacing: .02em;
  padding: 4px 9px; border-radius: 999px;
}

.category-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.category-pill {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  padding: 8px 18px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s ease;
}
.category-pill:hover { border-color: var(--moss); }
.category-pill.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.card:hover .thumb img { transform: scale(1.04); }
.card .title { font-weight: 600; font-size: 1rem; margin-bottom: 2px; }
.card-rating { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 0.8rem; color: var(--muted); }
.card .price { color: var(--moss-dark); font-weight: 700; }
.badge-soldout {
  position: absolute; top: 10px; left: 10px;
  background: var(--ink); color: var(--paper);
  font-size: 0.7rem; font-weight: 700; letter-spacing: .04em;
  padding: 4px 8px; border-radius: 999px; text-transform: uppercase;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  background: var(--ink); color: var(--paper);
  border: none; padding: 13px 22px; border-radius: 999px;
  font-weight: 600; cursor: pointer; text-decoration: none;
  font-size: 0.95rem;
  transition: opacity .15s ease, transform .1s ease;
}
.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.98); }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn.danger { background: var(--brick); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.small { padding: 8px 14px; font-size: 0.85rem; }
.btn.block { width: 100%; }

/* ---- product detail ---- */
.product-detail { padding: 48px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.product-detail .thumb { border-radius: 14px; overflow: hidden; background: var(--sand); aspect-ratio: 1/1;}
.product-detail .thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-strip { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thumb-btn {
  width: 64px; height: 64px; border-radius: 8px; overflow: hidden;
  border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--sand);
  opacity: 0.75; transition: all 0.15s ease;
}
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-btn:hover { opacity: 1; }
.thumb-btn.active { border-color: var(--moss); opacity: 1; }
.variant-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.variant-swatch {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  padding: 8px 16px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s ease;
}
.variant-swatch:hover { border-color: var(--moss); }
.variant-swatch.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.product-detail .price { font-size: 1.4rem; color: var(--moss-dark); font-weight: 700; margin-bottom: 20px; }
.product-detail .desc { color: var(--muted); margin-bottom: 28px; }
.product-info-block { margin-bottom: 22px; }
.product-info-block h3 { font-size: 1rem; margin-bottom: 8px; }
.product-info-block ol { margin: 0; padding-left: 20px; color: var(--ink); font-size: 0.92rem; line-height: 1.7; }
.product-info-block li { margin-bottom: 2px; }
.qty-row { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.qty-box { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty-box button { border: none; background: none; width: 36px; height: 36px; font-size: 1.1rem; cursor: pointer; }
.qty-box input { width: 40px; text-align: center; border: none; -moz-appearance: textfield; }
.stock-note { color: var(--muted); font-size: 0.85rem; }

@media (max-width: 720px) {
  .product-detail { grid-template-columns: 1fr; gap: 24px; padding: 28px 20px; }
}

/* ---- cart & checkout ---- */
.page-title-row { padding: 40px 24px 8px; }
.cart-page, .checkout-page { padding: 16px 24px 64px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 800px) { .cart-page, .checkout-page { grid-template-columns: 1fr; } }

.cart-item {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 16px;
  align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line);
}
.cart-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--sand); }
.cart-item .name { font-weight: 600; }
.cart-item .line-total { font-weight: 700; }
.cart-item .remove { color: var(--brick); background: none; border: none; cursor: pointer; font-size: 0.82rem; padding: 0; margin-top: 4px; }

.summary-box {
  border: 1px solid var(--line); border-radius: 14px; padding: 22px;
  background: #fffefb;
  position: sticky; top: 90px;
}
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; color: var(--muted); }
.summary-row.total { color: var(--ink); font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; }

.empty-state { padding: 80px 24px; text-align: center; color: var(--muted); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 12px; background: var(--paper); color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--moss); outline-offset: 1px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.notice {
  border: 1px solid var(--line); background: var(--sand);
  border-radius: 10px; padding: 12px 14px; font-size: 0.85rem; color: var(--ink);
  margin-bottom: 20px;
}
.error-notice {
  border: 1px solid #e3b3a8; background: #fbeae6; color: var(--brick);
  border-radius: 10px; padding: 12px 14px; font-size: 0.88rem; margin-bottom: 16px;
}

.confirm-box { max-width: 560px; margin: 60px auto; padding: 0 24px; text-align: center; }
.confirm-box .icon { font-size: 2.4rem; margin-bottom: 12px; }
.order-id-chip {
  display: inline-block; background: var(--sand); border-radius: 999px;
  padding: 6px 14px; font-family: monospace; font-size: 0.85rem; margin: 10px 0 24px;
}

/* ---- admin ---- */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-side {
  background: var(--ink); color: var(--paper); padding: 24px 18px;
}
.admin-side .brand { color: var(--paper); margin-bottom: 32px; }
.admin-side nav a {
  display: block; text-decoration: none; color: #cfd8d2;
  padding: 10px 12px; border-radius: 8px; font-size: 0.92rem; margin-bottom: 4px;
}
.admin-side nav a:hover, .admin-side nav a.active { background: rgba(255,255,255,0.1); color: var(--paper); }
.admin-main { padding: 32px 40px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:hover td { background: #faf8f2; }
.admin-table img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; background: var(--sand); }

.status-pill { padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; text-transform: capitalize; }
.status-pending { background: #f3e8c9; color: #8a6d1c; }
.status-paid { background: #d6ecd9; color: #1f6f2e; }
.status-fulfilled { background: #d9e6f5; color: #2455a3; }
.status-cancelled { background: #f3d9d3; color: var(--brick); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(22,33,29,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: var(--paper); border-radius: 14px; padding: 28px;
  width: 480px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-header button { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--muted); }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--sand); }
.login-card { background: var(--paper); padding: 40px; border-radius: 16px; width: 360px; max-width: 90vw; box-shadow: 0 10px 40px rgba(22,33,29,0.08); }

.empty-cell { color: var(--muted); text-align: center; padding: 40px !important; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-input { border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; background: var(--paper); color: var(--ink); font-size: 0.88rem; }
#search-input { flex: 1; min-width: 180px; }

.bulk-bar { display: flex; align-items: center; gap: 10px; background: var(--sand); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 0.88rem; font-weight: 600; }

.img-thumb-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.img-thumb-item { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; background: var(--sand); border: 2px solid transparent; }
.img-thumb-item.is-main { border-color: var(--moss); }
.img-thumb-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.main-badge { position: absolute; bottom: 0; left: 0; right: 0; background: var(--moss); color: var(--paper); font-size: 0.62rem; font-weight: 700; text-align: center; padding: 2px 0; }
.img-thumb-remove { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(22,33,29,0.75); color: var(--paper); border: none; cursor: pointer; font-size: 0.9rem; line-height: 1; }
.img-thumb-add { width: 84px; height: 84px; border: 2px dashed var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; color: var(--muted); cursor: pointer; text-align: center; font-weight: 600; }
.img-thumb-add:hover { border-color: var(--moss); color: var(--moss-dark); }

/* ---- reviews ---- */
.reviews-section { padding: 40px 24px 70px; border-top: 1px solid var(--line); margin-top: 20px; }
.reviews-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 28px; }
.rating-summary { display: flex; align-items: center; gap: 14px; }
.rating-summary .big-num { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; line-height: 1; }
.rating-summary .meta { color: var(--muted); font-size: 0.85rem; }
.review-card { border-bottom: 1px solid var(--line); padding: 18px 0; }
.review-card .review-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.review-card .reviewer { font-weight: 600; font-size: 0.92rem; }
.review-card .review-date { color: var(--muted); font-size: 0.78rem; }
.review-card .review-comment { color: var(--ink); font-size: 0.92rem; line-height: 1.5; }
.star-picker { display: flex; gap: 4px; font-size: 1.6rem; cursor: pointer; margin-bottom: 4px; }
.star-picker span { color: var(--line); transition: color 0.1s ease; }
.star-picker span.active { color: #c99a1f; }
.review-form-box { border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-bottom: 32px; background: #fffefb; max-width: 520px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: var(--paper); }
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.stat-card .ic { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--sand); color: var(--moss-dark); flex-shrink: 0; }
.stat-card .num { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.stat-card .label { color: var(--muted); font-size: 0.82rem; }
.stat-card .trend { font-size: 0.76rem; font-weight: 600; margin-top: 4px; }
.stat-card .trend.up { color: var(--moss-dark); }
.stat-card .trend.down { color: var(--brick); }

.chart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 32px; }
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-card { border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: var(--paper); }
.chart-card h3 { font-size: 0.95rem; margin-bottom: 4px; }
.chart-card .chart-sub { color: var(--muted); font-size: 0.78rem; margin-bottom: 14px; }
.chart-card canvas { max-height: 260px; }
.dash-section-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-bottom: 32px; }
@media (max-width: 900px) { .dash-section-row { grid-template-columns: 1fr; } }
.panel { border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: var(--paper); }
.panel h3 { font-size: 0.95rem; margin-bottom: 14px; }
.mini-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.mini-row:last-child { border-bottom: none; }
.mini-row .name { font-weight: 600; }
.mini-row .sub { color: var(--muted); font-size: 0.78rem; }
.stock-flag { color: var(--brick); font-weight: 700; font-size: 0.78rem; }

/* ---- skeleton loading ---- */
.skeleton { background: linear-gradient(90deg, var(--sand) 25%, #f1ead9 37%, var(--sand) 63%); background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite; border-radius: 6px; }
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---- empty states ---- */
.empty-state-block { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-state-block .ic { font-size: 2rem; margin-bottom: 10px; opacity: 0.6; }
.empty-state-block .title { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.empty-state-block .sub { font-size: 0.85rem; }

/* ---- toast notifications ---- */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 10px; font-size: 0.88rem; box-shadow: 0 8px 24px rgba(22,33,29,0.25); animation: toast-in 0.2s ease; max-width: 320px; }
.toast.error { background: var(--brick); }
.toast.success { background: var(--moss-dark); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
