:root {
  --bg: #f5f4ef;
  --surface: #fff;
  --ink: #171916;
  --muted: #73776f;
  --line: #dfdfd7;
  --olive: #4b5340;
  --olive-dark: #343b2c;
  --sage: #dfe4d7;
  --sand: #e9e2d3;
  --danger: #a34c43;
  --shadow: 0 16px 40px rgba(32, 35, 28, 0.12);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
  background: rgba(245, 244, 239, 0.92);
  border-bottom: 1px solid rgba(223, 223, 215, 0.72);
  backdrop-filter: blur(16px);
}
.brand { display: grid; gap: 1px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.brand-mark { font-family: "Prata", serif; font-size: 20px; letter-spacing: .15em; }
.brand-sub { color: var(--muted); font-size: 9px; letter-spacing: .04em; text-transform: uppercase; }
.cart-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 53px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--olive);
  cursor: pointer;
}
.cart-chip svg, .nav-item svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
main { width: min(100%, 980px); margin: 0 auto; }
.view { display: none; padding: 20px 16px 8px; animation: appear .22s ease; }
.view.is-active { display: block; }
@keyframes appear { from { opacity: .35; transform: translateY(5px); } }
.intro { display: grid; gap: 12px; margin-bottom: 20px; }
.intro h1, .section-head h2 { margin: 3px 0 0; font-family: "Prata", serif; font-weight: 400; line-height: 1.16; }
.intro h1 { max-width: 650px; font-size: clamp(29px, 7vw, 46px); }
.intro > p, .section-head > p { max-width: 650px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.eyebrow { margin: 0; color: var(--olive); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.filter-row { display: flex; gap: 8px; margin: 0 -16px 18px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter { flex: 0 0 auto; padding: 9px 15px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.55); cursor: pointer; }
.filter.is-active { color: #fff; border-color: var(--olive); background: var(--olive); }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.product-card { min-width: 0; overflow: hidden; border-radius: 18px; background: var(--surface); box-shadow: 0 5px 16px rgba(38, 42, 32, .055); }
.product-card button { width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.product-visual { position: relative; aspect-ratio: .92; overflow: hidden; background: var(--visual, #e5e3dc); }
.product-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.product-card button:active .product-visual img { transform: scale(1.025); }
.visual-placeholder {
  display: grid;
  height: 100%;
  place-items: center;
  overflow: hidden;
  color: rgba(32,37,28,.7);
  background:
    radial-gradient(circle at 72% 22%, rgba(255,255,255,.86) 0 12%, transparent 13%),
    radial-gradient(circle at 18% 78%, rgba(255,255,255,.5) 0 18%, transparent 19%),
    linear-gradient(145deg, var(--visual-a), var(--visual-b));
}
.visual-placeholder::after { content: "НОТЫ"; font-family: "Prata", serif; font-size: 23px; letter-spacing: .15em; }
.product-body { display: grid; gap: 7px; min-height: 126px; padding: 13px; }
.product-name { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.32; }
.product-direction { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.product-price { align-self: end; margin: 3px 0 0; font-size: 13px; font-weight: 700; }
.wholesale-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 18px 0 10px;
  padding: 20px;
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  background: var(--olive-dark);
  text-align: left;
  cursor: pointer;
}
.wholesale-banner span:first-child { display: grid; gap: 3px; }
.wholesale-banner small { color: #cdd4c5; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.wholesale-banner strong { font-family: "Prata", serif; font-size: 20px; font-weight: 400; }
.wholesale-banner em { max-width: 480px; color: #cdd4c5; font-size: 12px; font-style: normal; line-height: 1.45; }
.circle-arrow { display: grid; flex: 0 0 42px; width: 42px; height: 42px; margin-left: 16px; place-items: center; border-radius: 50%; color: var(--olive-dark); background: #fff; font-size: 21px; }
.section-head { display: grid; gap: 10px; margin: 4px 0 20px; }
.section-head h2 { font-size: clamp(30px, 7vw, 44px); }
.set-hero { overflow: hidden; height: min(52vw, 320px); min-height: 190px; margin-bottom: 14px; border-radius: var(--radius); }
.set-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 52%; }
.set-options { display: grid; gap: 10px; }
.set-option { display: flex; align-items: center; width: 100%; padding: 17px 18px; border: 1px solid transparent; border-radius: 18px; background: var(--surface); text-align: left; cursor: pointer; }
.set-option.is-selected { border-color: var(--olive); box-shadow: inset 0 0 0 1px var(--olive); }
.set-option span { display: grid; gap: 3px; }
.set-option strong { font-size: 15px; }
.set-option small { color: var(--muted); font-size: 12px; }
.set-option b { margin-left: auto; font-size: 16px; }
.set-picker { margin-top: 15px; padding: 18px; border-radius: var(--radius); background: #e9ece3; }
.picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.picker-head h3 { margin: 0; font-family: "Prata", serif; font-size: 21px; font-weight: 400; }
.picker-head span { color: var(--olive); font-size: 12px; font-weight: 700; }
.picker-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 15px; }
.picker-item { display: flex; align-items: center; min-height: 54px; padding: 9px 10px; border: 1px solid rgba(75,83,64,.16); border-radius: 13px; background: rgba(255,255,255,.7); cursor: pointer; }
.picker-item input { width: 18px; height: 18px; margin: 0 8px 0 0; accent-color: var(--olive); }
.picker-item span { font-size: 11px; line-height: 1.25; }
.primary-button { width: 100%; min-height: 52px; padding: 14px 18px; border: 0; border-radius: 15px; color: #fff; background: var(--olive); font-weight: 700; cursor: pointer; }
.primary-button:disabled { opacity: .45; cursor: default; }
.back-button, .text-button { padding: 5px 0; border: 0; color: var(--olive); background: none; font-size: 13px; font-weight: 700; cursor: pointer; }
.back-button { margin-bottom: 18px; }
.order-form { display: grid; gap: 13px; max-width: 640px; padding: 18px; border-radius: var(--radius); background: var(--surface); }
.order-form label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.order-form input, .order-form textarea {
  width: 100%;
  padding: 14px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #fbfbf8;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}
.order-form input:focus, .order-form textarea:focus { border-color: var(--olive); box-shadow: 0 0 0 3px rgba(75,83,64,.1); }
.cart-title { display: flex; align-items: end; justify-content: space-between; }
.cart-list { display: grid; gap: 9px; }
.cart-item { display: grid; grid-template-columns: 60px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: var(--surface); }
.cart-thumb { display: grid; width: 60px; height: 70px; place-items: center; overflow: hidden; border-radius: 11px; background: var(--sage); color: var(--olive); font-family: "Prata", serif; font-size: 10px; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-info { display: grid; gap: 4px; min-width: 0; }
.cart-info strong { font-size: 13px; line-height: 1.3; }
.cart-info small { color: var(--muted); font-size: 11px; }
.qty-control { display: flex; align-items: center; gap: 9px; margin-top: 3px; }
.qty-control button { display: grid; width: 25px; height: 25px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; cursor: pointer; }
.qty-control span { min-width: 10px; font-size: 12px; text-align: center; }
.cart-price { font-size: 13px; white-space: nowrap; }
.cart-summary { margin-top: 12px; padding: 18px; border-radius: var(--radius); background: var(--olive-dark); color: #fff; }
.summary-row { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 9px; color: #d8ddcf; font-size: 12px; }
.summary-row.total { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.18); color: #fff; font-size: 17px; font-weight: 700; }
.checkout { margin-top: 13px; }
.checkout h3 { margin: 0 0 13px; font-family: "Prata", serif; font-size: 23px; font-weight: 400; }
.delivery-note { margin: -2px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.empty-state { display: grid; min-height: 48vh; place-items: center; padding: 30px; text-align: center; }
.empty-state > div { display: grid; gap: 9px; justify-items: center; }
.empty-state .empty-icon { display: grid; width: 80px; height: 80px; place-items: center; border-radius: 50%; color: var(--olive); background: var(--sage); font-family: "Prata", serif; font-size: 25px; }
.empty-state h3 { margin: 8px 0 0; font-family: "Prata", serif; font-size: 25px; font-weight: 400; }
.empty-state p { max-width: 330px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.empty-state button { width: auto; min-width: 200px; margin-top: 8px; }
.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: calc(68px + env(safe-area-inset-bottom));
  padding: 7px 8px env(safe-area-inset-bottom);
  border-top: 1px solid rgba(223,223,215,.9);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(18px);
}
.nav-item { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; padding: 2px; border: 0; color: #8c9088; background: none; font-size: 10px; cursor: pointer; }
.nav-item.is-active { color: var(--olive-dark); }
.nav-item b { position: absolute; top: 1px; left: calc(50% + 6px); display: grid; min-width: 17px; height: 17px; padding: 0 4px; place-items: center; border-radius: 9px; color: #fff; background: var(--olive); font-size: 9px; }
.modal[hidden] { display: none; }
.modal { position: fixed; z-index: 100; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; border: 0; background: rgba(17,20,15,.42); backdrop-filter: blur(3px); }
.modal-sheet { position: relative; width: min(100%, 640px); max-height: 92vh; padding: 0 18px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; border-radius: 26px 26px 0 0; background: var(--bg); box-shadow: var(--shadow); animation: sheetUp .25s ease; }
@keyframes sheetUp { from { transform: translateY(24px); opacity: .5; } }
.sheet-handle { position: sticky; z-index: 2; top: 0; width: 42px; height: 5px; margin: 9px auto; border-radius: 9px; background: #c9cbc4; }
.modal-close { position: absolute; z-index: 3; top: 19px; right: 20px; display: grid; width: 34px; height: 34px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.88); font-size: 25px; line-height: 1; cursor: pointer; }
.modal-visual { height: min(68vw, 370px); margin: 2px 0 18px; overflow: hidden; border-radius: 20px; background: var(--sage); }
.modal-visual img { width: 100%; height: 100%; object-fit: cover; }
.modal-visual .visual-placeholder { min-height: 100%; }
.modal-copy h2 { max-width: 90%; margin: 0 0 6px; font-family: "Prata", serif; font-size: 29px; font-weight: 400; line-height: 1.18; }
.modal-copy > p { margin: 0 0 17px; color: var(--muted); font-size: 13px; }
.notes { display: grid; gap: 10px; margin: 0 0 20px; padding: 15px; border-radius: 16px; background: #fff; }
.note-row { display: grid; grid-template-columns: 76px 1fr; gap: 10px; font-size: 12px; line-height: 1.4; }
.note-row span { color: var(--muted); }
.volume-label { margin: 0 0 9px; font-size: 12px; font-weight: 700; }
.volume-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.volume-button { display: grid; gap: 2px; padding: 12px 7px; border: 1px solid var(--line); border-radius: 13px; background: #fff; text-align: center; cursor: pointer; }
.volume-button small { color: var(--muted); font-size: 10px; }
.volume-button.is-selected { color: #fff; border-color: var(--olive); background: var(--olive); }
.volume-button.is-selected small { color: #e5e9df; }
.toast { position: fixed; z-index: 200; right: 16px; bottom: calc(82px + env(safe-area-inset-bottom)); left: 16px; max-width: 450px; margin: auto; padding: 13px 16px; border-radius: 14px; color: #fff; background: #1f241c; box-shadow: var(--shadow); font-size: 13px; text-align: center; transform: translateY(15px); opacity: 0; pointer-events: none; transition: .22s ease; }
.toast.is-visible { transform: translateY(0); opacity: 1; }
.success-card { display: grid; gap: 10px; justify-items: center; padding: 35px 20px; border-radius: var(--radius); background: var(--surface); text-align: center; }
.success-card .success-icon { display: grid; width: 64px; height: 64px; place-items: center; border-radius: 50%; color: #fff; background: var(--olive); font-size: 28px; }
.success-card h3 { margin: 4px 0 0; font-family: "Prata", serif; font-size: 26px; font-weight: 400; }
.success-card p { max-width: 390px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

@media (min-width: 700px) {
  .topbar { padding-right: 28px; padding-left: 28px; }
  .view { padding-right: 24px; padding-left: 24px; }
  .intro { grid-template-columns: 1.45fr .8fr; align-items: end; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .product-body { min-height: 132px; }
  .filter-row { margin-right: -24px; margin-left: -24px; padding-right: 24px; padding-left: 24px; }
  .bottom-nav { right: 50%; left: 50%; width: min(500px, 100%); transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; }
  .set-options { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
