/* cart.css — «Корзина + заказ принят» of the 017 demo (build P6, agent cart, 27.09.2026). Language of the homepage (DESIGN.md):
   paper, one-ink engraving, waves on the joins, sea decor; the sum card is the ink card of the homepage questions block.
   States: .cart--empty · .cart--full (5.B1–B6) · .cart--done (6.B1–B3). Only transform and opacity are animated. */

/* ---------- head (shared by the three states) ---------- */
.chead { padding: 40px 0 130px; }
.chead .pattern { opacity: .06; }
.chead__in { position: relative; z-index: 2; }
.chead__t { max-width: 12em; }
.chead__lead { max-width: 30ch; }
.chead__btns { margin-top: 30px; display: inline-block; padding: 16px; margin-left: -16px; }
.chead__crab { right: var(--g); top: 34px; width: min(34vw, 470px); opacity: .95; animation: ct-bob 7s var(--inout) infinite alternate; }
.chead__crab--full { width: min(24vw, 330px); top: 26px; opacity: .9; }

/* three steps on one page: 01 Товары · 02 Доставка · 03 Оплата */
.csteps { list-style: none; display: flex; align-items: center; margin: 30px 0 0; padding: 12px 0; width: max-content; border-top: 1px solid var(--ink); border-bottom: 4px double var(--ink); }
.csteps li { display: flex; align-items: center; }
.csteps li + li::before { content: ""; width: 56px; height: 1px; margin: 0 22px; background: var(--ink-3); }
.csteps a { position: relative; display: inline-flex; align-items: baseline; gap: 10px; font: 600 13px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); }
.csteps i { font: italic 500 26px/1 var(--serif); letter-spacing: 0; text-transform: none; color: var(--cobalt); }
.csteps a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--out); }
.csteps a.is-on { color: var(--ink); }
.csteps a.is-on::after, .csteps a:hover::after { transform: scaleX(1); }

/* ---------- body of the full state ---------- */
.cbody { position: relative; padding: 70px 0 150px; background: var(--paper-2) url(../img/paper.webp) repeat; background-blend-mode: multiply; }
.cbody .pattern { opacity: .05; }
.cbody .wave--bot { color: var(--paper-2); }
.cbody__grid { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 60px; align-items: start; }
.cstep { position: relative; padding-bottom: 54px; scroll-margin-top: 120px; }
.cstep + .cstep { padding-top: 50px; border-top: 1px solid var(--ink-3); }
.cstep__h { display: flex; align-items: baseline; gap: 18px; margin-bottom: 28px; }
.cstep__h i { font: italic 500 66px/.8 var(--serif); color: var(--cobalt); }
.cstep__h h2 { margin: 0; font: 500 clamp(40px, 3.4vw, 54px)/1 var(--serif); }
.cstep__sub { margin: 36px 0 18px; font: 500 30px/1 var(--serif); }

/* 01 · lines of the order */
.clist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cl { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto 118px auto; align-items: center; gap: 22px; padding: 12px 22px 12px 12px; border-radius: 22px; background: rgba(255, 255, 255, .64); box-shadow: 0 1px 0 var(--ink-3); }
.cl__img { position: relative; display: block; width: 92px; height: 92px; border-radius: 50%; overflow: hidden; background: var(--paper-2); box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--ink-3); }
.cl__img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.18); transition: transform .8s var(--out); }
.cl:hover .cl__img img { transform: scale(1.28); }
.cl__name { display: block; font: 500 23px/1.12 var(--serif); }
.cl__name:hover { text-decoration: underline; text-underline-offset: 4px; }
.cl__meta { display: block; margin-top: 5px; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
.cl__unit { display: block; margin-top: 7px; font: 600 14px/1 var(--sans); }
.cl__unit small { font-weight: 400; color: var(--ink-2); }
.cl__qty { display: inline-flex; align-items: center; height: 44px; border-radius: 22px; box-shadow: inset 0 0 0 1.5px var(--ink); }
.cl__qty button { width: 40px; height: 44px; font: 600 18px/1 var(--sans); }
.cl__qty button:active { transform: scale(.86); }
.cl__qty b { min-width: 24px; text-align: center; font: 600 15px/1 var(--sans); }
.cl__sum { text-align: right; font: 600 19px/1 var(--sans); white-space: nowrap; }
.cl__del { font: 500 13px/1 var(--sans); color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.cl__del:hover { color: var(--red); }
.cl--gift { grid-template-columns: 92px minmax(0, 1fr); background: transparent; box-shadow: none; border: 1.5px dashed rgba(219, 27, 27, .55); }
.cl--gift .cl__img { border-radius: 0; background: none; box-shadow: none; overflow: visible; }
.cl--gift .cl__img img { object-fit: contain; transform: rotate(-8deg); }
.cl--gift .cl__name { font-size: 22px; color: var(--red); }

/* 02 · options, fields, chips */
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 26px; padding: 0; border: 0; }
.opt { position: relative; display: grid; grid-template-columns: 66px minmax(0, 1fr) 22px; align-items: center; gap: 16px; min-height: 100px; padding: 14px 20px 14px 14px; border-radius: 22px; background: rgba(255, 255, 255, .5); box-shadow: inset 0 0 0 1px var(--ink-3); cursor: pointer; }
.opt.is-on { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink), 0 20px 36px -24px rgba(13, 26, 69, .5); }
.opt:focus-within { outline: 2px solid var(--coral); outline-offset: 3px; }
.opt__ic { width: 66px; height: 58px; object-fit: contain; transition: transform .6s var(--out); }
.opt:hover .opt__ic, .opt.is-on .opt__ic { transform: rotate(-6deg) scale(1.07); }
.opt__t { display: block; font: 500 21px/1.1 var(--serif); }
.opt__s { display: block; margin-top: 5px; font-size: 13.5px; line-height: 1.35; color: var(--ink-2); }
.opt__r { position: relative; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink); }
.opt__r::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--red); transform: scale(0); transition: transform .4s var(--out); }
.opt.is-on .opt__r::after { transform: scale(1); }

.pick { display: none; align-items: center; gap: 18px; margin: 0 0 24px; padding: 16px 22px 16px 16px; border-radius: 20px; background: #fff; box-shadow: inset 0 0 0 1px var(--ink-3); }
.pick img { width: 54px; height: auto; flex: none; }
.pick p { margin: 0; font: italic 400 20px/1.35 var(--serif); }
.is-pickup .pick { display: flex; }
.is-pickup [data-addr], .is-pickup [data-slots] { display: none; }

.f { position: relative; margin: 0 0 22px; }
.f__l { display: block; margin: 0 0 10px; font: 600 12.5px/1.25 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.f input { display: block; width: 100%; height: 58px; padding: 0 20px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, .78); box-shadow: inset 0 0 0 1px var(--ink-3); font: 400 17px/1 var(--sans); color: var(--ink); }
.f input::placeholder { color: rgba(74, 86, 131, .7); }
.f input:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
.f.is-bad input { box-shadow: inset 0 0 0 1.5px var(--red); }
.f__err { display: none; margin: 9px 0 0; font: 500 13.5px/1.35 var(--sans); color: var(--red); }
.f__err::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 8px 2px 2px; border-radius: 50%; background: currentColor; }
.f.is-bad .f__err, .f__err.is-on { display: block; animation: ct-in .35s var(--out); }
.f__hint { margin: 12px 0 0; font-size: 13.5px; color: var(--ink-2); }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.is-shake { animation: ct-shake .45s var(--out); }
.cdays .chip { flex-direction: column; justify-content: center; gap: 3px; height: 56px; min-width: 70px; padding: 0 14px; border-radius: 16px; }
.cdays .chip small { font: 500 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.cform .chip { background: rgba(255, 255, 255, .6); }

/* 03 · the gift switch and the note */
.giftbox { position: relative; margin-top: 4px; padding: 24px 26px 22px; border-radius: 22px; background: var(--paper) url(../img/paper.webp); box-shadow: inset 0 0 0 1px var(--ink-3); overflow: hidden; }
.giftbox__crab { position: absolute; right: -20px; top: -12px; width: 150px; opacity: .14; transform: rotate(14deg); pointer-events: none; }
.sw { position: relative; display: inline-flex; align-items: center; gap: 16px; cursor: pointer; font: 500 30px/1 var(--serif); }
.sw__ui { position: relative; flex: none; width: 54px; height: 30px; border-radius: 15px; background: rgba(22, 36, 94, .18); }
.sw__ui::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--red); opacity: 0; transition: opacity .3s; }
.sw__ui::after { content: ""; position: absolute; left: 4px; top: 4px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(13, 26, 69, .3); transition: transform .4s var(--out); }
.sw input:checked + .sw__ui::before { opacity: 1; }
.sw input:checked + .sw__ui::after { transform: translateX(24px); }
.sw input:focus-visible + .sw__ui { outline: 2px solid var(--coral); outline-offset: 3px; }
.giftbox__note { display: none; width: 100%; margin-top: 16px; padding: 0; border: 0; resize: none; background: repeating-linear-gradient(to bottom, transparent 0, transparent 33px, rgba(22, 36, 94, .22) 33px, rgba(22, 36, 94, .22) 34px); font: italic 400 22px/34px var(--serif); color: var(--ink); }
.giftbox__note::placeholder { color: var(--ink-2); opacity: .85; }
.giftbox__note:focus { outline: none; }
.giftbox.is-on .giftbox__note { display: block; animation: ct-in .45s var(--out); }

/* the sum card (ink, sticky beside the steps) */
.sum { position: sticky; top: calc(var(--hdr) + 24px); padding: 30px 30px 28px; border-radius: 28px; background: var(--ink); color: #fff; box-shadow: 0 40px 80px -40px rgba(13, 26, 69, .7); overflow: hidden; }
.sum__crab { position: absolute; right: -44px; top: -18px; width: 210px; filter: brightness(0) invert(1); opacity: .1; transform: rotate(-12deg); pointer-events: none; }
.sum__cap { position: relative; display: block; margin-bottom: 14px; color: rgba(255, 255, 255, .7); }
.sum__row { position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, .14); font-size: 15px; color: rgba(255, 255, 255, .8); }
.sum__row b { max-width: 62%; text-align: right; font-weight: 600; color: #fff; }
.sum__total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 20px 0 4px; }
.sum__total span { font: 600 13px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; }
.sum__total b { font: 500 52px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.sum__free { margin-top: 14px; }
.sum__free p { margin: 0; font-size: 14px; line-height: 1.4; color: #fff; }
.sum__lines { margin: 14px 0 22px; font-size: 13px; line-height: 1.55; color: rgba(255, 255, 255, .64); }
.sum__btn { width: 100%; }
.sum .btn::before { background: #fff; }
.sum .btn:hover { color: var(--ink); }
.sum__btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.sum__btn[aria-disabled="true"]::before { transform: scale(0, 1); }
.sum__btn[aria-disabled="true"]:hover { color: #fff; }
.sum__err { color: var(--coral); }
.sum__link { display: inline-block; margin-top: 16px; font-size: 13px; color: rgba(255, 255, 255, .72); text-decoration: underline; text-underline-offset: 3px; }
.sum__link:hover { color: var(--coral); }

/* ---------- empty ---------- */
.cart--empty .chead { padding-bottom: 170px; }
.cart--empty .chead__t { font-size: clamp(56px, 6.4vw, 104px); max-width: 8.5em; }
.cart--empty .chead .t-promise { font-size: clamp(24px, 2vw, 32px); max-width: 24ch; color: var(--ink); }
.ckrab { padding-top: 110px; padding-bottom: 130px; }
.ckrab .wrap { position: relative; z-index: 2; }
.ckrab .head, .ckrab .link { color: #fff; }
.ckrab .tile__img { box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); }
.ckrab .tile__name { color: #fff; }
.ckrab .price small { color: rgba(255, 255, 255, .6); }
.ckrab .step { color: #fff; }
/* base.css `.tile__img img {position:absolute; inset:0}` also takes the scissors icon of the gift badge over its text — kept local
   until the shared file gets `.gift img { position: static; }` (reported) */
.ckrab .tile__img .gift img { position: static; width: 34px; height: auto; transform: none; }
.cart--empty .ftr { margin-top: 0; }

/* ---------- done: «Заказ принят» ---------- */
.dhead { padding-bottom: 150px; }
.dhead__grid { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: 64px; align-items: end; }
.dhead__t { font-size: clamp(64px, 7.4vw, 120px); max-width: none; }
.dhead__lead { max-width: 34ch; }
.dhead__gull { width: 190px; left: 44%; top: 22px; opacity: .7; }
.dnum { position: relative; padding: 36px 36px 32px; border-radius: 28px; background: var(--ink); color: #fff; box-shadow: 0 40px 80px -40px rgba(13, 26, 69, .7); overflow: hidden; }
.dnum__helm { position: absolute; right: -50px; top: -50px; width: 200px; filter: brightness(0) invert(1); opacity: .1; animation: ct-spin 80s linear infinite; }
.dnum .t-cap { position: relative; color: rgba(255, 255, 255, .7); }
.dnum__n { position: relative; display: block; margin: 12px 0 18px; font: 500 72px/1 var(--serif); letter-spacing: .02em; font-variant-numeric: lining-nums tabular-nums; }
.dnum__wa { position: relative; margin: 0 0 22px; font: 500 22px/1.25 var(--serif); }
.dnum__btns { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.dnum__tel { font-size: 14px; color: rgba(255, 255, 255, .8); }
.dnum__tel:hover { color: var(--coral); }

.dn { padding-top: 90px; padding-bottom: 140px; }
.dn .wrap { position: relative; z-index: 2; }
.dn__road { position: relative; padding-top: 150px; }
.dn__line { position: absolute; left: 0; right: 0; top: 150px; height: 2px; margin-top: -1px; background: repeating-linear-gradient(90deg, var(--ink) 0, var(--ink) 16px, transparent 16px, transparent 28px); opacity: .55; }
.dn__van { position: absolute; left: calc(50% - 50px); top: 6px; width: 210px; z-index: 2; transform-origin: 50% 100%; }
.dn__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px; }
.dn__st { position: relative; }
.dn__node { position: relative; display: block; width: 28px; height: 28px; margin: -14px 0 28px; border-radius: 50%; background: var(--paper-2); box-shadow: inset 0 0 0 2px var(--ink); }
.is-done .dn__node { background: var(--ink); }
.is-done .dn__node::after { content: ""; position: absolute; left: 9px; top: 6px; width: 7px; height: 12px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.is-now .dn__node { background: #fff; box-shadow: 0 0 0 2px var(--red), 0 8px 18px rgba(13, 26, 69, .3); }
.is-now .dn__node::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--red); }
.is-now .dn__node::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; box-shadow: 0 0 0 2px var(--red); animation: pulse 2.4s var(--out) infinite; }
.dn__time { display: block; min-height: 30px; margin-bottom: 10px; font: italic 500 30px/1 var(--serif); color: var(--cobalt); }
.dn__i { display: block; margin-bottom: 8px; font: 600 12px/1 var(--sans); letter-spacing: .22em; color: var(--ink-2); }
.dn__st > b { display: block; margin-bottom: 12px; font: 500 30px/1.08 var(--serif); }
.dn__st p { margin: 0 0 8px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.dn__rec { list-style: none; margin: 0 0 10px; padding: 0; font-size: 14.5px; }
.dn__rec li { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; border-bottom: 1px dotted rgba(22, 36, 94, .3); }
.dn__rec li b { flex: none; font-weight: 600; }
.dn__rec .dn__rsum { border-bottom: 0; border-top: 4px double var(--ink); margin-top: 4px; padding-top: 10px; font-weight: 600; }
.dn__pay { font-size: 14px !important; }
.dn__note { font: italic 400 20px/1.35 var(--serif) !important; color: var(--ink) !important; }
.dn__gift { display: flex; align-items: center; gap: 12px; margin-top: 12px !important; font-weight: 500; color: var(--ink) !important; }
.dn__gift img { width: 48px; height: auto; flex: none; }

.drec { padding-top: 110px; padding-bottom: 60px; }
.drec .wrap { position: relative; z-index: 2; }
.drec__shell { width: 120px; right: 7%; top: 60px; opacity: .45; }
.drec__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.rc { display: flex; flex-direction: column; gap: 10px; }
.rc__img { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 22px; overflow: hidden; background: var(--paper-2); box-shadow: 0 30px 50px -34px rgba(13, 26, 69, .5); }
.rc__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--out); }
.rc:hover .rc__img img { transform: scale(1.05); }
.rc__for { margin-top: 8px; font: 600 12px/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.rc__t { font: 500 28px/1.1 var(--serif); }
.rc__lead { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }

@keyframes ct-bob { from { transform: translateY(0) rotate(0deg); } to { transform: translateY(-14px) rotate(-2deg); } }
@keyframes ct-spin { to { transform: rotate(360deg); } }
@keyframes ct-in { from { opacity: 0; transform: translateY(-5px); } }
@keyframes ct-shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }

/* ---------- narrower screens (the demo is desktop; this keeps the page whole) ---------- */
@media (max-width: 1100px) {
  .cbody__grid { grid-template-columns: 1fr; }
  .sum { position: relative; top: 0; }
  .dhead__grid { grid-template-columns: 1fr; }
  .chead__crab { opacity: .25; }
}
@media (max-width: 760px) {
  .cl { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .cl__img { width: 72px; height: 72px; }
  .cl__sum { grid-column: 2; text-align: left; }
  .opts, .f2 { grid-template-columns: 1fr; }
  .dn__steps, .drec__grid { grid-template-columns: 1fr; }
  .dn__van { left: auto; right: 0; width: 150px; }
  .csteps li + li::before { width: 18px; margin: 0 10px; }
}

/* waves: overlap by one pixel instead of the 0.1 px gap of base.css (light seam on dark joins; reported) */
.wave--top { top: 1px; }
.wave--bot { bottom: 1px; }
/* ?shot=1 — final states: the decorative loops stand still */
.shot .chead__crab, .shot .dnum__helm { animation: none; }
