:root {
  --gold: #b8873a;
  --gold-dark: #8c5a2b;
  --gold-light: #e2c37f;
  --gold-grad: linear-gradient(135deg, #d4a955 0%, #b07a35 55%, #8c5a2b 100%);
  --cream: #faf6ef;
  --cream-2: #f3ebdc;
  --paper: #ffffff;
  --ink: #2f2114;
  --ink-2: #6b5640;
  --ink-3: #9c8a74;
  --line: #e8dcc6;
  --green: #2e7d4f;
  --green-bg: #e6f4ea;
  --red: #b23b3b;
  --red-bg: #fbe9e9;
  --amber: #a26a00;
  --amber-bg: #fff3d6;
  --blue: #2a5d8f;
  --blue-bg: #e6eef7;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(80, 55, 20, .08);
  --shadow-lg: 0 -4px 24px rgba(80, 55, 20, .14);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); background: var(--cream); color: var(--ink); line-height: 1.45; font-size: 15px; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--gold-dark); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; line-height: 1.15; }
[hidden] { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.price { font-weight: 600; white-space: nowrap; }
.strike { text-decoration: line-through; color: var(--ink-3); font-weight: 400; margin-left: 6px; font-size: .9em; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- header ---- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(250, 246, 239, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 10px; padding: 8px 14px; max-width: 1100px; margin: 0 auto; }
.topbar .logo { height: 44px; width: auto; }
.topbar .spacer { flex: 1; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 13.5px; font-weight: 500; color: var(--ink-2); box-shadow: var(--shadow); }
.icon-btn:active { transform: scale(.97); }
.icon-btn .badge { background: var(--gold-dark); color: #fff; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 15px; transition: transform .08s, box-shadow .2s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--gold-grad); color: #fff; box-shadow: 0 4px 14px rgba(140, 90, 43, .28); }
.btn-outline { border: 1.5px solid var(--gold); color: var(--gold-dark); background: var(--paper); }
.btn-ghost { color: var(--ink-2); background: var(--cream-2); }
.btn-danger { color: var(--red); background: var(--red-bg); }
.btn-success { color: #fff; background: var(--green); }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ---- forms ---- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); outline: none; font-size: 16px; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 135, 58, .15); }
textarea.input { min-height: 70px; resize: vertical; }
.input-group { display: flex; align-items: stretch; }
.input-group .prefix { display: flex; align-items: center; padding: 0 12px; background: var(--cream-2); border: 1.5px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; font-weight: 600; color: var(--ink-2); }
.input-group .input { border-radius: 0 12px 12px 0; }
.error-text { color: var(--red); font-size: 13px; margin-top: -6px; margin-bottom: 10px; }

/* ---- layout ---- */
.page { max-width: 1100px; margin: 0 auto; padding: 0 14px 120px; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 12px; }
.section-title h2 { font-size: 26px; color: var(--ink); }
.section-title .count { font-size: 13px; color: var(--ink-3); }
.section-title .icon { font-size: 20px; }

/* ---- category chips ---- */
.chips-wrap { position: sticky; top: 61px; z-index: 25; background: var(--cream); margin: 0 -14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.chip.active { background: var(--gold-grad); color: #fff; border-color: transparent; box-shadow: 0 3px 10px rgba(140, 90, 43, .25); }

.search-wrap { padding: 12px 0 2px; }
.search { position: relative; }
.search .input { padding-left: 42px; border-radius: 999px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }

/* ---- product grid ---- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 820px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(5, 1fr); } }
.card { background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; position: relative; border: 1px solid transparent; transition: border-color .2s; }
.card.in-cart { border-color: var(--gold-light); }
.card .img { aspect-ratio: 1; background: var(--cream-2); overflow: hidden; }
.card .img img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 10px 10px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .name { font-size: 13.5px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.card .sub { font-size: 12px; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.card .price-row { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; font-size: 14.5px; }
.card .actions { margin-top: auto; padding-top: 4px; }
.card .pill { position: absolute; top: 8px; left: 8px; background: var(--gold-grad); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; letter-spacing: .3px; }
.card .pill.off { background: var(--green); }
.card .pill.oos { background: #666; }
.card .qty-badge { position: absolute; top: 8px; right: 8px; background: var(--gold-dark); color: #fff; min-width: 24px; height: 24px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; box-shadow: var(--shadow); }
.add-btn { width: 100%; min-height: 38px; border-radius: 10px; border: 1.5px solid var(--gold); color: var(--gold-dark); font-weight: 700; font-size: 14px; background: var(--paper); display: flex; align-items: center; justify-content: center; gap: 6px; }
.add-btn:active { background: var(--cream-2); }
.add-btn.disabled { border-color: var(--line); color: var(--ink-3); pointer-events: none; }

/* ---- stepper ---- */
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--gold); border-radius: 10px; overflow: hidden; background: var(--paper); }
.stepper button { width: 38px; height: 38px; font-size: 20px; font-weight: 600; color: var(--gold-dark); display: flex; align-items: center; justify-content: center; }
.stepper button:active { background: var(--cream-2); }
.stepper .val { min-width: 34px; text-align: center; font-weight: 700; font-size: 15px; }
.stepper.block { display: flex; width: 100%; }
.stepper.block .val { flex: 1; }
.stepper.sm button { width: 32px; height: 32px; font-size: 18px; }
.stepper.sm .val { min-width: 28px; font-size: 14px; }

/* ---- sticky cart bar ---- */
.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: transparent; pointer-events: none; }
.cart-bar .inner { pointer-events: auto; max-width: 640px; margin: 0 auto; background: var(--gold-grad); color: #fff; border-radius: 16px; padding: 10px 12px 10px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 8px 28px rgba(80, 55, 20, .35); transform: translateY(0); transition: transform .25s; }
.cart-bar.hidden-bar .inner { transform: translateY(140%); }
.cart-bar .count { font-size: 13px; opacity: .9; }
.cart-bar .total { font-size: 18px; font-weight: 700; }
.cart-bar .go { background: #fff; color: var(--gold-dark); border-radius: 12px; padding: 10px 16px; font-weight: 700; display: flex; align-items: center; gap: 6px; }

/* ---- bottom sheet / modal ---- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(40, 25, 10, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; }
.sheet-backdrop.open { opacity: 1; }
.sheet { width: 100%; max-width: 560px; background: var(--paper); border-radius: 20px 20px 0 0; padding: 14px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 90vh; overflow-y: auto; transform: translateY(30px); transition: transform .25s; }
.sheet-backdrop.open .sheet { transform: translateY(0); }
@media (min-width: 640px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 20px; transform: translateY(0) scale(.97); } }
.sheet .handle { width: 42px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 12px; }
.sheet h3 { font-size: 22px; margin-bottom: 4px; }
.sheet .close { position: absolute; right: 14px; top: 14px; }
.sheet-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.sheet-head img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; background: var(--cream-2); flex: 0 0 auto; }
.sheet .desc { font-size: 13px; color: var(--ink-2); margin: 6px 0 12px; }
.variants { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.variant { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); text-align: left; width: 100%; }
.variant.selected { border-color: var(--gold); background: #fdf8ee; box-shadow: 0 0 0 3px rgba(184, 135, 58, .12); }
.variant.oos { opacity: .5; }
.variant .radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto; }
.variant.selected .radio { border: 6px solid var(--gold); }
.variant .vt { font-size: 14px; font-weight: 500; flex: 1; }
.variant .vt .oos-txt { font-size: 11.5px; color: var(--red); font-weight: 600; margin-left: 6px; }
.variant img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.sheet-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }

/* ---- cart page ---- */
.cart-list { display: flex; flex-direction: column; gap: 10px; }
.cart-item { display: flex; gap: 12px; background: var(--paper); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.cart-item img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--cream-2); flex: 0 0 auto; }
.cart-item .ci-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cart-item .ci-title { font-weight: 600; font-size: 14px; line-height: 1.25; }
.cart-item .ci-var { font-size: 12.5px; color: var(--ink-2); }
.cart-item .ci-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: 8px; }
.cart-item .remove { color: var(--red); font-size: 12.5px; font-weight: 600; }
.summary { background: var(--paper); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-top: 14px; }
.summary .line { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14.5px; }
.summary .line.total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; font-size: 18px; font-weight: 700; }
.empty { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.empty .big { font-size: 48px; }
.empty h3 { color: var(--ink); margin: 10px 0 6px; font-size: 24px; }

/* ---- bill / orders ---- */
.bill { background: var(--paper); border-radius: 18px; box-shadow: var(--shadow); padding: 20px 18px; margin-top: 16px; position: relative; overflow: hidden; }
.bill::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: var(--gold-grad); }
.bill .order-no { font-family: var(--font-display); font-size: 42px; font-weight: 700; letter-spacing: 1px; color: var(--gold-dark); line-height: 1; }
.bill .bill-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }
.status.pending { background: var(--amber-bg); color: var(--amber); }
.status.paid { background: var(--green-bg); color: var(--green); }
.status.cancelled { background: var(--red-bg); color: var(--red); }
.bill-lines { margin: 16px 0 6px; border-top: 1px solid var(--line); }
.bill-line { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.bill-line .bl-qty { color: var(--ink-3); font-weight: 600; min-width: 28px; }
.bill-line .bl-name { flex: 1; min-width: 0; }
.bill-line .bl-name .v { color: var(--ink-2); font-size: 12.5px; }
.pay-note { background: var(--amber-bg); color: var(--amber); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-top: 14px; display: flex; gap: 10px; align-items: flex-start; }
.pay-note.paid { background: var(--green-bg); color: var(--green); }
.order-card { background: var(--paper); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; cursor: pointer; }
.order-card .oc-top { display: flex; justify-content: space-between; align-items: center; }
.order-card .oc-no { font-weight: 700; font-size: 16px; color: var(--gold-dark); }

/* ---- misc ---- */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 60; opacity: 0; transition: all .25s; pointer-events: none; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.view-head { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; }
.view-head h1 { font-size: 28px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.hero { padding: 14px 0 4px; }
.hero h1 { font-size: 30px; }
.hero p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.editing-banner { background: var(--blue-bg); color: var(--blue); padding: 10px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 600; margin: 12px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.skeleton { background: linear-gradient(90deg, var(--cream-2) 25%, #fff 50%, var(--cream-2) 75%); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: var(--radius); height: 220px; }
@keyframes sh { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }
@media print {
  .topbar, .cart-bar, .no-print, .chips-wrap { display: none !important; }
  body { background: #fff; }
  .page { padding-bottom: 0; }
}

/* ---- product detail page ---- */
.pd { max-width: 960px; margin: 0 auto; }
@media (min-width: 820px) { .pd { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; } .pd .pd-desc { grid-column: 1 / -1; } }
.gallery { position: relative; border-radius: 18px; overflow: hidden; background: var(--cream-2); box-shadow: var(--shadow); }
.gallery .track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gallery .track::-webkit-scrollbar { display: none; }
.gallery .track img { flex: 0 0 100%; width: 100%; aspect-ratio: 1; object-fit: cover; scroll-snap-align: start; }
.gallery .dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.gallery .dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.6); box-shadow: 0 0 2px rgba(0,0,0,.4); transition: all .2s; }
.gallery .dots span.active { background: #fff; width: 18px; border-radius: 4px; }
.gallery .counter { position: absolute; top: 10px; right: 10px; background: rgba(40,25,10,.55); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 4px; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumbs img { width: 58px; height: 58px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; border: 2px solid transparent; opacity: .7; cursor: pointer; background: var(--cream-2); }
.thumbs img.active { border-color: var(--gold); opacity: 1; }
.pd-info { padding-top: 14px; }
.pd-info h1 { font-size: 28px; line-height: 1.1; }
.pd-info .tagline { color: var(--ink-2); margin: 4px 0 10px; font-size: 15px; }
.pd-info .pd-price { font-size: 24px; font-weight: 700; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pd-info .pd-price .strike { font-size: 16px; }
.pd-info .pd-price .off { font-size: 13px; font-weight: 700; color: var(--green); background: var(--green-bg); padding: 2px 8px; border-radius: 999px; }
.pd-buy { background: var(--paper); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); margin-top: 14px; }
.pd-buy .lbl { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.pd-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pd-meta span { font-size: 12px; background: var(--cream-2); color: var(--ink-2); padding: 4px 10px; border-radius: 999px; }
.pd-desc { background: var(--paper); border-radius: 16px; padding: 18px 18px 8px; box-shadow: var(--shadow); margin-top: 18px; font-size: 15px; line-height: 1.6; color: var(--ink); }
.pd-desc h2, .pd-desc h3, .pd-desc h4 { font-family: var(--font-body); font-size: 15.5px; font-weight: 700; margin: 18px 0 6px; color: var(--ink); }
.pd-desc h2 { font-size: 17px; }
.pd-desc p { margin: 0 0 10px; }
.pd-desc p:has(> strong:only-child), .pd-desc p:has(> b:only-child) { margin-top: 16px; }
.pd-desc ul, .pd-desc ol { margin: 0 0 12px; padding-left: 20px; }
.pd-desc li { margin: 3px 0; }
.pd-desc a { color: var(--gold-dark); font-weight: 600; }
.pd-desc.collapsed { max-height: 320px; overflow: hidden; position: relative; }
.pd-desc.collapsed::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(transparent, var(--paper)); }
.pd-more { display: block; width: 100%; text-align: center; padding: 10px; font-weight: 700; color: var(--gold-dark); background: var(--paper); border-radius: 0 0 16px 16px; margin-top: -8px; box-shadow: var(--shadow); }
.card .img { cursor: pointer; }
.related-title { margin: 26px 0 10px; font-size: 22px; }

/* ---- phone-first navigation & panels (v4) ---- */
.only-phone { display: none !important; }
@media (max-width: 819px) {
  .only-phone { display: inline-flex !important; }
  .only-desktop { display: none !important; }
  .topbar .logo { height: 38px; }
  .page { padding-bottom: 170px; }
  .hero { padding: 10px 0 0; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 13px; }
  .chips-wrap { top: 55px; }
  .cart-bar { bottom: calc(58px + env(safe-area-inset-bottom)); padding-bottom: 8px; }
  .toast { bottom: 150px; }
  .sheet-backdrop { align-items: flex-end; }
  .section-title { margin: 20px 0 10px; }
  .section-title h2 { font-size: 22px; }
}
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; background: rgba(255, 255, 255, .97); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(80, 55, 20, .06); }
.bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px; font-size: 11px; font-weight: 600; color: var(--ink-3); position: relative; min-height: 56px; }
.bottom-nav button svg { transition: transform .15s; }
.bottom-nav button.active { color: var(--gold-dark); }
.bottom-nav button.active svg { transform: translateY(-1px); stroke-width: 2.4; }
.bottom-nav button.active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold-grad); }
.bottom-nav .dot { position: absolute; top: 6px; right: calc(50% - 18px); background: var(--gold-dark); color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
@media (min-width: 820px) { .bottom-nav { display: none; } }

/* search panel */
.search-panel { position: fixed; inset: 0; z-index: 55; background: var(--cream); display: flex; flex-direction: column; animation: spin-in .18s ease-out; }
@keyframes spin-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.sp-head { display: flex; gap: 8px; align-items: center; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--paper); border-bottom: 1px solid var(--line); }
.sp-head .input { min-height: 44px; }
.sp-body { flex: 1; overflow-y: auto; padding: 12px 14px calc(30px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.sp-section { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; margin: 10px 0 8px; }
.sugg { display: flex; flex-wrap: wrap; gap: 8px; }
.sugg .chip { padding: 9px 14px; }
.sp-result { display: flex; gap: 10px; align-items: center; background: var(--paper); border-radius: 12px; padding: 8px 10px 8px 8px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: pointer; }
.sp-result img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--cream-2); flex: 0 0 auto; }
.sp-result .sr-body { flex: 1; min-width: 0; }
.sp-result .sr-title { font-size: 14px; font-weight: 600; line-height: 1.25; }
.sp-result .sr-sub { font-size: 12px; color: var(--ink-3); }
.sp-result .sr-price { font-size: 14px; font-weight: 700; margin-top: 2px; }
.sp-result .add-btn { width: auto; min-height: 36px; padding: 0 12px; flex: 0 0 auto; }
.sp-result .stepper.sm { flex: 0 0 auto; }
@media (min-width: 820px) { .search-panel { inset: auto; top: 0; left: 50%; transform: translateX(-50%); width: min(720px, 100%); max-height: 100vh; border-radius: 0 0 20px 20px; box-shadow: 0 20px 60px rgba(40, 25, 10, .25); } .search-panel::before { content: ''; } }
.sp-backdrop { position: fixed; inset: 0; background: rgba(40, 25, 10, .35); z-index: 54; }

/* search trigger on shop */
.search-trigger { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 16px; border-radius: 999px; background: var(--paper); border: 1.5px solid var(--line); color: var(--ink-3); font-size: 15px; text-align: left; box-shadow: var(--shadow); }
.search-trigger svg { color: var(--ink-3); flex: 0 0 auto; }
.search-trigger kbd { margin-left: auto; font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-family: inherit; }

/* toolbar: filter + sort + active chips */
.toolbar-row { display: flex; gap: 8px; align-items: center; padding: 10px 0 2px; overflow-x: auto; scrollbar-width: none; }
.toolbar-row::-webkit-scrollbar { display: none; }
.filter-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--paper); border: 1.5px solid var(--line); font-weight: 600; font-size: 13.5px; color: var(--ink-2); flex: 0 0 auto; }
.filter-btn.on { border-color: var(--gold); color: var(--gold-dark); background: #fdf8ee; }
.filter-btn .n { background: var(--gold-dark); color: #fff; border-radius: 999px; min-width: 18px; height: 18px; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.sort-wrap { position: relative; flex: 0 0 auto; }
.sort-wrap select { appearance: none; -webkit-appearance: none; min-height: 38px; padding: 0 30px 0 14px; border-radius: 999px; background: var(--paper); border: 1.5px solid var(--line); font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.sort-wrap::after { content: '▾'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ink-3); }
.fchip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px 0 12px; border-radius: 999px; background: var(--gold-grad); color: #fff; font-size: 12.5px; font-weight: 600; flex: 0 0 auto; }
.fchip b { font-weight: 800; opacity: .85; }
.clear-all { font-size: 13px; font-weight: 600; color: var(--red); flex: 0 0 auto; padding: 0 6px; }
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 4px; font-size: 13.5px; color: var(--ink-2); }

/* filter sheet */
.fgroup { margin-bottom: 16px; }
.fgroup .lbl { font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .4px; }
.fopts { display: flex; flex-wrap: wrap; gap: 8px; }
.fopt { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); font-size: 13.5px; font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.fopt.on { border-color: var(--gold); background: #fdf8ee; color: var(--gold-dark); font-weight: 700; }
.fopt .c { font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.sheet .sticky-actions { position: sticky; bottom: -18px; background: var(--paper); padding: 12px 0 4px; margin-top: 6px; display: flex; gap: 10px; border-top: 1px solid var(--line); }

/* category menu sheet */
.cat-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat-item { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--cream); border: 1.5px solid var(--line); text-align: left; min-height: 60px; }
.cat-item.on { border-color: var(--gold); background: #fdf8ee; }
.cat-item .ci-icon { font-size: 22px; }
.cat-item .ci-name { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.cat-item .ci-count { font-size: 11.5px; color: var(--ink-3); }
.cat-item.all { grid-column: 1 / -1; background: var(--gold-grad); color: #fff; border-color: transparent; }
.cat-item.all .ci-count { color: rgba(255,255,255,.8); }
.menu-links { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.menu-links a, .menu-links button { display: flex; align-items: center; gap: 10px; padding: 11px 6px; font-weight: 600; color: var(--ink); text-decoration: none; font-size: 15px; text-align: left; }

/* low-stock hints */
.stock-hint { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; color: var(--amber); background: var(--amber-bg); padding: 2px 8px; border-radius: 999px; white-space: nowrap; line-height: 1.4; vertical-align: middle; }
.stock-hint.big { font-size: 13px; padding: 4px 10px; margin-left: 8px; }
.stock-hint.out { color: var(--red); background: var(--red-bg); }
.card .stock-hint { align-self: flex-start; margin-top: -2px; }
.variant .stock-hint { font-size: 10.5px; padding: 1px 7px; margin-left: 4px; }
