/* cart.css — 4 · Корзина и оформление одной страницей (logic/NEW_MAP_3.md §4 B2–B8), build P6 023, 01.10.2026.
   Logic: nuts.com П3 П6 П11 (one page, delivery chosen before the fields, one threshold number) · R61 K10 (rows with a stepper,
   «Оформить заказ →» pinned above the bottom bar on the phone) · look: R35 P5 (plate in the product's tone), R35 P2 (the dome seam),
   R38 G3 (colour block for the total). Tokens and type — css/base.css only; motion — transform/opacity only. */

/* [hidden] must win over the display of the classes below (grid, flex) */
main [hidden], .mgo[hidden] { display: none !important; }
/* base.css gives body overflow-x: hidden → body becomes a scroll box and no position: sticky works (the header included).
   clip cuts the same overflow without a scroll box; to be lifted when base.css takes the same fix */

/* ---------- page head ---------- */
.co-head h1 em { font-style: normal; color: var(--clay); }

/* ---------- the sand section under a low dome ---------- */
.co { background: var(--sand); margin-top: clamp(44px, 4.4vw, 100px); padding: clamp(6px, 1vw, 22px) 0 var(--sec); }
.co.dome::before { height: clamp(44px, 4.4vw, 100px); }
.co.is-empty { padding-bottom: clamp(36px, 3.4vw, 72px); }
.co__grid { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr); gap: clamp(18px, 2vw, 44px); align-items: start; }
.co__bag, .cf { position: sticky; top: 140px; }   /* cart.js stick(): a column taller than the screen gets a negative top and sticks by its bottom */

/* ---------- 4.B2 lines ---------- */
.bag { background: var(--white); border-radius: var(--r-card); padding: clamp(6px, .6vw, 12px) clamp(16px, 1.6vw, 30px) clamp(16px, 1.6vw, 28px); }
.cl { display: grid; grid-template-columns: clamp(86px, 7.2vw, 132px) minmax(0, 1fr) auto auto; grid-template-areas: "plate name name del" "plate wt step sum";
  column-gap: clamp(12px, 1.2vw, 22px); row-gap: 10px; align-items: center; padding: clamp(14px, 1.2vw, 22px) 0; border-bottom: 1px solid var(--line); }
.cl__plate { grid-area: plate; position: relative; display: block; aspect-ratio: 1; border-radius: var(--r-plate); background: var(--tone, var(--sand)); overflow: hidden; }
.cl__plate img { position: absolute; inset: 9%; width: 82%; height: 82%; object-fit: contain; transition: transform .5s var(--ease); }
.cl__plate img.is-photo { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cl__plate:hover img { transform: scale(1.04); }
.cl__name { grid-area: name; display: grid; gap: 4px; min-width: 0; align-self: end; }
.cl__name a { font-weight: 600; font-size: calc(var(--fs-body) * .98); line-height: 1.3; }
.cl__name a:hover { color: var(--clay); }
.cl__meta { font-size: var(--fs-small); color: var(--ink-2); line-height: 1.35; }
.cl__meta b { color: var(--clay); font-weight: 600; }
.cl__unit + b::before { content: " · "; color: var(--ink-2); font-weight: 400; }
.cl__del { grid-area: del; justify-self: end; align-self: start; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2);
  background: var(--white); border: 1.5px solid var(--line); transition: transform .2s var(--ease); }
.cl__del:hover { color: var(--clay); border-color: var(--clay); }
.cl__del:active { transform: scale(.92); }
.cl__del .ico { width: 18px; height: 18px; }
.cl__wt { grid-area: wt; align-self: start; }
.cl .wt button { min-height: 38px; min-width: 0; padding: 0 12px; }
.cl .wt button[disabled][aria-pressed="true"] { color: var(--ink); border-style: solid; cursor: default; }
.cl__step { grid-area: step; margin-left: 0; align-self: start; }
.cl__sum { grid-area: sum; justify-self: end; align-self: start; min-width: 4.8em; text-align: right; font-weight: 700; font-size: calc(var(--fs-body) * 1.1);
  letter-spacing: -.01em; line-height: 48px; white-space: nowrap; }
.bag__sum { display: flex; align-items: center; gap: 14px; padding: 16px 0 14px; flex-wrap: wrap; }
.bag__dr { width: clamp(44px, 3.6vw, 64px); height: auto; mix-blend-mode: multiply; flex: none; }
.bag__w { color: var(--ink-2); }
.bag__w b { color: var(--ink); font-weight: 700; }
.bag__t { margin-left: auto; font-weight: 600; }
.bag__t b { font-size: var(--fs-price); letter-spacing: -.02em; margin-left: 6px; font-weight: 700; }
.bag__free { position: relative; }
.bag__free .free { background: var(--butter); border: 0; padding: 16px clamp(118px, 9vw, 150px) 16px 18px; }
.bag__free .free p { font-size: calc(var(--fs-body) * .94); }
.bag__free .free__bar { background: var(--white); }
.bag__van { position: absolute; right: 14px; top: 50%; width: clamp(88px, 7vw, 124px); transform: translateY(-50%); mix-blend-mode: multiply; z-index: 1; pointer-events: none; }

/* ---------- checkout column ---------- */
.cf { display: grid; gap: 14px; min-width: 0; }
.cf__card { background: var(--white); border-radius: var(--r-card); padding: clamp(18px, 1.7vw, 32px); border: 0; margin: 0; min-width: 0; }
fieldset.cf__card { min-inline-size: 0; }
.cf__leg { float: left; width: 100%; display: flex; align-items: center; gap: 12px; padding: 0; margin-bottom: 18px; font-family: var(--f-acc); font-weight: 700;
  font-size: var(--fs-h3); line-height: 1.15; }
.cf__step > :not(.cf__leg) { clear: both; }
.cf__leg i { width: 38px; height: 38px; border-radius: 50%; background: var(--sun); display: grid; place-items: center; font-style: normal; font-size: 19px; flex: none; }
.cf__step.is-bad .cf__leg i { background: var(--clay); color: var(--white); }

/* 4.B3 promo link and two fields */
.cf__promo { padding-block: 12px; }
.cf__plink { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; font-weight: 600; text-align: left; }
.cf__plink::after { content: "+"; margin-left: auto; width: 38px; height: 38px; border-radius: 50%; background: var(--sun); display: grid; place-items: center;
  font-size: 24px; line-height: 1; flex: none; transition: transform .3s var(--ease); }
.cf__plink[aria-expanded="true"]::after { transform: rotate(45deg); }
.cf__pct { width: 38px; height: 38px; border-radius: 50%; background: var(--clay); color: var(--white); display: grid; place-items: center; font-style: normal;
  font-weight: 800; font-size: 17px; flex: none; }
.cf__pbox { padding: 6px 0 10px; }
.cf__phint { font-size: var(--fs-small); color: var(--ink-2); }
.cf__prow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.cf__prow .fld { margin-top: 12px; }
.cf__apply { min-height: 54px; }
.cf__pok { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--ok); font-weight: 600; }
.cf__pok .ico { width: 22px; height: 22px; }

/* 4.B4 delivery: where (tabs) → which (option cards) */
.cf__tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.cf__tabs button { min-height: 46px; padding: 0 18px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--white); font-weight: 600;
  font-size: var(--fs-small); white-space: nowrap; transition: transform .2s var(--ease); }
.cf__tabs button:hover { border-color: var(--ink); }
.cf__tabs button:active { transform: scale(.96); }
.cf__tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.cf__group { font-size: var(--fs-small); font-weight: 600; color: var(--ink-2); margin-bottom: 10px; }
.opt { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 16px;
  border-radius: var(--r-plate); border: 1.5px solid var(--line); background: var(--white); cursor: pointer; }
.opt + .opt { margin-top: 8px; }
.opt:hover { border-color: var(--ink); }
.opt input { appearance: none; width: 24px; height: 24px; margin: 1px 0 0; border-radius: 50%; border: 2px solid var(--line); background: var(--white);
  display: grid; place-items: center; cursor: pointer; }
.opt input:checked { border-color: var(--ink); }
.opt input:checked::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); }
.opt input:focus-visible { outline: 3px solid var(--clay); outline-offset: 2px; }
.opt.is-on { border-color: var(--sun); background: var(--butter); }
.opt__b { display: grid; gap: 4px; min-width: 0; }
.opt__b b { font-weight: 600; line-height: 1.35; }
.opt__b small { font-size: var(--fs-small); color: var(--ink-2); line-height: 1.4; }
.opt__p { font-style: normal; font-weight: 700; white-space: nowrap; padding: 5px 12px; border-radius: var(--r-pill); background: var(--sand); font-size: var(--fs-small); }
.opt__p:empty { display: none; }
.opt__p.is-free { background: var(--sun); }
.opt.is-off { cursor: not-allowed; background: var(--cream); }
.opt.is-off:hover { border-color: var(--line); }
.opt.is-off .opt__b b, .opt.is-off .opt__b small { color: var(--ink-3); }
.opt.is-off .opt__b .opt__lack, .opt.is-off [data-min].is-short { color: var(--clay); font-weight: 600; }
.cf__route { margin-top: 14px; }

/* 4.B5 fields: label above, error at the field */
.fld { display: grid; gap: 8px; min-width: 0; margin-top: 14px; align-content: start; }
.fld > span:first-child { font-size: var(--fs-small); font-weight: 600; }
.fld input, .fld textarea { width: 100%; min-height: 54px; padding: 0 20px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--cream);
  font-size: var(--fs-body); outline: 0; }
.fld textarea { min-height: 96px; padding: 14px 20px; border-radius: var(--r-plate); resize: vertical; line-height: 1.45; }
.fld input:focus, .fld textarea:focus { border-color: var(--ink); background: var(--white); }
.fld input::placeholder { color: var(--ink-3); }
.fld.is-bad input, .fld.is-bad textarea { border-color: var(--clay); background: var(--white); box-shadow: 0 0 0 3px rgba(164, 49, 22, .12); }
.fld.is-bad > span:first-child { color: var(--clay); }
.fld__err { font-style: normal; color: var(--clay); font-size: var(--fs-small); font-weight: 600; line-height: 1.35; }
.fld__note { font-size: var(--fs-small); color: var(--ink-2); line-height: 1.4; }
.fld__note--ink { color: var(--ink); font-weight: 600; }
.cf__two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.cf [data-show][hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; min-height: 46px; padding: 0 18px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--white);
  font-weight: 600; font-size: var(--fs-small); white-space: nowrap; transition: transform .2s var(--ease); }
.chip:hover span { border-color: var(--ink); }
.chip:active span { transform: scale(.96); }
.chip input:checked + span { background: var(--sun); border-color: var(--sun); }
.chip input:focus-visible + span { outline: 3px solid var(--clay); outline-offset: 2px; }

/* 4.B6 payment */
.cf__wait { padding: 16px 18px; border-radius: var(--r-plate); background: var(--cream); border: 1.5px dashed var(--line); color: var(--ink-2); }
.cf__pays { display: grid; gap: 8px; }
.opt--pay { grid-template-columns: 26px minmax(0, 1fr); padding: 13px 16px; }
.opt--pay + .opt--pay { margin-top: 0; }
.cf__payline { margin-top: 16px; font-weight: 500; }
.cf__warn { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; color: var(--clay); font-weight: 600; line-height: 1.4; }
.cf__warn i { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--clay); display: grid; place-items: center; font-style: normal;
  font-weight: 800; font-size: 14px; margin-top: 1px; }

/* 4.B7 total, consent, the one button — a colour block (R38 G3) */
.cf__sum { background: var(--ink); color: var(--white); }
.sumt { margin: 0; display: grid; gap: 10px; }
.sumt > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.sumt > div[hidden] { display: none; }
.sumt dt { color: rgba(255, 255, 255, .72); }
.sumt dd { margin: 0; font-weight: 600; white-space: nowrap; }
.sumt__big { padding-top: 14px; margin-top: 4px; border-top: 1px solid rgba(255, 255, 255, .16); }
.sumt__big dt { color: var(--white); font-weight: 600; }
.sumt__big dd { font-size: var(--fs-price); font-weight: 700; letter-spacing: -.02em; }
.sumt__note { margin-top: 8px; font-size: var(--fs-small); color: rgba(255, 255, 255, .72); }
.ck { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; font-size: var(--fs-small); line-height: 1.45; cursor: pointer; }
.ck input { appearance: none; flex: none; width: 24px; height: 24px; margin: 0; border-radius: 7px; border: 2px solid rgba(255, 255, 255, .55); background: transparent;
  display: grid; place-items: center; cursor: pointer; }
.ck input:checked { background: var(--sun); border-color: var(--sun); }
.ck input:checked::after { content: ""; width: 11px; height: 6px; border-left: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: translateY(-1px) rotate(-45deg); }
.ck a { text-decoration: underline; text-underline-offset: 3px; }
.ck a:hover { color: var(--sun); }
.ck.is-bad { color: var(--sun); }
.ck.is-bad input { border-color: var(--sun); box-shadow: 0 0 0 3px rgba(255, 221, 45, .35); }
.cf__go { width: 100%; margin-top: 18px; min-height: 64px; font-size: calc(var(--fs-body) * 1.06); }
.cf__gosum { font-weight: 700; }
.cf__gosum:not(:empty)::before { content: "·"; margin-right: .45em; }
.cf__after { display: flex; gap: 10px; align-items: center; margin-top: 14px; font-size: var(--fs-small); color: rgba(255, 255, 255, .82); }
.cf__after .ico { width: 20px; height: 20px; color: var(--sun); }

/* ---------- 4.B8 empty cart + popular products ---------- */
.co__empty { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(20px, 3vw, 64px); align-items: center; background: var(--white); border-radius: 30px;
  padding: clamp(28px, 3.2vw, 64px) clamp(28px, 4vw, 80px); }
.co__empty[hidden] { display: none; }
.co__emptydr { width: clamp(130px, 11vw, 220px); height: auto; mix-blend-mode: multiply; }
.co__empty h2 { font-family: var(--f-acc); font-size: var(--fs-h2); }
.co__empty p { margin-top: 12px; font-size: calc(var(--fs-body) * 1.08); max-width: 44ch; }
.co__empty p a { border-bottom: 2px solid var(--sun); font-weight: 600; }
.co__empty p a:hover { border-color: var(--ink); }
.co__empty .btn { margin-top: 24px; }
.pop.sec { background: var(--sand); padding-top: 0; }
.pop__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 1.3vw, 28px); }
.pop .pc { border-color: transparent; }

/* ---------- phone pinned button (R61 K10) ---------- */
.mgo { display: none; }

/* ---------- one column below 980 ---------- */
@media (max-width: 980px) {
  .co__grid { grid-template-columns: minmax(0, 1fr); }
  .co__bag, .cf { position: static; }
  .pop__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- phone: R61 taken whole ---------- */
@media (max-width: 767px) {
  body.page-cart { padding-bottom: 150px; }
  .co-head h1 { font-size: 30px; margin-top: 4px; }
  .co { margin-top: 30px; padding-top: 4px; }
  .co.dome::before { height: 30px; }
  .co__grid { gap: 12px; }
  .bag { padding: 4px 12px 14px; border-radius: 20px; }
  .cl { grid-template-columns: 76px minmax(0, 1fr) auto; grid-template-areas: "plate name del" "plate wt wt" "plate sum step"; column-gap: 12px; row-gap: 8px;
    padding: 14px 0; align-items: center; }
  .cl__unit { display: none; }
  .cl__unit + b::before { content: none; }
  .cl__plate { align-self: start; border-radius: 14px; }
  .cl__name { align-self: start; }
  .cl__name a { font-size: 15px; }
  .cl__meta { font-size: 13px; }
  .cl__del { width: 34px; height: 34px; }
  .cl .wt button { min-height: 32px; padding: 0 9px; font-size: 13px; }
  .cl .wt sup { top: -8px; }
  .cl__sum { justify-self: start; text-align: left; min-width: 0; font-size: 18px; line-height: 40px; align-self: center; }
  .cl__step { justify-self: end; min-height: 40px; align-self: center; }
  .cl__step button { width: 32px; height: 32px; }
  .bag__sum { gap: 10px; padding: 14px 0 12px; }
  .bag__dr { width: 38px; }
  .bag__t b { font-size: 22px; }
  .bag__free .free { padding: 14px 92px 14px 14px; }
  .bag__van { width: 72px; right: 10px; }
  .cf { gap: 12px; }
  .cf__card { border-radius: 20px; padding: 18px 16px; }
  .cf__leg { font-size: 21px; margin-bottom: 14px; }
  .cf__leg i { width: 34px; height: 34px; font-size: 17px; }
  .cf__tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .cf__tabs::-webkit-scrollbar { display: none; }
  .cf__tabs button { flex: none; min-height: 42px; padding: 0 15px; }
  .opt { padding: 12px 14px; gap: 10px; grid-template-columns: 24px minmax(0, 1fr); }
  .opt__p { grid-column: 2; justify-self: start; }
  .opt__b b { font-size: 15px; }
  .cf__prow { grid-template-columns: minmax(0, 1fr); }
  .cf__two { grid-template-columns: minmax(0, 1fr); }
  .cf__two.cf__two--keep { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fld input, .fld textarea { font-size: 16px; }
  .chip span { min-height: 42px; padding: 0 14px; }
  .cf__go { min-height: 58px; }
  .co__empty { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; border-radius: 22px; padding: 26px 18px; }
  .co__emptydr { width: 120px; }
  .co__empty h2 { font-size: 26px; }
  .pop__grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .mgo:not([hidden]) { display: flex; align-items: center; gap: 12px; position: fixed; left: 0; right: 0; bottom: 70px; z-index: 70; padding: 10px 12px;
    background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -10px 24px -16px rgba(45, 41, 38, .4);
    transition: transform .3s var(--ease), opacity .3s var(--ease); }
  .mgo.is-away { transform: translateY(115%); opacity: 0; pointer-events: none; }
  .mgo__t { font-size: 14px; color: var(--ink-2); line-height: 1.2; }
  .mgo__t b { display: block; color: var(--ink); font-size: 19px; }
  .mgo__b { flex: 1; min-height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .mgo.is-away { transform: none; }
}
