@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Work+Sans:wght@300;400;500;600&display=swap');

:root {
  --bone: #EFE9DD;
  --bone-deep: #E5DCC9;
  --paper: #F7F3EA;
  --ink: #221F1B;
  --ink-soft: #5B564C;
  --ink-faint: #8A8375;
  --moss: #48583B;
  --moss-deep: #333F2B;
  --moss-pale: #DCE2D2;
  --clay: #A5663F;
  --clay-pale: #EAD9C9;
  --blush: #C68B82;
  --blush-pale: #EFDAD6;
  --sand: #D8CBB2;
  --line: #CBBFA6;
  --gold: #8C6E36;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 12px 32px rgba(34,31,27,0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: 'Work Sans', sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.display { font-family: 'Fraunces', serif; font-feature-settings: "ss03" 1; }

/* ---------- layout helpers ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section-tight { padding: 40px 0; }
.grid { display: grid; gap: 20px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.center { text-align: center; }
.hidden { display: none !important; }
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

/* ---------- typography ---------- */
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
p { margin: 0; line-height: 1.6; }
.h1 { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.05; letter-spacing: -0.01em; }
.h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.15; }
.h3 { font-size: 1.35rem; line-height: 1.25; }
.eyebrow { font-size: 0.8rem; color: var(--ink-soft); }
.lede { font-size: 1.05rem; color: var(--ink-soft); line-height: 1.65; max-width: 46ch; }

/* ---------- buttons (real :hover — text color always changes correctly) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: 999px; font-size: 0.875rem; font-weight: 500;
  border: 1px solid transparent; transition: background-color .18s ease, color .18s ease, border-color .18s ease, opacity .18s ease, transform .18s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: var(--moss-deep); border-color: var(--moss-deep); color: var(--paper); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-danger-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.btn-danger-ghost:hover { background: #7A3B32; color: #fff; border-color: #7A3B32; }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 0.78rem; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 999px; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; position: relative;
  background: transparent; color: var(--ink); transition: background-color .18s ease;
}
.icon-btn:hover { background: rgba(34,31,27,0.06); }
.icon-btn svg { width: 19px; height: 19px; }
.count-badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 999px; background: var(--moss); color: #fff; font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.count-badge.blush { background: var(--blush); }
.count-badge.zero { display: none; }

.text-link { text-decoration: underline; text-underline-offset: 4px; color: var(--ink); transition: color .15s ease; }
.text-link:hover { color: var(--moss); }
.text-link-faint { text-decoration: underline; text-underline-offset: 3px; color: var(--ink-faint); font-size: 0.85rem; }
.text-link-faint:hover { color: var(--ink); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; backdrop-filter: blur(10px);
  background: rgba(239,233,221,0.9); border-bottom: 1px solid var(--line);
}
.site-header .wrap { height: 76px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 1.3rem; }
.brand svg { width: 22px; height: 22px; }
.main-nav { display: flex; align-items: center; gap: 32px; }
.main-nav a { font-size: 0.92rem; color: var(--ink-soft); transition: color .15s ease; padding: 4px 0; border-bottom: 1px solid transparent; }
.main-nav a:hover { color: var(--ink); }
.main-nav a.active { color: var(--ink); font-weight: 500; border-color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 4px; }
.admin-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; padding: 8px 14px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); margin-left: 8px;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.admin-pill:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.admin-pill svg { width: 14px; height: 14px; }
.mobile-nav-toggle { display: none; }

@media (max-width: 860px) {
  .main-nav { display: none; }
  .main-nav.open-mobile {
    display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
    position: absolute; top: 76px; left: 0; right: 0; background: var(--paper);
    padding: 20px 24px 26px; border-bottom: 1px solid var(--line); z-index: 99;
  }
  .mobile-nav-toggle { display: inline-flex; }
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; }
.site-footer .wrap { padding: 48px 24px; display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; }
.footer-col h4 { font-size: 0.85rem; margin-bottom: 12px; color: var(--ink); }
.footer-col a, .footer-col p { display: block; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 8px; transition: color .15s ease; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom { border-top: 1px solid var(--line); padding: 20px 24px; font-size: 0.78rem; color: var(--ink-faint); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.hero-media { position: relative; border-radius: 28px; overflow: hidden; aspect-ratio: 4/5; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after { content:""; position:absolute; inset:0; background: linear-gradient(180deg, rgba(34,31,27,0) 55%, rgba(34,31,27,0.35) 100%); }
.hero-badge { position: absolute; left: 20px; bottom: 20px; z-index: 2; background: rgba(247,243,234,0.92); backdrop-filter: blur(6px); padding: 12px 16px; border-radius: 14px; font-size: 0.8rem; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; aspect-ratio: 16/10; }
}

/* ---------- category tiles ---------- */
.cat-grid { grid-template-columns: repeat(6, 1fr); }
.cat-tile { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 1; }
.cat-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.cat-tile:hover img { transform: scale(1.06); }
.cat-tile::after { content:""; position:absolute; inset:0; background: linear-gradient(180deg, rgba(34,31,27,0) 45%, rgba(34,31,27,0.55) 100%); }
.cat-tile span { position: absolute; left: 12px; bottom: 10px; z-index: 2; color: #fff; font-size: 0.82rem; font-family: 'Fraunces', serif; }
@media (max-width: 860px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- product cards ---------- */
.product-grid { grid-template-columns: repeat(3, 1fr); }
.product-card { position: relative; }
.product-media { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 1; background: var(--sand); }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.product-card:hover .product-media img { transform: scale(1.05); }
.product-tags { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.tag { font-size: 10.5px; padding: 4px 9px; border-radius: 999px; font-weight: 600; letter-spacing: 0.02em; }
.tag-new { background: var(--blush-pale); color: #7A3B32; }
.tag-best { background: var(--moss-pale); color: var(--moss-deep); }
.tag-low { background: var(--clay-pale); color: #7A4A24; }
.wish-btn {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px; border-radius: 999px;
  background: rgba(247,243,234,0.9); border: none; display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.wish-btn:hover { transform: scale(1.08); }
.wish-btn svg { width: 16px; height: 16px; stroke: var(--ink); fill: none; transition: fill .15s ease, stroke .15s ease; }
.wish-btn.active svg { fill: var(--blush); stroke: var(--blush); }
.product-info { margin-top: 12px; display: flex; justify-content: space-between; gap: 10px; }
.product-info h3 { font-size: 1.05rem; margin-top: 2px; }
.product-cat { font-size: 0.72rem; color: var(--ink-faint); }
.product-price { font-size: 0.92rem; font-weight: 500; white-space: nowrap; }
.product-card .btn { margin-top: 12px; width: 100%; padding: 11px; font-size: 0.8rem; }
@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }

/* ---------- filters ---------- */
.shop-layout { display: grid; grid-template-columns: 230px 1fr; gap: 48px; align-items: start; }
.filters { position: sticky; top: 100px; }
.filter-block { margin-bottom: 28px; }
.filter-block h4 { font-size: 0.85rem; margin-bottom: 12px; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 8px; cursor: pointer; }
.check-row input { accent-color: var(--moss); width: 15px; height: 15px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 0.76rem; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-soft); transition: all .15s ease;
}
.chip:hover { border-color: var(--moss); color: var(--moss-deep); }
.chip.active { background: var(--moss-pale); border-color: var(--moss); color: var(--moss-deep); }
.search-input, .text-input, select.text-input {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: transparent;
  color: var(--ink); font-size: 0.88rem; transition: border-color .15s ease;
}
.search-input:focus, .text-input:focus { outline: none; border-color: var(--moss); }
input[type="range"] { width: 100%; accent-color: var(--moss); }
@media (max-width: 900px) {
  .shop-layout { grid-template-columns: 1fr; }
  .filters { position: static; display: none; }
  .filters.open { display: block; }
}

/* ---------- badges / pills ---------- */
.pill { font-size: 0.72rem; padding: 5px 11px; border-radius: 999px; font-weight: 500; }
.pill-moss { background: var(--moss-pale); color: var(--moss-deep); }
.pill-clay { background: var(--clay-pale); color: #7A4A24; }
.pill-sand { background: var(--sand); color: var(--ink); }

/* ---------- cards / panels ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel-tight { padding: 18px; }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 6px; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }

/* ---------- tables (admin) ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead tr { background: var(--bone-deep); }
th { text-align: left; font-weight: 500; padding: 12px 16px; color: var(--ink-soft); font-size: 0.78rem; }
td { padding: 12px 16px; border-top: 1px solid var(--line); color: var(--ink); }
.table-wrap { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; overflow-x: auto; }
.table-input { width: 70px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: transparent; font-size: 0.85rem; }
.row-actions { display: flex; gap: 12px; justify-content: flex-end; align-items: center; }
.row-actions button { background: none; border: none; color: var(--ink-faint); padding: 4px; transition: color .15s ease; }
.row-actions button:hover { color: var(--ink); }
.row-actions button.danger:hover { color: #7A3B32; }

/* ---------- KPI cards ---------- */
.kpi-grid { grid-template-columns: repeat(4, 1fr); }
.kpi-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; }
.kpi-top svg { width: 15px; height: 15px; color: var(--ink-faint); }
.kpi-value { font-size: 1.6rem; margin-top: 8px; }
.kpi-sub { font-size: 0.75rem; color: var(--moss); margin-top: 4px; }
@media (max-width: 860px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- admin nav ---------- */
.admin-shell { display: flex; min-height: 70vh; }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.admin-tab {
  display: flex; align-items: center; gap: 7px; padding: 12px 18px; font-size: 0.88rem; color: var(--ink-faint);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s ease, border-color .15s ease;
}
.admin-tab svg { width: 15px; height: 15px; }
.admin-tab:hover { color: var(--ink); }
.admin-tab.active { color: var(--ink); border-color: var(--ink); font-weight: 500; }

/* ---------- charts ---------- */
.chart-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.chart-card h4 { font-size: 0.88rem; margin-bottom: 14px; }
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 260px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 12px; font-size: 0.75rem; color: var(--ink-soft); }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-right: 6px; }

/* ---------- cart / checkout ---------- */
.cart-line { display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: none; }
.cart-line img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; }
.qty-stepper { display: inline-flex; align-items: center; gap: 10px; }
.qty-btn { width: 26px; height: 26px; border-radius: 999px; border: 1px solid var(--line); background: none; display: flex; align-items: center; justify-content: center; transition: background-color .15s ease; }
.qty-btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.qty-btn svg { width: 11px; height: 11px; }

.steps { display: flex; align-items: center; gap: 8px; max-width: 480px; margin-bottom: 40px; }
.step-dot { width: 28px; height: 28px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; border: 1px solid var(--line); color: var(--ink-faint); flex-shrink: 0; }
.step-dot.active, .step-dot.done { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.step-line { flex: 1; height: 1px; background: var(--line); }
.step-label { font-size: 0.78rem; color: var(--ink-faint); display: none; }
.step-label.active { color: var(--ink); }
@media (min-width: 640px) { .step-label { display: inline; } }

/* ---------- misc ---------- */
.divider { height: 1px; background: var(--line); margin: 24px 0; }
.empty-state { text-align: center; padding: 90px 20px; }
.empty-state svg { width: 30px; height: 30px; color: var(--ink-faint); margin-bottom: 14px; }
.fade-in { animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 300;
  background: var(--ink); color: var(--paper); padding: 14px 22px; border-radius: 999px; font-size: 0.85rem;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 14px; height: 14px; }

::selection { background: var(--moss-pale); color: var(--moss-deep); }
:focus-visible { outline: 2px solid var(--moss); outline-offset: 2px; }
