:root {
  --bg: #f6efe3;
  --surface: #fffdf9;
  --ink: #211a12;
  --muted: #7a7060;
  --line: #ece2d2;
  --primary: #211f1b;
  --primary-2: #3d3a34;
  --primary-ink: #fff7e6;
  --primary-soft: #f4ecdd;
  /* luxury gold */
  --accent: #a87f33;
  --accent-soft: #f6ecd6;
  --gold-1: #e3c87f;
  --gold-2: #c39b4a;
  --gold-3: #9a7327;
  --gold-deep: #6f5219;
  --header-1: #2a2118;
  --header-2: #14100a;
  --danger: #c0392b;
  --radius: 16px;
  --shadow: 0 3px 14px rgba(74, 56, 20, .10);
  --shadow-lg: 0 10px 30px rgba(74, 56, 20, .20);
  --shadow-gold: 0 6px 20px rgba(160, 120, 40, .28);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  color: var(--ink);
  font-family: "Assistant", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* Fixed gradient background via pseudo-element — avoids background-attachment:fixed
   which is broken on iOS Safari and causes elastic overscroll to look infinite */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 560px at 50% -8%, rgba(227, 200, 127, .45), rgba(227, 200, 127, 0) 58%),
    radial-gradient(900px 520px at 100% 105%, rgba(176, 138, 60, .22), rgba(176, 138, 60, 0) 55%),
    linear-gradient(180deg, #f3e7d0 0%, #ecdcc0 100%);
}

body {
  background: transparent;
  min-height: 100dvh;
  padding-bottom: 84px;
}

/* ===== Header ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(135deg, var(--header-1), var(--header-2));
  color: #fff;
  padding: 16px 18px 18px;
  text-align: center;
  border-radius: 0 0 22px 22px;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--gold-3), var(--gold-1), var(--gold-3)) 1;
  box-shadow: 0 8px 24px rgba(20, 14, 6, .35);
}
.topbar-brand {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  margin-bottom: 3px;
  background: linear-gradient(90deg, var(--gold-1), #f3e3b4, var(--gold-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.topbar h1 { color: #fdf7ea; }
.topbar h1 { margin: 0; font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; }
.topbar-row { display: flex; justify-content: space-between; align-items: flex-start; }
.topbar-action {
  background: rgba(255,255,255,.16); color: #fff; border: none;
  border-radius: 10px; padding: 8px 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; font-size: .85rem;
}

.login-card { max-width: 380px; margin: 36px auto 0; }
.login-card h2 { margin: 0 0 14px; font-weight: 800; }
.login-error { color: var(--danger); margin-top: 12px; font-size: .9rem; font-weight: 600; }

.inbox-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.inbox-bar .btn { padding: 8px 16px; }

.badge { padding: 5px 11px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.badge.ok  { background: #e7f7ee; color: #117a3d; }
.badge.err { background: #fdecec; color: var(--danger); }
.badge.new { background: var(--primary-soft); color: var(--primary); }

main { padding: 12px 8px; max-width: 1080px; margin: 0 auto; }

.screen { display: block; animation: fade .25s ease; }
.hidden { display: none !important; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== Cards ===== */
.card {
  background: linear-gradient(180deg, #fffdf9 0%, #fdf7ec 100%);
  border: 1px solid rgba(168, 127, 51, .18);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(74, 56, 20, .09), inset 0 1px 0 rgba(255, 255, 255, .6);
}

.field-label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: .82rem;
  color: var(--muted);
  letter-spacing: .02em;
}
.mini-label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  font-size: .8rem;
  color: var(--ink);
}

.input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: 1rem;
  background: #fff;
  font-family: inherit;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
/* keyboard focus indicator for all interactive elements (a11y) */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible,
.cat-tile:focus-visible, .product-card:focus-visible, .tab:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
/* skip-to-content link, visible only on keyboard focus */
.skip-link {
  position: absolute; right: 8px; top: -60px; z-index: 200;
  background: var(--primary); color: #fff; padding: 10px 16px;
  border-radius: 10px; font-weight: 700; text-decoration: none;
  transition: top .15s;
}
.skip-link:focus { top: 8px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.site-footer {
  text-align: center; padding: 22px 16px 34px; margin-top: 18px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem;
}
.site-footer a { color: var(--primary); font-weight: 600; text-decoration: underline; }
.site-footer a:hover { color: var(--accent); }
.site-footer .footer-biz { margin-top: 8px; font-size: .78rem; color: var(--muted); }
/* legal / document pages (privacy, accessibility) */
.legal { max-width: 820px; margin: 0 auto; padding: 18px 18px 60px; line-height: 1.7; color: var(--ink); }
.legal .link-back { display: inline-block; margin-bottom: 14px; }
.legal h1 { font-size: 1.6rem; margin: 6px 0 4px; }
.legal h2 { font-size: 1.15rem; margin: 26px 0 8px; color: var(--ink); }
.legal h3 { font-size: 1rem; margin: 16px 0 6px; color: var(--primary-2); }
.legal p { margin: 8px 0; color: var(--ink); }
.legal ul { margin: 8px 0; padding-inline-start: 22px; }
.legal li { margin: 5px 0; }
.legal .legal-meta { color: var(--muted); font-size: .9rem; }
.legal .legal-updated { margin-top: 30px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); padding-top: 14px; }
.legal hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

.row { display: flex; gap: 10px; align-items: center; }
.row .input { flex: 1; }

/* ===== Buttons ===== */
.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.3); box-shadow: none; }
.btn:disabled:active { transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--gold-1) 0%, var(--gold-2) 48%, var(--gold-3) 100%);
  color: #2e2206;
  font-weight: 800;
  letter-spacing: .01em;
  box-shadow: var(--shadow-gold);
  border: 1px solid rgba(255, 255, 255, .25);
}
.btn-primary:active { filter: brightness(.96); }
.btn-secondary { background: #f6efe1; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: #fdecec; color: var(--danger); }
.btn.full { width: 100%; margin-bottom: 14px; }

/* ===== Product list (order) ===== */
.product-list { list-style: none; margin: 12px 0 0; padding: 0; }
.product-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  border-radius: 10px;
  transition: background .15s;
}
.product-row:last-child { border-bottom: none; }
.product-row .name { flex: 1; font-weight: 600; }

/* ===== Product thumbnails ===== */
.thumb {
  width: 46px; height: 46px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--primary-soft);
  border: 1px solid var(--line);
}
.thumb-empty {
  display: inline-block;
  background:
    var(--primary-soft)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9a9bb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E")
    center / 22px no-repeat;
}
.product-row .sku { color: var(--muted); font-size: .8rem; font-weight: 400; margin-top: 2px; }

.product-row.selected {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.product-row.selected .name { color: var(--accent); }

.qty { display: flex; align-items: center; gap: 6px; }
.qty button {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  line-height: 1;
  transition: background .12s, transform .08s;
}
.qty button:active { transform: scale(.9); background: var(--primary-soft); }
.qty input {
  width: 46px;
  text-align: center;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 8px 2px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
}

/* ===== Product grid / cards (customer ordering) ===== */
.product-grid {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  align-items: stretch;
}
.product-grid .cat-header,
.product-grid .subcat-header { grid-column: 1 / -1; }
.product-card {
  background: linear-gradient(180deg, #fffdf9 0%, #fbf4e6 100%);
  border: 1px solid rgba(168, 127, 51, .22);
  border-radius: 15px;
  padding: 7px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(74, 56, 20, .10), inset 0 1px 0 rgba(255, 255, 255, .65);
  transition: border-color .15s, box-shadow .18s, transform .12s;
}
.product-card:hover { transform: translateY(-2px); border-color: var(--gold-2); box-shadow: var(--shadow-gold); }
.product-card.selected {
  border-color: var(--gold-2);
  box-shadow: 0 0 0 2px var(--gold-1), var(--shadow-gold);
}
.card-img {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(160deg, #f1e7d3 0%, #fbf6ec 70%);
  border: 1px solid rgba(168, 127, 51, .10);
  border-radius: 11px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 7px;
}
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.card-ph {
  width: 100%; height: 100%;
  background:
    var(--accent-soft)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9b48f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E")
    center / 42px no-repeat;
}
.card-qbadge {
  position: absolute;
  top: 5px; inset-inline-start: 5px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: .64rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(26, 22, 16, .25);
}
.card-name { font-weight: 700; font-size: .76rem; line-height: 1.2; overflow-wrap: anywhere; }
.card-sub { color: var(--muted); font-size: .66rem; margin-top: 1px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-qty {
  display: flex; align-items: stretch; gap: 6px;
  margin-top: auto; padding-top: 8px;
}
.card-qty button {
  flex: 1; min-width: 0;
  height: 32px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 1.2rem; font-weight: 800;
  color: var(--accent);
  cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, transform .08s, border-color .12s, opacity .12s;
}
.card-qty button[data-act="inc"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.card-qty button:active { transform: scale(.93); }
.card-qty button[data-act="dec"][disabled] { opacity: .35; pointer-events: none; }
@media (min-width: 900px) {
  .product-grid { gap: 10px; }
}

/* ===== Category home (customer) ===== */
.search-input { margin-top: 4px; }
.empty-msg { text-align: center; color: var(--muted); margin-top: 24px; font-size: .95rem; }
.cat-grid {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 12px;
}
.cat-tile {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cat-tile-img {
  width: 56%;
  max-width: 118px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: #fffdf8;
  padding: 4px;
  border: 2px solid transparent;
  background-image: linear-gradient(#fffdf8, #fffdf8), linear-gradient(145deg, var(--gold-1), var(--gold-3));
  background-origin: border-box;
  background-clip: content-box, border-box;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(160,120,40,.10);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: transform .12s, box-shadow .18s;
}
.cat-tile:hover .cat-tile-img { box-shadow: var(--shadow-gold); transform: translateY(-2px); }
.cat-tile:active .cat-tile-img { transform: scale(.96); box-shadow: var(--shadow-lg); }
.cat-tile-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile-img img.cat-icon { object-fit: cover; }
.cat-tile-img img.cat-photo { object-fit: cover; }
.back-bookmark {
  position: fixed;
  top: 35%;
  left: 0;
  transform: translateY(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 10px;
  background: linear-gradient(to bottom, var(--gold-1), var(--gold-3));
  color: var(--ink);
  border: none;
  border-radius: 0 14px 14px 0;
  box-shadow: 4px 0 18px rgba(0,0,0,.22);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 800;
  writing-mode: vertical-rl;
  letter-spacing: .06em;
  line-height: 1;
}
.back-bookmark-arrow {
  font-size: 1rem;
  line-height: 1;
  writing-mode: horizontal-tb;
}
.cat-tile-img .card-ph { width: 100%; height: 100%; }
.cat-tile-body { text-align: center; margin-top: 11px; }
.cat-tile-name { font-weight: 800; font-size: .95rem; color: var(--ink); line-height: 1.25; }
.cat-tile-count { color: var(--muted); font-size: .76rem; margin-top: 2px; }
@media (min-width: 720px) {
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.cat-page-title {
  font-size: 1.15rem; font-weight: 800;
  color: var(--ink);
  margin: 2px 2px 0;
}

/* ===== Sticky cart bar (customer) ===== */
.cart-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
  background: rgba(252, 247, 237, .96);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--gold-3), var(--gold-1), var(--gold-3)) 1;
  box-shadow: 0 -6px 24px rgba(74, 56, 20, .14);
}
.cart-bar .btn { padding: 13px 26px; }
.cart-count {
  font-weight: 700; font-size: .92rem; color: var(--ink);
  background: var(--primary-soft);
  padding: 8px 14px; border-radius: 999px;
}

/* ===== Checkout summary ===== */
.cart-summary { list-style: none; margin: 0; padding: 0; }
.csum-row, .csum-total {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 9px 2px; border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
.csum-row span:first-child { color: var(--ink); }
.csum-qty { font-weight: 800; color: var(--accent); min-width: 28px; text-align: center; }
.csum-total { border-bottom: none; font-weight: 800; padding-top: 12px; }

/* ===== Enlarged item modal (customer) ===== */
.pmodal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.pmodal.hidden { display: none; }
.pmodal-backdrop { position: absolute; inset: 0; background: rgba(26, 22, 16, .55); }
.pmodal-box {
  position: relative; z-index: 1;
  background: linear-gradient(180deg, #fffdf9 0%, #fbf4e6 100%);
  border: 1px solid rgba(168, 127, 51, .28);
  border-radius: 20px;
  width: 100%; max-width: 360px;
  padding: 0;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: slideup .25s cubic-bezier(.2,.8,.2,1);
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pmodal-body {
  overflow-y: auto;
  padding: 50px 18px 18px;
  flex: 1;
  overscroll-behavior: contain;
}
.pmodal-close {
  position: absolute; top: 10px; inset-inline-start: 10px;
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: var(--primary-soft); color: var(--ink);
  font-size: 1.4rem; line-height: 1; cursor: pointer;
  z-index: 10;
}
.pmodal-img {
  width: 100%; aspect-ratio: 1 / 1;
  background: linear-gradient(160deg, #f1e7d3 0%, #fbf6ec 70%);
  border: 1px solid rgba(168, 127, 51, .12);
  border-radius: 14px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.pmodal-img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.pmodal-name { font-weight: 800; font-size: 1.15rem; color: var(--ink); line-height: 1.25; }
.pmodal-sub { color: var(--muted); font-size: .9rem; margin-top: 5px; }
.pmodal-qty { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 18px; }
.pmodal-qty button {
  width: 48px; height: 48px; border-radius: 13px;
  border: 1.5px solid var(--line); background: #fff;
  font-size: 1.5rem; font-weight: 800; color: var(--accent); cursor: pointer; line-height: 1;
  transition: transform .08s;
}
.pmodal-qty button[data-act="inc"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.pmodal-qty button:active { transform: scale(.92); }
#pmQty { font-size: 1.5rem; font-weight: 800; min-width: 32px; color: var(--ink); }
.pmodal-actions { display: flex; gap: 10px; margin-top: 18px; }
.pmodal-actions .btn { flex: 1; margin: 0; }
#pmNoteBtn.has-note { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.pmodal-note { margin-top: 12px; }
.pmodal-note.hidden { display: none; }
.done-card { line-height: 1.55; }
.done-title { margin: 10px 0 4px; font-size: 1.4rem; color: var(--ink); }
.done-lead { font-weight: 700; color: var(--ink); margin: 6px 0 14px; }
.done-line { color: var(--muted); margin: 9px 0; font-size: .96rem; }

textarea.input { resize: vertical; min-height: 58px; line-height: 1.4; }
.order-note {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 12px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink);
}

/* ===== Order summary ===== */
.order-summary {
  position: sticky;
  bottom: 86px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border-radius: 18px;
  padding: 12px 12px 12px 16px;
  margin-top: 10px;
  box-shadow: var(--shadow-lg);
}
#orderCount {
  font-weight: 700;
  font-size: .95rem;
  color: var(--ink);
  background: var(--primary-soft);
  padding: 8px 14px;
  border-radius: 999px;
}
.order-summary .btn { padding: 12px 24px; }

/* ===== Lists (salons / catalog / history) ===== */
.list { list-style: none; margin: 0; padding: 0; }
.cat-header {
  font-weight: 800;
  font-size: .8rem;
  color: var(--accent);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 12px 2px 6px;
}
.cat-header:first-child { margin-top: 0; }
/* collapsible category header (admin catalog) */
.cat-toggle {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; cursor: pointer; user-select: none;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px; margin: 8px 0;
  transition: background .12s, border-color .12s;
}
.cat-toggle:hover { border-color: var(--accent); }
.cat-toggle.open { background: var(--accent-soft); border-color: var(--accent); }
.cat-toggle-name { font-weight: 800; font-size: .95rem; color: var(--ink); }
.cat-toggle-meta { display: flex; align-items: center; gap: 10px; }
.cat-count {
  background: var(--primary-soft); color: var(--muted);
  font-size: .78rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; min-width: 26px; text-align: center;
}
.cat-chev { color: var(--accent); font-size: 1rem; transition: transform .15s; }
.cat-toggle.open .cat-chev { transform: rotate(180deg); }
.subcat-header {
  font-weight: 700;
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .03em;
  margin: 4px 14px 8px;
  padding-right: 9px;
  border-right: 3px solid var(--accent);
}
.list-item {
  background: var(--surface);
  border-radius: 14px;
  padding: 15px;
  margin-bottom: 10px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .08s, box-shadow .15s;
}
.list-item:active { transform: scale(.99); box-shadow: 0 1px 6px rgba(46,22,50,.08); }
.list-item .title { font-weight: 700; }
.list-item .sub { color: var(--muted); font-size: .85rem; margin-top: 3px; }

.catalog-item { display: flex; align-items: center; gap: 12px; }
.catalog-item-text { flex: 1; min-width: 0; }
.catalog-item-price { font-weight: 800; color: var(--gold-3); white-space: nowrap; padding-inline-start: 8px; }
/* prices */
.card-price { font-weight: 800; font-size: .8rem; color: var(--gold-3); margin-top: 3px; }
.pmodal-price { font-weight: 800; font-size: 1.18rem; color: var(--gold-3); margin-top: 7px; }
.price-was { color: var(--muted); font-weight: 600; text-decoration: line-through; opacity: .75; margin-inline-end: 4px; }
.deal-fields { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0 4px; background: #faf6ec; }
.deal-fields-title { font-weight: 800; color: var(--gold-3); font-size: .9rem; margin-bottom: 6px; }
/* bundle builder */
.bundle-intro { color: var(--muted); font-size: .92rem; line-height: 1.45; margin: 2px 0 14px; }
.bundle-full { color: #1c7c3a !important; font-weight: 800; }
.csum-bundle { align-items: flex-start; }
.csum-bundle .csum-rm { background: none; border: none; color: var(--danger); font-size: 1.1rem; font-weight: 800; cursor: pointer; padding: 0 4px; line-height: 1; }
.csum-bundle-items { display: block; color: var(--muted); font-weight: 500; font-size: .76rem; line-height: 1.35; margin-top: 3px; }
.csum-name { flex: 1; min-width: 0; }
.csum-line-price { font-weight: 700; color: var(--gold-3); min-width: 62px; text-align: left; }
.csum-grand { color: var(--gold-3); font-size: 1.05rem; }
.csum-was { color: var(--muted); font-weight: 500; opacity: .7; margin-inline-end: 4px; font-size: .82em; }
.csum-deal-badge { display: block; font-size: .72rem; font-weight: 800; color: var(--danger); margin-top: 2px; }
.csum-savings { color: #1c7c3a; font-size: .9rem; border-top: 1px solid var(--line); padding-top: 8px; }
/* sale / deal label (red) */
.deal-tag {
  color: var(--danger); font-weight: 800; line-height: 1.25;
  font-size: .72rem; margin-top: 3px;
}
.catalog-item-text .deal-tag { font-size: .8rem; margin-top: 4px; }
.pmodal-deal { font-size: .98rem; margin-top: 5px; }
/* size selector (variant groups) */
.pm-sizes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0 4px; }
.pm-size {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 700;
  font-size: .9rem; cursor: pointer; transition: all .12s;
}
.pm-size.active { border-color: var(--gold-3); background: #faf2dd; color: var(--gold-3); }
.variant-card .pick-size { font-weight: 800; color: var(--gold-3); font-size: .9rem; }

/* ===== Extension specification selector (inside product modal) ===== */
.pm-ext-spec {
  width: 100%;
  background: linear-gradient(135deg, #faf6ec 0%, #fff9ee 100%);
  border: 1.5px solid rgba(168,127,51,.22);
  border-radius: 14px;
  padding: 12px 12px 10px;
  margin: 8px 0 4px;
  display: flex; flex-direction: column; gap: 10px;
  text-align: right;
}
.ext-spec-row { display: flex; flex-direction: column; gap: 6px; }
.ext-spec-label { font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ext-spec-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.ext-chip {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 6px 13px; font: inherit; font-weight: 700;
  font-size: .85rem; cursor: pointer; transition: all .12s;
}
.ext-chip--active { border-color: var(--gold-3); background: #faf2dd; color: var(--gold-3); }
.ext-chip--fixed { cursor: default; }

.section-title { font-size: 1.05rem; font-weight: 800; margin: 18px 4px 10px; }
.link-back {
  background: none; border: none;
  color: var(--primary); font-size: .95rem; font-weight: 600;
  padding: 4px 0 10px; cursor: pointer;
}

.icon-del {
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  color: var(--danger);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 7px 14px;
  font-family: inherit;
}
.icon-del:active { background: #fdecec; }

/* ===== Tab bar ===== */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line);
  z-index: 10;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px 0 12px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: color .15s;
}
.tab svg { width: 23px; height: 23px; }
.tab.active { color: var(--primary); }

/* ===== Modal ===== */
.modal {
  position: fixed; inset: 0;
  background: rgba(37, 18, 43, .5);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50; padding: 0;
  animation: fade .2s ease;
}
.modal-box {
  background: #fff;
  border-radius: 22px 22px 0 0;
  width: 100%; max-width: 480px;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0));
  box-shadow: var(--shadow-lg);
  animation: slideup .28s cubic-bezier(.2,.8,.2,1);
  max-height: 94vh; overflow-y: auto;   /* גיבוי: תמיד אפשר לגלול אם לא נכנס */
}
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
.modal-box h2 { margin: 0 0 14px; font-size: 1.2rem; font-weight: 800; }
.modal-box label {
  display: block; font-size: .82rem; font-weight: 700;
  color: var(--muted); margin: 12px 0 5px;
}
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }
/* שדות קצרים זה לצד זה בחלון העריכה */
.m-row { display: flex; gap: 12px; }
.m-col { flex: 1; min-width: 0; }
.m-col label { margin-top: 12px; }
.m-col .input { width: 100%; }
/* חלון עריכת מוצר — פריסת רשת רחבה (ריבועית) שכל השדות נראים יחד בלי גלילה */
.pform { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
.pform .span2 { grid-column: 1 / -1; }
.pform .pf { min-width: 0; }
.pform label { margin-top: 5px; margin-bottom: 2px; font-size: .78rem; }
.pform .img-field { margin-top: 2px; }
.pform .img-preview { width: 54px; height: 54px; }
.pform .input { padding-top: 9px; padding-bottom: 9px; }
.pform .deal-fields { margin: 6px 0 2px; padding: 7px 11px; }
.pform .deal-fields-title { margin-bottom: 2px; }
@media (max-width: 600px) {
  .pform { grid-template-columns: 1fr; }
  .pform .m-row { flex-direction: column; gap: 0; }
}
@media (min-width: 620px) {
  .modal:has(.pform) { align-items: center; padding: 12px; }
  .modal-box:has(.pform) { max-width: 780px; max-height: 96vh; border-radius: 20px; padding: 14px 18px; }
  .modal-box:has(.pform) h2 { margin-bottom: 8px; }
  .modal-box:has(.pform) .modal-actions { margin-top: 12px; }
}

/* ===== Image picker (product modal) ===== */
.img-field { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.img-preview {
  width: 64px; height: 64px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border: 1.5px solid var(--line);
}
.img-preview.empty {
  background:
    var(--primary-soft)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9a9bb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E")
    center / 28px no-repeat;
}
.img-field-actions { display: flex; gap: 8px; flex: 1; }
.img-field-actions .btn { padding: 9px 14px; font-size: .85rem; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 100px; left: 50%; transform: translateX(-50%);
  background: var(--header-2); color: #fff;
  padding: 12px 20px; border-radius: 999px;
  z-index: 60; font-size: .9rem; font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: fade .2s ease;
}

/* ===== Report / print ===== */
.report {
  background: #fff; border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.report h2 { margin-top: 0; font-weight: 800; }
.ship-status {
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 14px;
}
.ship-status.ok { background: #e7f7ee; color: #117a3d; }
.ship-status.err { background: #fdecec; color: var(--danger); }
.ship-status a { color: inherit; }
.report table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.report th {
  text-align: right; padding: 10px 8px;
  border-bottom: 2px solid var(--ink);
  font-size: .85rem;
}
.report td { text-align: right; padding: 11px 8px; border-bottom: 1px solid var(--line); }
.report td .sub { color: var(--muted); font-size: .8rem; }
.report-actions { display: flex; gap: 10px; margin-top: 16px; }
.report-actions .btn { flex: 1; }

.consent-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(33,26,18,.72);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.consent-overlay.hidden { display: none; }
.consent-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px 24px;
  max-width: 400px;
  width: 100%;
  display: flex; flex-direction: column; gap: 18px;
}
.consent-logo {
  font-size: .8rem; font-weight: 800; color: var(--muted);
  letter-spacing: .1em; text-align: center; text-transform: uppercase;
}
.consent-title {
  font-size: 1.2rem; font-weight: 800; color: var(--ink);
  margin: 0; text-align: center;
}
.consent-body {
  font-size: .86rem; color: var(--muted); margin: 0;
  line-height: 1.65; text-align: right;
}
.consent-body a { color: var(--accent); }
.consent-check-label {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .9rem; color: var(--ink); text-align: right; cursor: pointer;
}
.consent-check-label input[type="checkbox"] {
  margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--accent);
}
.consent-check-label a { color: var(--accent); }
.btn-link-privacy {
  display: inline-block; margin: 8px 0;
  background: var(--accent); color: #fff;
  padding: 10px 18px; border-radius: 10px;
  font-weight: 700; font-size: .9rem; text-decoration: none;
}
.btn-link-privacy:hover { opacity: .88; }

@media print {
  .no-print, .topbar, .tabbar { display: none !important; }
  body { padding: 0; background: #fff; }
  .report { box-shadow: none; padding: 0; }
}

/* =====================================================================
   Usability pack — loading skeletons, empty states, touch targets,
   reduced-motion. (JS helpers: skeletonRows() / emptyState() in app.js)
   ===================================================================== */

/* ---------- Loading skeletons (shimmer) ---------- */
.skel-item {
  display: flex; gap: 12px; align-items: center;
  padding: 14px 16px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.skel { position: relative; overflow: hidden; background: var(--primary-soft); border-radius: 8px; }
.skel::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
  animation: sk-shimmer 1.2s infinite;
}
@keyframes sk-shimmer { to { transform: translateX(100%); } }
.skel-thumb { width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0; }
.skel-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skel-line { height: 12px; }
.skel-line.w-80 { width: 80%; }
.skel-line.w-40 { width: 40%; }

/* ---------- Skeleton category tiles (customer page) ---------- */
.cat-tile.skel-tile { pointer-events: none; }
.skel-tile .skel-line { margin: 8px auto 0; }

/* ---------- Empty states ---------- */
.empty-state {
  list-style: none; text-align: center; padding: 46px 22px;
  color: var(--muted);
  grid-column: 1 / -1;   /* span full width inside card grids */
}
.empty-state svg {
  width: 42px; height: 42px; stroke: var(--accent); opacity: .75;
  margin-bottom: 12px; fill: none; stroke-width: 1.6;
}
.empty-state .es-title { font-weight: 700; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }
.empty-state .es-hint { font-size: .9rem; line-height: 1.5; }

/* ---------- Touch targets: min 44px (qty stepper was 36px) ---------- */
.qty button { width: 44px; height: 44px; font-size: 1.3rem; }
.qty input { min-height: 44px; }

/* ---------- Focus rings for inputs/lists (extends existing a11y) ---------- */
.input:focus-visible, select:focus-visible,
.list-item:focus-visible, .product-row:focus-visible, .cat-toggle:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}

/* ---------- Respect reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .skel::after { animation: none; }
}
