/* ==========================================================================
   SHOP — product page "B · Шоурум", cart "B · Спокойствие", catalog filters.
   Mockup: claude/mockups/front/shop-pages.html. Loaded by public/shop/assets.php
   on the catalog, product and cart pages (after custom.css → overrides it there).
   Tokens: --font-head / --font-body, radius --r-xs (4) / --r-md (10) / --r-lg (20).
   ========================================================================== */

.shop-page {
	--sb-green: #44b749;
	--sb-green-d: #3a9e3f;
	--sb-green-s: #edf8ee;
	--sb-ink: #14141c;
	--sb-graphite: #14151e;
	--sb-text: #5b5e66;
	--sb-muted: #8a8f98;
	--sb-line: #e6e8eb;
	--sb-paper: #f5f6f4;
	--sb-art: #f1f3f0;
	--sb-red: #c62828;
	--sb-lift: 0 30px 60px -30px rgba(20, 20, 28, .35), 0 0 0 1px var(--sb-line);
	--sb-sticky: 80px; /* below the sticky green menu (56 px) */
}

.shop-page .sb-icon { flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.shop-page .shop-qty input { min-width: 0; padding: 0; }
.shop-page .sb-list { margin: 0; padding: 0; list-style: none; }
.shop-page .sb-list li { margin: 0; padding: 0; }
.shop-page .sb-list li::before { display: none; }

/* placeholder when a product has no photo yet */
.sb-noimage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 100%; color: var(--sb-green-d); }
.sb-noimage svg { width: 34%; max-width: 140px; height: auto; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.sb-noimage span { font-size: 12px; color: var(--sb-muted); }

/* ==========================================================================
   Catalog filters
   ========================================================================== */
.shop-filters { padding: 20px 22px; border-color: var(--sb-line); }
.shop-filters-head { margin-bottom: 4px; }
.shop-filters-head h2 { font-weight: 500; }
.shop-filter { margin: 0; padding: 18px 0; border-bottom: 1px solid var(--sb-line); }
.shop-filter:last-of-type { border-bottom: 0; }
.shop-filter legend { float: left; width: 100%; margin: 0 0 14px 0; font-family: var(--font-head); font-size: 15px; font-weight: 500; color: var(--sb-ink); }
.shop-filter legend + * { clear: both; }
.shop-filter-price input { height: 42px; border-color: var(--sb-line); }
.shop-filter-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.shop-filter-presets button { height: 30px; padding: 0 12px; font-family: var(--font-body); font-size: 13px; color: var(--sb-text); background-color: var(--sb-paper); border: 1px solid transparent; border-radius: var(--r-xs); cursor: pointer; transition: border-color .15s, color .15s; }
.shop-filter-presets button:hover { color: var(--sb-ink); border-color: var(--sb-line); }
.shop-filter-presets button.is-on { color: var(--sb-ink); background-color: #fff; border-color: var(--sb-ink); }

.shop-check { gap: 12px; margin: 0 0 11px 0; font-size: 15px; line-height: 1.35; color: var(--sb-ink); }
.shop-check:last-child { margin-bottom: 0; }
.shop-check input { -webkit-appearance: none; appearance: none; display: grid; place-content: center; flex: 0 0 20px; width: 20px; height: 20px; margin: 0; background-color: #fff; border: 1.5px solid #c9ccd1; border-radius: 5px; cursor: pointer; transition: background-color .15s, border-color .15s; }
.shop-check input::before { content: ''; width: 10px; height: 5px; margin-top: -2px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) scale(0); transition: transform .12s; }
.shop-check input:checked { background-color: var(--sb-green); border-color: var(--sb-green); }
.shop-check input:checked::before { transform: rotate(-45deg) scale(1); }
.shop-check input:focus-visible { outline: 2px solid var(--sb-green); outline-offset: 2px; }
.shop-check:hover input:not(:checked) { border-color: var(--sb-ink); }
.shop-check small { font-size: 12.5px; color: var(--sb-muted); }

.shop-filter-actions { padding-top: 18px; border-top: 1px solid var(--sb-line); }
.shop-filter-actions .shop-button { flex: 1 1 auto; }

.shop-filters-help { margin-top: 18px; padding: 16px; font-size: 13.5px; line-height: 1.5; color: #c9ccd1; background-color: var(--sb-graphite); border-radius: var(--r-md); }
.shop-filters-help b { display: block; margin: 0 0 4px 0; font-family: var(--font-head); font-size: 15px; font-weight: 500; color: #fff; }
.shop-filters-help a { display: inline-block; margin-top: 10px; font-family: var(--font-head); font-size: 18px; font-weight: 600; color: #9be09e; text-decoration: none; }
.shop-filters-help a:hover { color: #fff; }

/* ==========================================================================
   Product page — "B · Шоурум"
   ========================================================================== */
.pb-top { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 40px; align-items: start; }

/* stage */
.pb-stage { position: relative; }
.pb .shop-gallery-main { aspect-ratio: 1 / .78; overflow: hidden; background-color: var(--sb-art); border-radius: var(--r-lg); }
.pb .shop-gallery-main img { padding: 4%; }
.pb .shop-badges { left: 16px; top: 16px; }
.pb-cap { position: absolute; left: 16px; bottom: 16px; z-index: 2; padding: 6px 10px; font-size: 12.5px; color: var(--sb-ink); background-color: rgba(255, 255, 255, .92); border-radius: var(--r-xs); pointer-events: none; }
.pb-zoom { position: absolute; right: 16px; bottom: 16px; z-index: 2; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; color: var(--sb-ink); background-color: #fff; border-radius: 50%; box-shadow: 0 4px 14px rgba(20, 20, 28, .12); pointer-events: none; }
.pb-zoom svg { width: 18px; height: 18px; }
.pb-dots { display: flex; gap: 8px; margin-top: 12px; }
.pb .pb-dots .shop-gallery-thumb { flex: 1 1 0; height: 6px; aspect-ratio: auto; padding: 0; background-color: var(--sb-line); border: 0; border-radius: 6px; cursor: pointer; transition: background-color .2s; }
.pb .pb-dots .shop-gallery-thumb:hover { background-color: #c9ccd1; }
.pb .pb-dots .shop-gallery-thumb.is-active { background-color: var(--sb-ink); }

/* buy card */
.pb-card { position: sticky; top: var(--sb-sticky); padding: 28px; background-color: #fff; border-radius: var(--r-lg); box-shadow: var(--sb-lift); }
.pb-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; margin: 0 0 12px 0; font-size: 13px; color: var(--sb-muted); }
.pb-meta a { color: var(--sb-green-d); text-decoration: none; }
.pb-meta a:hover { color: var(--sb-ink); }
.pb-name { margin: 0 0 10px 0; font-family: var(--font-head); font-size: 30px; font-weight: 500; line-height: 1.15; color: var(--sb-ink); }
.pb-resume { margin: 0 0 18px 0; font-size: 15px; line-height: 1.6; color: var(--sb-text); }
.pb-resume p { margin: 0; }
.pb-resume p + p { margin-top: 8px; }
.pb-card .shop-price { gap: 2px 10px; }
.pb-card .shop-price-current { font-size: 32px; font-weight: 600; }
.pb-card .shop-price-note { font-size: 13px; color: var(--sb-muted); }
.pb-card .shop-price-alt { font-size: 13px; color: var(--sb-muted); }
.pb-unit { font-size: 13px; color: var(--sb-muted); }
.pb .shop-add { flex-wrap: nowrap; gap: 10px; margin-top: 22px; }
.pb .shop-add .shop-qty { flex: 0 0 auto; height: 54px; }
.pb .shop-add-button { flex: 1 1 auto; height: 54px; padding: 0 20px; font-size: 16px; }
.pb-ask { margin: 14px 0 0 0; font-size: 14px; color: var(--sb-text); }
.pb-ask a { font-family: var(--font-head); font-weight: 500; color: var(--sb-green-d); text-decoration: none; white-space: nowrap; }
.pb-ask a:hover { color: var(--sb-ink); }
.pb-assure { display: grid; gap: 9px; margin-top: 18px !important; padding-top: 18px !important; font-size: 13.5px; color: var(--sb-text); border-top: 1px solid var(--sb-line); }
.pb-assure li { display: flex; align-items: center; gap: 10px; }
.pb-assure svg { width: 18px; height: 18px; color: var(--sb-green-d); stroke-width: 2; }

/* story: description + attributes with a sticky contents list */
.pb-story { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 56px; margin-top: 72px; padding-top: 56px; border-top: 1px solid var(--sb-line); }
.pb-story.is-single { grid-template-columns: minmax(0, 1fr); }
.pb-nav { position: sticky; top: var(--sb-sticky); align-self: start; }
.pb-nav a { display: block; padding: 10px 0 10px 16px; font-family: var(--font-head); font-size: 15px; font-weight: 500; color: var(--sb-text); text-decoration: none; border-left: 2px solid var(--sb-line); transition: color .15s, border-color .15s; }
.pb-nav a:hover { color: var(--sb-ink); }
.pb-nav a.is-on { color: var(--sb-ink); border-color: var(--sb-green); }
.pb-body > section { scroll-margin-top: calc(var(--sb-sticky) + 10px); }
.pb-body > section + section { margin-top: 48px; }
.pb-body h2 { margin: 0 0 14px 0; font-family: var(--font-head); font-size: 24px; font-weight: 500; color: var(--sb-ink); }
.pb-content { max-width: 72ch; font-size: 15px; line-height: 1.75; color: var(--sb-text); }
.pb .shop-attributes { max-width: none; border-collapse: separate; border-spacing: 0; overflow: hidden; border-radius: var(--r-md); }
.pb .shop-attributes th, .pb .shop-attributes td { padding: 12px 16px; font-size: 14.5px; border: 0; }
.pb .shop-attributes tr:nth-child(odd) th, .pb .shop-attributes tr:nth-child(odd) td { background-color: var(--sb-paper); }
.pb .shop-attributes th { width: 38%; font-weight: 400; color: var(--sb-muted); background-color: transparent; }
.pb .shop-attributes td { color: var(--sb-ink); }

.pb-related { margin-top: 72px; }
.pb-related h2 { margin: 0 0 22px 0; font-family: var(--font-head); font-size: 26px; font-weight: 500; color: var(--sb-ink); }

.pb-mbar { display: none; }

/* ==========================================================================
   Cart — "B · Спокойствие"
   ========================================================================== */
.cb { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: start; }
.cb-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 6px 0; }
.cb-title h2 { margin: 0; font-family: var(--font-head); font-size: 30px; font-weight: 500; line-height: 1.2; color: var(--sb-ink); }
.cb-title span { font-size: 15px; color: var(--sb-muted); }
.cb-lead { margin: 0 0 24px 0; font-size: 15px; color: var(--sb-text); }

.cb-free { margin: 0 0 26px 0; padding: 16px 18px; background-color: var(--sb-green-s); border-radius: var(--r-md); }
.cb-free p { display: flex; align-items: center; gap: 10px; margin: 0 0 10px 0; font-size: 15px; color: var(--sb-ink); }
.cb-free svg { width: 22px; height: 22px; color: var(--sb-green-d); }
.cb-bar { height: 6px; overflow: hidden; background-color: #d4ebd6; border-radius: 6px; }
.cb-bar span { display: block; height: 100%; background-color: var(--sb-green); border-radius: 6px; transition: width .3s; }

.cb-undo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 18px 0; padding: 14px 16px; font-size: 14px; color: var(--sb-ink); background-color: var(--sb-paper); border-radius: var(--r-md); }
.cb-undo[hidden] { display: none; }
.cb-undo button { padding: 0; font-family: var(--font-head); font-size: 14px; font-weight: 500; color: var(--sb-green-d); background: none; border: 0; cursor: pointer; }
.cb-undo button:hover { color: var(--sb-ink); }

.cb-items { border-top: 1px solid var(--sb-line); }
.cb-item { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--sb-line); transition: opacity .2s; }
.cb-image { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; overflow: hidden; background-color: var(--sb-art); border-radius: var(--r-md); }
.cb-image img { width: 100%; height: 100%; padding: 6%; object-fit: contain; }
.cb-image .sb-noimage svg { width: 46%; stroke-width: 2; }
.cb-image .sb-noimage span { display: none; }
.cb-name { font-family: var(--font-head); font-size: 17px; font-weight: 500; line-height: 1.3; color: var(--sb-ink); text-decoration: none; }
.cb-name:hover { color: var(--sb-green-d); }
.cb-sku { display: block; margin-top: 2px; font-size: 13px; color: var(--sb-muted); }
.cb-qty { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.cb-qty .shop-qty { height: 40px; }
.cb-qty .shop-qty button { width: 36px; }
.cb-qty .shop-qty input { flex-basis: 48px; width: 48px; max-width: 48px; }
.cb-each { font-size: 13px; color: var(--sb-muted); }
.cb-each del { margin-left: 6px; }
.cb-item-r { text-align: right; }
.cb-line { display: block; font-family: var(--font-head); font-size: 19px; font-weight: 600; color: var(--sb-ink); white-space: nowrap; }
.cb-remove { display: inline-block; margin-top: 10px; padding: 0; font-size: 13px; color: var(--sb-muted); background: none; border: 0; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
.cb-remove:hover { color: var(--sb-red); text-decoration-color: currentColor; }

.cb-install { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; margin-top: 28px; padding: 22px 24px; font-size: 14.5px; line-height: 1.5; color: #c9ccd1; background-color: var(--sb-graphite); border-radius: var(--r-md); }
.cb-install > svg { width: 40px; height: 40px; color: #9be09e; stroke-width: 1.6; }
.cb-install b { display: block; margin: 0 0 4px 0; font-family: var(--font-head); font-size: 17px; font-weight: 500; color: #fff; }
.cb-install .shop-button { white-space: nowrap; }
.cb-install .shop-button:hover { color: var(--sb-ink); background-color: #fff; }

.cb-side { position: sticky; top: var(--sb-sticky); display: grid; gap: 16px; }
.cb-card { padding: 26px; background-color: #fff; border-radius: var(--r-lg); box-shadow: var(--sb-lift); }
.cb-card h3 { margin: 0 0 12px 0; font-family: var(--font-head); font-size: 20px; font-weight: 500; color: var(--sb-ink); }
.cb-card dl { margin: 0; }
.cb-card dl div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 7px 0; font-size: 15px; }
.cb-card dt { font-weight: 400; color: var(--sb-text); }
.cb-card dd { margin: 0; font-family: var(--font-head); font-weight: 500; text-align: right; color: var(--sb-ink); }
.cb-card dd.is-soft { font-family: var(--font-body); font-size: 13.5px; font-weight: 400; color: var(--sb-muted); }
.cb-card .cb-total { margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--sb-line); }
.cb-card .cb-total dt { font-family: var(--font-head); font-size: 16px; font-weight: 500; color: var(--sb-ink); }
.cb-card .cb-total dd { font-size: 28px; font-weight: 600; }
.cb-vat { margin: 4px 0 18px 0; font-size: 13px; color: var(--sb-muted); }
.cb-card .shop-button { width: 100%; height: 54px; font-size: 16px; }
.cb-continue { display: block; margin-top: 14px; font-size: 14px; text-align: center; color: var(--sb-green-d); text-decoration: none; }
.cb-continue:hover { color: var(--sb-ink); }

.cb-help { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; padding: 20px; background-color: #fff; border: 1px solid var(--sb-line); border-radius: var(--r-md); }
.cb-help-ic { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; color: var(--sb-green-d); background-color: var(--sb-green-s); border-radius: 50%; }
.cb-help-ic svg { width: 24px; height: 24px; }
.cb-help b { display: block; font-family: var(--font-head); font-size: 15.5px; font-weight: 500; color: var(--sb-ink); }
.cb-help small { display: block; font-size: 13px; color: var(--sb-muted); }
.cb-tel { display: inline-block; margin-top: 6px; font-family: var(--font-head); font-size: 20px; font-weight: 600; color: var(--sb-ink); text-decoration: none; }
.cb-tel:hover { color: var(--sb-green-d); }
.cb-mail { display: block; margin-top: 6px; font-size: 14px; color: var(--sb-green-d); text-decoration: none; word-break: break-all; }

.cb-empty { padding: 64px 24px; text-align: center; background-color: var(--sb-paper); border-radius: var(--r-lg); }
.cb-empty h2 { margin: 0 0 10px 0; font-family: var(--font-head); font-size: 30px; font-weight: 500; color: var(--sb-ink); }
.cb-empty p { max-width: 46ch; margin: 0 auto 24px auto; font-size: 15px; color: var(--sb-text); }
.cb-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.cb-empty-actions .is-ghost { color: var(--sb-ink); background-color: #fff; border: 1px solid var(--sb-line); }
.cb-empty-actions .is-ghost:hover { color: #fff; background-color: var(--sb-ink); border-color: var(--sb-ink); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1040px) {
	.pb-top, .pb-story, .cb { grid-template-columns: minmax(0, 1fr); }
	.pb-card, .cb-side { position: static; }
	.pb-nav { display: none; }
	.pb-story { gap: 0; margin-top: 48px; padding-top: 40px; }
	.pb-mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; align-items: center; gap: 14px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background-color: #fff; border-top: 1px solid var(--sb-line); box-shadow: 0 -8px 24px rgba(20, 20, 28, .08); transform: translateY(110%); transition: transform .25s; }
	.pb-mbar.is-on { transform: none; }
	.pb-mbar .shop-price-current { font-size: 20px; }
	.pb-mbar .shop-price-note, .pb-mbar .shop-price-alt { display: none; }
	.pb-mbar .shop-button { margin-left: auto; }
}

@media (max-width: 640px) {
	.pb-name { font-size: 24px; }
	.pb-card { padding: 20px; }
	.pb-card .shop-price-current { font-size: 28px; }
	.pb .shop-add .shop-qty { height: 50px; }
	.pb .shop-add-button { height: 50px; }
	.pb .shop-gallery-main { aspect-ratio: 1 / .86; }

	.cb-title h2 { font-size: 24px; }
	.cb-item { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; }
	.cb-item-r { grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; }
	.cb-remove { margin-top: 0; }
	.cb-install { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 20px; }
	.cb-install > svg { display: none; }
	.cb-card { padding: 20px; }
	.cb-empty { padding: 44px 18px; }
	.cb-empty h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
	.pb-mbar, .cb-bar span, .cb-item, .shop-check input::before { transition: none; }
}
