@import url('https://fonts.googleapis.com/css2?family=Literata:opsz,wght@7..72,600;7..72,700&family=Golos+Text:wght@400;500;600;700&display=swap');

:root {
  --paper: #f5f2e8;
  --white: #fcfaf3;
  --ink: #232a22;
  --blue: #315441;
  --muted: #66685d;
  --line: #cac7b8;
  --display: 'Literata', Georgia, serif;
  --body: 'Golos Text', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--body); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--display); }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 84px; border-bottom: 1px solid var(--ink); }
.logo { font: 500 23px/1 var(--body); letter-spacing: -.035em; }
.logo span { color: var(--blue); }
nav { display: flex; gap: 32px; font-size: 14px; }
nav a:hover { text-decoration: underline; }
.bag { border-bottom: 1px solid var(--ink); padding: 5px 0; font-size: 14px; font-weight: 500; white-space: nowrap; }
.bag span { margin-left: 8px; font-variant-numeric: tabular-nums; color: var(--blue); }
.intro { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; padding: 32px 0 27px; border-bottom: 1px solid var(--ink); }
h1 { font: 500 clamp(28px, 4vw, 48px)/1.12 var(--body); letter-spacing: -.045em; text-wrap: balance; }
.intro p { margin-top: 11px; color: var(--muted); max-width: 490px; }
.intro-meta { display: flex; gap: 24px; padding-bottom: 4px; }
.intro-meta div { padding-left: 13px; border-left: 1px solid var(--line); }
.intro-meta strong, .intro-meta span { display: block; }
.intro-meta strong { color: var(--blue); font-size: 16px; font-weight: 500; }
.intro-meta span { color: var(--muted); font-size: 13px; margin-top: 5px; }
.shop-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(305px, 365px); gap: 48px; align-items: start; margin-top: 32px; }
.catalog-heading, .order-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.catalog-heading span, .order-title span { color: var(--muted); font-size: 13px; text-align: right; }
h2 { font: 500 22px/1.25 var(--body); letter-spacing: -.025em; }
.tabs { display: flex; gap: 20px; margin-top: 12px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; border-bottom: 2px solid transparent; padding: 9px 1px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 400; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--blue); }
.product { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 14px; min-height: 74px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.subject-icon { display: grid; place-items: center; width: 36px; height: 36px; background: #e4e8db; color: var(--blue); font: 500 17px/1 Georgia, serif; }
.product h3 { font-size: 16px; font-weight: 500; }
.product .product-link { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.product p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.product-bottom { display: grid; grid-template-columns: 82px 96px; gap: 9px; align-items: center; }
.price, .stepper { font-variant-numeric: tabular-nums; font-weight: 500; }
.price span { font-size: 11px; font-weight: 500; }
.add, .stepper button { color: var(--blue); background: transparent; border: 1px solid var(--blue); padding: 6px 8px; min-height: 38px; font-size: 13px; font-weight: 500; }
.add:hover, .stepper button:hover:not(:disabled) { color: var(--white); background: var(--blue); }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 3px; }
.stepper button { min-width: 32px; font-size: 16px; }
.order { background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--blue); padding: 24px; }
.order-title { margin-bottom: 14px; }
.empty { padding: 10px 0 14px; color: var(--muted); font-size: 14px; }
.order-line, .totals > div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.order-line { padding: 7px 0; border-bottom: 1px solid var(--line); }
.order-line small { display: block; color: var(--muted); }
.order-line > div:last-child { white-space: nowrap; }
.remove { background: transparent; border: 0; padding: 0 0 0 7px; color: var(--muted); font-size: 18px; }
.totals { margin: 10px 0 14px; }
.totals > div { padding: 4px 0; }
.totals strong, #detail-body strong { font-weight: 500; }
.totals .grand-total { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 17px; }
form#order-form { border-top: 1px solid var(--line); padding-top: 15px; }
form h3 { margin-bottom: 10px; font-size: 16px; font-weight: 500; }
label { display: block; margin-bottom: 11px; font-size: 13px; font-weight: 400; }
input, textarea { display: block; width: 100%; padding: 9px; margin-top: 4px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 0; font-size: 16px; }
.form-row { display: grid; grid-template-columns: 1.25fr 1fr; gap: 9px; }
.primary { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 8px 16px; background: var(--blue); color: white; border: 1px solid var(--blue); font-size: 14px; font-weight: 500; }
.submit { width: 100%; }
.form-note, #feedback { font-size: 13px; margin-top: 9px; }
.form-note { color: var(--muted); }
.delivery { padding: 24px 0; }
.delivery p { color: var(--muted); margin-top: 9px; }
.footer { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--ink); color: var(--muted); padding-block: 20px; font-size: 13px; margin-top: 40px; }
.mobile-cart { display: none; }

@media (max-width: 850px) {
  .shop-layout { gap: 24px; grid-template-columns: minmax(0, 1fr) minmax(285px, 315px); }
  .product { grid-template-columns: minmax(0,1fr) auto; }
  .subject-icon { display: none; }
  .product-bottom { grid-template-columns: auto 84px; }
  .intro-meta { gap: 12px; }
}
@media (max-width: 680px) {
  .wrap { width: calc(100% - 32px); }
  .header { min-height: 62px; }
  nav { display: none; }
  .intro { grid-template-columns: 1fr; gap: 14px; padding: 23px 0 18px; }
  .intro p { margin-top: 8px; }
  .intro-meta { gap: 20px; }
  .intro-meta strong { font-size: 15px; }
  .shop-layout { grid-template-columns: 1fr; gap: 13px; margin-top: 20px; }
  .product { gap: 8px; }
  .order { padding: 17px; }
  .footer { margin-top: 28px; padding-bottom: 88px; }
  .mobile-cart:not([hidden]) { position: fixed; z-index: 5; inset: auto 0 0; display: flex; justify-content: space-between; align-items: center; padding: 9px 16px max(9px, env(safe-area-inset-bottom)); background: var(--ink); color: white; }
  .mobile-cart small { display: block; opacity: .8; font-size: 12px; }
  .mobile-cart b { font-weight: 500; }
  .mobile-cart a { padding: 8px 12px; background: var(--white); color: var(--ink); font-size: 14px; font-weight: 500; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
