:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #1d1916;
  --muted: #7a7068;
  --line: #e8e1d7;
  --accent: #6b2d4a;
  --accent-ink: #ffffff;
  --gold: #b08d57;
  --ok: #2f6b45;
  --warn: #a14a2c;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding-top: 28px; padding-bottom: 60px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
[hidden] { display: none !important; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; gap: 20px; height: 68px; }
.logo { font-family: var(--serif); font-size: 28px; letter-spacing: .04em; text-decoration: none; color: var(--accent); }
.search { flex: 1; max-width: 520px; margin-left: auto; }
.search input { width: 100%; padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); outline: none; }
.search input:focus { border-color: var(--accent); }
.cart-link { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; }
.cart-count { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 12px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 6px; }

/* layout */
.catalog { display: grid; grid-template-columns: 240px 1fr; gap: 32px; }
.sidebar h3 { font-family: var(--serif); font-weight: normal; font-size: 20px; margin: 0 0 12px; }
.groups, .groups ul { list-style: none; margin: 0; padding: 0; }
.groups ul { padding-left: 14px; }
.groups a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); }
.groups a:hover { background: var(--surface); color: var(--ink); }
.groups a.active { background: var(--accent); color: var(--accent-ink); }
.groups .n { font-size: 12px; opacity: .7; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 20px; }
.toolbar h1 { font-family: var(--serif); font-weight: normal; font-size: 30px; margin: 0; margin-right: auto; }
.toolbar label { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.toolbar select { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: 0 10px 30px rgba(60, 30, 20, .08); transform: translateY(-2px); }
.card a.thumb { text-decoration: none; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .name { font-family: var(--serif); font-size: 17px; line-height: 1.3; text-decoration: none; }
.card .bottom { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; }

.img { aspect-ratio: 1 / 1; background: linear-gradient(145deg, #f3ece3, #e9dfd2); display: grid; place-items: center; overflow: hidden; }
.img img { width: 100%; height: 100%; object-fit: cover; }
.img .mono { font-family: var(--serif); font-size: 64px; color: var(--gold); opacity: .55; }
.out .img { filter: grayscale(.6); opacity: .7; }

.price { font-weight: 600; font-size: 18px; }
.stock { font-size: 13px; }
.stock.ok { color: var(--ok); }
.stock.no { color: var(--warn); }
.muted { color: var(--muted); }

.btn { white-space: nowrap; border: 0; background: var(--accent); color: var(--accent-ink); padding: 10px 18px; border-radius: 999px; cursor: pointer; font-weight: 500; text-decoration: none; display: inline-block; text-align: center; }
.btn:hover { filter: brightness(1.1); }
.btn:disabled { background: #cfc6bc; cursor: not-allowed; filter: none; }
.btn.small { padding: 7px 14px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.more { display: flex; justify-content: center; margin-top: 28px; }

/* product page */
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.product .img { border-radius: var(--radius); border: 1px solid var(--line); }
.product h1 { font-family: var(--serif); font-weight: normal; font-size: 36px; line-height: 1.15; margin: 6px 0 8px; }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.product .price { font-size: 28px; margin: 18px 0 6px; }
.product .desc { white-space: pre-line; margin: 20px 0; }
.buy { display: flex; gap: 12px; align-items: center; margin-top: 18px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.qty button { width: 38px; height: 38px; border: 0; background: none; cursor: pointer; font-size: 18px; }
.qty input { width: 44px; text-align: center; border: 0; background: none; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* perfume на розпив: volume picker */
.volumes { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.vol { display: inline-flex; flex-direction: column; align-items: center; min-width: 76px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.vol small { font-weight: normal; font-size: 13px; color: var(--muted); }
.vol[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.vol:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.price .per { font-weight: normal; font-size: 13px; color: var(--muted); }

/* cart & checkout */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.page-title { font-family: var(--serif); font-weight: normal; font-size: 32px; margin: 0 0 20px; }
.cart-line { display: grid; grid-template-columns: 72px 1fr auto auto 32px; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line .img { width: 72px; border-radius: 10px; }
.cart-line .img .mono { font-size: 28px; }
.cart-line .remove { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.cart-line .warn { color: var(--warn); font-size: 13px; }
.cart-total { display: flex; justify-content: flex-end; align-items: center; gap: 24px; margin-top: 20px; font-size: 20px; }
.checkout { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.form input, .form select, .form textarea { padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; }
.error { background: #fbeee9; color: var(--warn); padding: 12px 14px; border-radius: 10px; }
.center { text-align: center; padding: 60px 20px; }
.center h1 { font-family: var(--serif); font-weight: normal; font-size: 34px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: 14px; }
.skeleton { color: var(--muted); padding: 40px 0; }

@media (max-width: 860px) {
  .catalog, .product, .checkout { grid-template-columns: 1fr; }
  .sidebar { order: 0; }
  .groups { display: flex; flex-wrap: wrap; gap: 6px; }
  .groups ul { display: none; }
  .groups a { background: var(--surface); border: 1px solid var(--line); }
  .header-row { gap: 12px; }
  .logo { font-size: 22px; }
  .cart-line { grid-template-columns: 56px 1fr auto; }
  .cart-line .img { width: 56px; }
  .cart-line .line-sum { grid-column: 2; }
  .row2 { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card .body { padding: 10px 12px 12px; }
  .card .name { font-size: 15px; }
  .price { font-size: 16px; }
  .product h1 { font-size: 28px; }
}

/* offline stores (home page) */
.stores { background: var(--surface); border-top: 1px solid var(--line); padding: 48px 0 56px; }
.stores-title { font-family: var(--serif); font-weight: normal; font-size: 30px; margin: 0; }
.stores-sub { margin: 6px 0 24px; }
.stores-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.store { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.store-map { display: block; width: 100%; height: 300px; border: 0; background: #eae4da; }
.store-body { padding: 18px 20px 20px; display: grid; gap: 8px; }
.store-body h3 { font-family: var(--serif); font-weight: normal; font-size: 22px; margin: 0; }
.store-addr { margin: 0; color: var(--muted); }
.store-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 15px; }
.store-meta li { display: inline-flex; align-items: center; gap: 8px; }
.store-meta a { text-decoration: none; font-weight: 500; }
.store-meta .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.store-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
@media (max-width: 860px) {
  .stores { padding: 36px 0 40px; }
  .stores-title { font-size: 24px; }
  .stores-grid { grid-template-columns: 1fr; gap: 16px; }
  .store-map { height: 240px; }
}

/* site nav */
.site-nav { display: flex; gap: 4px 22px; flex-wrap: wrap; padding: 0 0 10px; font-size: 15px; }
.site-nav a { text-decoration: none; color: var(--muted); padding: 2px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* content pages */
.page .crumbs { margin-bottom: 14px; }
.prose { max-width: 860px; }
.prose h1 { font-family: var(--serif); font-weight: normal; font-size: 38px; line-height: 1.15; margin: 0 0 16px; }
.prose h2 { font-family: var(--serif); font-weight: normal; font-size: 26px; margin: 36px 0 12px; }
.prose p, .prose li { font-size: 17px; }
.prose .lead { font-size: 19px; color: var(--ink); }
.prose a:not(.btn) { color: var(--accent); }
.prose .stores-grid { max-width: none; margin-top: 8px; }
.page:has(.stores-grid) .prose { max-width: 1200px; }
.ticks, .steps { padding-left: 22px; display: grid; gap: 8px; }
.ticks li::marker { color: var(--gold); }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 8px 0; }
details summary { cursor: pointer; font-weight: 500; }
details p { margin: 8px 0 0; }
.pickup { margin-top: 24px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 14px; line-height: 1.6; }
.pickup a { color: var(--accent); }

/* home about text */
.seo-text { margin-top: 40px; max-width: 860px; color: var(--muted); }
.seo-text h2 { font-family: var(--serif); font-weight: normal; font-size: 24px; color: var(--ink); margin: 0 0 10px; }
.seo-text a { color: var(--accent); }

/* footer */
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; padding: 12px 0 8px; }
.footer-grid p { margin: 6px 0; line-height: 1.6; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { color: var(--accent); }
.footer-brand { font-family: var(--serif); font-size: 22px; color: var(--accent); }
.footer-title { color: var(--ink); font-weight: 500; }
.footer-note { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; font-size: 13px; }
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .prose h1 { font-size: 30px; }
  .site-nav { gap: 4px 16px; overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; }
}
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
