@font-face {font-family:Golos;src:url("assets/fonts/Golos-Text-catalog.woff2") format("woff2");font-weight:400 900;font-display:swap}
@font-face {font-family:Literata;src:url("assets/fonts/Literata-catalog.woff2") format("woff2");font-weight:600;font-display:swap}
@font-face {font-family:Golos;src:url("assets/fonts/Golos-Text-shop.woff2") format("woff2");font-weight:400 900;font-display:swap;unicode-range:U+00C0-00D6,U+00D8-00F6,U+00F8-00FF,U+0460-048F,U+0492-052F}
@font-face {font-family:Literata;src:url("assets/fonts/Literata-shop.woff2") format("woff2");font-weight:600;font-display:swap;unicode-range:U+00C0-00D6,U+00D8-00F6,U+00F8-00FF,U+0460-048F,U+0492-052F}

:root {
  --paper:#fffdf9; --cream:#f3eee6; --white:#fff; --ink:#352b25;
  --muted:#695e55; --berry:#650d2b; --line:#e3dcd2;
  background:var(--paper); color:var(--ink); font:18px/1.5 Golos,Arial,sans-serif;
}
* {box-sizing:border-box}
body {margin:0}
button, input, select {font:inherit;color:inherit}
button {cursor:pointer}
button:disabled {cursor:default}
button, a, select, input, label:has(input) {touch-action:manipulation}
a {color:inherit;text-underline-offset:3px}
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline:3px solid var(--berry); outline-offset:4px;
}
h1, h2, h3, p, figure {margin:0}
h1, h2, h3, .brand {font-family:Literata,Georgia,serif;font-weight:600}
h1 {font-size:clamp(31px,3vw,43px);line-height:1.16;letter-spacing:-.045em;overflow-wrap:anywhere}
h2 {font-size:clamp(23px,2vw,29px);line-height:1.22;letter-spacing:-.035em}
[hidden] {display:none!important}
.wrap {width:calc(100% - clamp(36px,8vw,112px));max-width:1160px;margin-inline:auto}
.arrow-icon {width:19px;height:19px;flex:none}
.visually-hidden {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.skip {position:fixed;z-index:5;top:8px;left:14px;padding:8px 14px;transform:translateY(-180%);pointer-events:none;background:var(--white)}
.skip:not([tabindex]):focus {transform:none;pointer-events:auto}
main:focus, h1[tabindex="-1"]:focus {outline:none}

.site-head {border-bottom:1px solid var(--line);background:var(--paper)}
.head-inner, .head-actions, .brand, .bag-link {display:flex;align-items:center}
.head-inner {min-height:74px;justify-content:space-between;gap:16px}
.brand {color:var(--ink);text-decoration:none;gap:8px;line-height:1.1;font-size:clamp(21px,2.05vw,27px);letter-spacing:-.045em}
.brand img {display:block;width:44px;height:44px;flex:none}
.head-actions {gap:clamp(14px,2.5vw,36px);font-size:17px}
.contact-trigger {padding:8px 0;border:0;min-height:44px;background:none;color:var(--muted)}
.contact-trigger:hover, .footer-links a:hover {color:var(--berry);text-decoration:underline}
.bag-link {min-height:44px;gap:7px;color:var(--ink);text-decoration:none;font-weight:550}
.bag-link:hover {color:var(--berry)}
#bag-count {min-width:22px;padding:1px 5px;border-radius:30px;background:var(--berry);color:white;text-align:center;font-size:14px}

.contacts-dialog {
  --dialog-inset:clamp(18px, 4vw, 30px);
  color:var(--ink);background:var(--paper);border:0;border-radius:16px;
  width:min(456px,calc(100% - 28px));padding:0;
  box-shadow:0 12px 60px #392b2333;max-height:calc(100dvh - 28px);overflow:hidden;
}
.contacts-dialog[open] {display:flex;flex-direction:column}
.contacts-dialog::backdrop {background:rgb(45 36 30 / .32)}
#contacts-title:focus {outline:none}
.contacts-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:14px var(--dialog-inset) 8px}
.contact-close {min-height:44px;padding:7px 0 7px 8px;border:0;background:none;color:var(--muted);font-size:16px;text-decoration:underline;text-underline-offset:3px}
.contacts-body {overflow-y:auto;overscroll-behavior:contain;padding:4px var(--dialog-inset) 22px}
.contacts-body h3 {margin:8px 0 2px;font:600 18px/1.4 Golos,Arial,sans-serif;color:var(--ink)}
.contact-links, .channel-links {display:grid}
.contact-links a, .channel-links a {display:flex;gap:8px;justify-content:space-between;align-items:center;min-height:48px;padding:8px 2px;color:var(--ink);text-decoration:none}
.contact-links a+a {border-top:1px solid var(--line)}
.contacts-body a span {font-size:15px;color:var(--muted)}
.contacts-body a:hover, .contact-close:hover {color:var(--berry);text-decoration:underline}
.contacts-body a:focus-visible {outline-offset:-2px;border-radius:4px}
#channel-links-title {margin-top:18px;border-top:1px solid var(--line);padding-top:16px}
.channel-links {grid-template-columns:1fr 1fr;column-gap:26px}
#shop-footer {border-top:1px solid var(--line)}
.foot-inner,.footer-links {display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.foot-inner {justify-content:space-between;padding:18px 0 24px;font-size:15px;color:var(--muted)}
.footer-links a {display:inline-flex;align-items:center;min-height:44px;text-decoration:underline}

.primary, .secondary {
  display:inline-flex;align-items:center;justify-content:center;gap:12px;min-height:50px;padding:12px 20px;
  border-radius:9px;font-size:18px;font-weight:600;line-height:1.3;text-decoration:none;
}
.primary {border:1px solid var(--berry);background:var(--berry);color:#fffaf7}
.primary:hover:enabled, a.primary:hover {background:#500c24}
.primary:disabled {background:#eeeae4;color:#696058;border-color:#eeeae4}
.secondary {border:1px solid #baaea3;background:transparent}
.secondary:hover {background:var(--cream)}
.wide {width:100%}
.back {display:inline-flex;gap:8px;align-items:center;min-height:44px;margin:16px 0 12px;color:var(--muted);text-decoration:none;font-size:16px}
.back:hover, .remove:hover, .return-shopping:hover {color:var(--berry);text-decoration:underline}
.catalog-back {min-height:48px;padding:9px 16px;border:1px solid #c8b9ae;border-radius:9px;color:var(--berry);font-weight:600}
.catalog-back:hover {background:var(--cream);text-decoration:none;border-color:var(--berry)}
.quiet, .hint, .demo-hint {color:var(--muted)}
.hint, .demo-hint {margin:8px 0 16px;font-size:17px}
.notice {margin:12px 0;padding:10px 14px;border-left:3px solid var(--berry);background:var(--cream);font-size:17px}

.detail {
  display:grid;grid-template-columns:minmax(0,1.04fr) minmax(0,1fr);grid-template-rows:auto 1fr;
  grid-template-areas:"gallery heading" "gallery choices";align-items:start;
  gap:26px clamp(30px,5vw,76px);padding-bottom:44px;
}
.detail-heading {grid-area:heading;min-width:0}
.detail-meta {display:flex;gap:6px 12px;align-items:baseline;flex-wrap:wrap;margin-top:9px;color:var(--muted);font-size:18px;overflow-wrap:anywhere}
.detail-meta span+span::before {content:"·";margin-right:12px;color:var(--muted)}
.product-gallery {grid-area:gallery;min-width:0}
.detail-photo {display:block;width:100%;padding:0;border:0;border-radius:10px;overflow:hidden;background:var(--cream);aspect-ratio:1.18}
.detail-photo img {display:block;width:100%;height:100%;object-fit:cover;-webkit-user-drag:none}
.detail-photo.artwork img {object-fit:contain}
.product-gallery:has(.photo-nav) .detail-photo {touch-action:pan-y pinch-zoom;user-select:none;-webkit-user-select:none}
.photo-nav {display:flex;align-items:center;justify-content:center;gap:8px;margin-top:4px}
.photo-nav button {display:inline-grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:transparent;color:var(--ink)}
.photo-nav button:hover {background:var(--cream)}
.photo-count {min-width:82px;text-align:center;color:var(--muted);font-size:16px;font-variant-numeric:tabular-nums}
.detail-choice {grid-area:choices;min-width:0}
.detail-choice h2 {font:600 23px/1.3 Golos,Arial,sans-serif;letter-spacing:-.03em;margin:0 0 14px}
.weight-columns, .weight {display:flex;align-items:center}
.weight-columns {justify-content:space-between;padding:0 10px 7px 0;color:var(--muted);font-size:16px}
.weights {border:0;margin:0;padding:0;min-width:0}
.weight {
  gap:12px;min-height:54px;padding:10px 10px 10px 4px;border-top:1px solid var(--line);cursor:pointer;
}
.weight:last-child {border-bottom:1px solid var(--line)}
.weight:hover {background:#f8f5ef}
.weight:has(input:checked) {background:#f7eef0}
.weight input {width:22px;height:22px;flex:none;margin:0;accent-color:var(--berry)}
.weight strong,.amount {font-weight:550;font-size:19px;font-variant-numeric:tabular-nums}
.weight small {margin-left:8px;font-size:15px;color:var(--muted)}
.weight .amount {margin-left:auto;white-space:nowrap}
#choice-summary {margin-top:20px}
#add {gap:14px;flex-wrap:wrap}
#add.confirmed {background:#edf2ea;border-color:#cbd8c6;color:#30492b}
#add.confirmed #add-label::before {content:"✓";margin-right:8px}
#chosen-total {padding-left:14px;border-left:1px solid #ffffff66;font-variant-numeric:tabular-nums}
.panel, .checkout {max-width:660px;margin:0 auto;padding-bottom:44px}
.order-panel, .done-panel {padding-top:clamp(25px,4vw,52px)}
.panel h1, .checkout h1 {margin:0 0 19px}
.empty {padding:8px 0}
.empty .primary {margin-top:14px}
.order-list {border-top:1px solid var(--line)}
.order-item {display:flex;align-items:center;gap:16px;padding:14px 0;border-bottom:1px solid var(--line)}
.order-item img {width:68px;height:68px;object-fit:cover;border-radius:7px}
.order-fabric {display:flex;align-items:center;gap:16px;min-width:0;flex:1;text-decoration:none;border-radius:7px}
.order-fabric strong {text-decoration:underline;text-decoration-color:#b6a798;text-decoration-thickness:1px}
.order-fabric:hover strong {color:var(--berry);text-decoration-color:currentColor}
.order-size {display:block;color:var(--muted);font-size:.94rem}
.line-main {flex:1;min-width:0;overflow-wrap:anywhere}
.order-item strong,.order-item span {display:block}
.order-item .quiet {font-size:16px}
.line-end {text-align:right}
.line-end strong {white-space:nowrap;font-variant-numeric:tabular-nums}
.remove,.return-shopping {color:var(--muted);background:none;border:0}
.remove {padding:5px 0;min-height:44px;font-size:16px;text-decoration:underline}
.selection,.panel-actions {display:flex;justify-content:space-between;align-items:center;gap:14px}
.selection {margin:17px 0 20px}
.selection strong {font-size:23px;white-space:nowrap}
.return-shopping {padding-inline:0;font-size:17px;font-weight:500;text-decoration:underline}
.return-shopping:hover {background:transparent}
.checkout form {display:grid;gap:16px}
.checkout label {display:grid;gap:6px;font-weight:500}
.checkout input {width:100%;min-height:50px;border:1px solid #aa9e93;border-radius:8px;padding:10px 13px;background:var(--white)}
.checkout .quiet {font-size:16px}
.checkout #payment-error {color:var(--berry)}
.help-steps {display:grid;gap:16px;margin:0 0 24px;padding-left:1.4em}
.help-steps h2 {font:600 21px/1.35 Golos,Arial,sans-serif;letter-spacing:-.02em}
.help-steps p {color:var(--muted);margin-top:2px}
@media(max-width:740px) {
  .wrap {width:auto;margin-inline:max(18px,env(safe-area-inset-left)) max(18px,env(safe-area-inset-right))}
  .site-head {padding-top:env(safe-area-inset-top)}
  .head-inner {min-height:62px;gap:2px 10px;flex-wrap:wrap}
  .brand {font-size:21px;gap:4px;min-height:48px}
  .brand img {width:37px;height:37px}
  .head-actions {gap:10px;font-size:16px;margin-left:auto}
  .bag-link {gap:5px;padding:5px 9px;border:1px solid var(--line);border-radius:9px;color:var(--berry)}
  .footer-links {flex-wrap:wrap}
  .back {margin:7px 0 8px}
  .detail {grid-template-columns:minmax(0,1fr);grid-template-rows:auto;grid-template-areas:"heading" "gallery" "choices";gap:16px}
  .detail-heading h1 {font-size:clamp(26px,5.9vw,34px);letter-spacing:-.04em}
  .detail-meta {font-size:17px;margin-top:4px}
  .detail-photo {aspect-ratio:2.1;max-height:310px}
  .photo-nav {margin:0}
  .detail-choice h2 {margin-bottom:8px;font-size:22px}
  .weight {min-height:51px}
  #choice-summary.has-choice {position:sticky;bottom:0;z-index:1;background:var(--paper);padding:8px 0 max(8px,env(safe-area-inset-bottom))}
  .weights input {scroll-margin-bottom:70px}
  .foot-inner {gap:3px;padding-block:14px max(18px,env(safe-area-inset-bottom))}
}
@media(max-width:540px) {
  .bag-link {position:relative}
  #bag-count {position:absolute;top:-5px;right:-4px;min-width:20px;padding:0 4px;border-radius:12px;font-size:13px;line-height:19px;box-shadow:0 0 0 2px var(--paper)}
  .footer-links {gap:18px}
  .foot-inner {align-items:flex-start;flex-direction:column}
  .order-item {gap:10px}
  .order-item img {width:48px;height:55px}
  .line-main strong,.line-end strong {font-size:17px}
  .panel-actions {flex-direction:column-reverse;align-items:stretch;gap:2px}
}
@media(max-width:460px) {
  .brand span {max-width:94px}
  .brand img {width:34px;height:34px}
  .brand {font-size:20px}
}
@media(max-width:365px) {
  .wrap {margin-inline:max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-right))}
  .head-inner {gap:6px}
  .head-actions {gap:9px;font-size:15px}
  .brand span {max-width:76px}
  .brand {font-size:18px}
  .brand img {width:30px;height:30px}
  .bag-link {padding-inline:5px;gap:4px}
  .bag-link svg {width:17px;height:19px;flex:none}
  .weight small {display:block;margin:0}
}
@media (max-width:740px) and (min-height:520px) {
  body:has(#catalog:not([hidden])) .site-head {position:sticky;top:0;z-index:3}
  #catalog :is(a,button) {scroll-margin-top:calc(78px + env(safe-area-inset-top))}
}
@media (max-width:960px) and (orientation:landscape) and (pointer:coarse) {
  .wrap {width:auto;margin-inline:max(24px,env(safe-area-inset-left)) max(24px,env(safe-area-inset-right))}
}

.detail-continue {display:none}
html:has(.photo-viewer[open]) {overflow:hidden}
.photo-viewer:not([open]) {display:none}
.photo-viewer[open] {
  position:fixed;inset:0;margin:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;
  width:100%;max-width:none;height:100vh;height:100dvh;max-height:none;padding:0;border:0;
  background:var(--cream);color:var(--ink);overflow:hidden;
}
.photo-viewer::backdrop {background:var(--cream)}
.photo-viewer-head,.photo-view-nav {
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  background:var(--paper);padding:5px max(14px,env(safe-area-inset-right)) 5px max(14px,env(safe-area-inset-left));
}
.photo-viewer-head {padding-top:max(5px,env(safe-area-inset-top));border-bottom:1px solid var(--line)}
.photo-viewer-head h2 {font:600 20px/1.25 Golos,Arial,sans-serif;letter-spacing:-.03em}
.photo-close {
  display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:7px 10px;
  border:1px solid #b6a798;border-radius:8px;background:var(--paper);color:var(--ink);
  font-size:16px;font-weight:550;line-height:1.2;
}
.photo-view-nav {justify-content:center;gap:8px;border-top:1px solid var(--line);padding-bottom:max(5px,env(safe-area-inset-bottom))}
.photo-view-nav button {
  display:inline-grid;place-items:center;width:44px;height:44px;border:0;border-radius:8px;
  background:transparent;color:var(--ink);
}
.photo-view-count {text-align:center;font-size:15px;color:var(--muted);font-variant-numeric:tabular-nums}
.photo-stage {min-width:0;min-height:0;overflow:hidden;overscroll-behavior:contain;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.photo-stage img {display:block;width:100%;height:100%;object-fit:contain;transform-origin:center;pointer-events:none;-webkit-user-drag:none}

@media(max-width:740px),(max-width:950px) and (max-height:500px) and (pointer:coarse) {
  .detail {padding-bottom:max(20px,env(safe-area-inset-bottom))}
  .catalog-back {margin-block:6px 10px;min-height:46px}
  .detail-photo {aspect-ratio:1.75;max-height:min(52svh,360px)}
  .detail-photo.artwork {aspect-ratio:1.35}
  .photo-nav {gap:6px;margin-top:2px}
  .photo-count,.photo-view-count {min-width:0;font-size:15px;white-space:nowrap}
  .photo-nav button {flex:none}
  .detail-choice h2 {margin-bottom:10px}
  .weight-columns {padding:0 9px 6px}
  .weight {position:relative;min-height:59px;padding:9px 10px;gap:10px}
  .weight input {width:23px;height:23px}
  .weight small {display:block;margin:0}
  .weight .piece-in-bag:not([hidden]) {
    position:absolute;right:10px;bottom:7px;font-size:14px;line-height:1.1;
  }
  .weight:has(.piece-in-bag:not([hidden])) .amount {transform:translateY(-8px)}
  .weight strong,.weight .amount {font-size:19px}
  .weights input {scroll-margin-bottom:84px}
  #choice-summary {
    display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:stretch;gap:8px;
    margin-top:12px;padding:8px 0 max(8px,env(safe-area-inset-bottom));background:var(--paper);
  }
  #choice-summary.has-choice {position:sticky;bottom:0;z-index:1;box-shadow:0 -1px var(--line)}
  #add {
    display:flex;flex-direction:column;flex-wrap:nowrap;min-height:52px;min-width:0;
    gap:1px;padding:6px 8px;font-size:17px;line-height:1.25;
  }
  #add #chosen-total {border:0;padding:0;font-size:15px;font-weight:500}
  #add.confirmed {min-height:max(52px,var(--confirmed-button-height, 0px))}
  .detail-continue {
    display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:8px;
    border:1px solid #c0b3a5;border-radius:9px;color:var(--ink);font-size:16px;
    font-weight:550;line-height:1.25;text-decoration:none;
  }
}
