/* Cart, checkout and order confirmation. Tokens come from site.css. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn--block { width: 100%; }
.link-btn { background: none; border: 0; padding: 4px 0; font: 500 .8125rem var(--sans); color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--ink); }

.cart-btn { position: relative; }
.cart-count {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent-ink); color: #fff; font: 700 .6875rem/18px var(--sans); text-align: center;
}
.cart-count[hidden] { display: none; }
.cart-count.is-zero { background: var(--ink-2); opacity: .6; }  /* only lines at 0 in the cart */
.toast {
  position: fixed; z-index: 60; left: 50%; bottom: 20px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px);
  display: flex; gap: 16px; align-items: center; padding: 14px 20px; border-radius: 999px; background: var(--ink); color: var(--bg);
  font-size: .9375rem; box-shadow: var(--shadow);
}
.toast[hidden] { display: none; }
.toast a { color: var(--accent); font-weight: 700; text-decoration: none; white-space: nowrap; }

.buy { display: flex; gap: 10px; margin-bottom: 12px; }
.buy .btn { flex: 1; }
.buy__qty {
  width: 72px; min-height: 48px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font: 600 1rem var(--sans); text-align: center; color: var(--ink);
}
.buy__note { font-size: .8125rem; color: var(--ink-2); margin-bottom: 28px; line-height: 1.7; }

.shop-grid { display: grid; gap: 32px; align-items: start; }
@media (min-width: 960px) {
  .shop-grid { grid-template-columns: 1fr 380px; gap: 48px; }
  .shop-grid .summary { position: sticky; top: 92px; }
}

.cart-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cart-line { display: grid; grid-template-columns: 80px 1fr; gap: 10px 16px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: start; }
.cart-line__img { grid-row: span 3; aspect-ratio: 4 / 5; border-radius: var(--radius-sm); overflow: hidden; background: var(--sand); display: grid; place-items: center; }
.cart-line__img img { width: 100%; height: 100%; object-fit: cover; }
.cart-line__img img.is-mark { width: 60%; height: auto; opacity: .2; }
.cart-line__info { display: grid; gap: 2px; font-size: .875rem; }
.cart-line__name { font: 600 1.375rem/1.15 var(--serif); text-decoration: none; }
.cart-line__unit { color: var(--ink-2); }
.cart-line__qty { display: flex; align-items: center; gap: 16px; }
.cart-line__total { font-size: 1rem; }
@media (min-width: 700px) {
  .cart-line { grid-template-columns: 96px 1fr auto 110px; align-items: center; }
  .cart-line__img { grid-row: auto; }
  .cart-line__total { text-align: right; }
}
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.stepper button { width: 40px; height: 40px; border: 0; background: none; font-size: 1.125rem; cursor: pointer; color: var(--ink); border-radius: 999px; }
.stepper button:hover { background: var(--sand); }
.stepper input { width: 36px; border: 0; background: none; font: 600 1rem var(--sans); text-align: center; color: var(--ink); -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 14px; }
.summary h2 { font-size: 1.625rem; }
.summary dl { margin: 0; display: grid; gap: 10px; }
.summary dl div { display: flex; justify-content: space-between; gap: 16px; font-size: .9375rem; }
.summary dt { color: var(--ink-2); }
.summary dd { margin: 0; text-align: right; }
.summary .summary__total { padding-top: 12px; border-top: 1px solid var(--line); font-size: 1.125rem; font-weight: 700; }
.summary .summary__total dt { color: var(--ink); }
.summary__items, .summary__deliveries { list-style: none; margin: 0; padding: 0 0 14px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; font-size: .875rem; }
.summary__items li, .summary__deliveries li { display: flex; justify-content: space-between; gap: 12px; }
.summary__deliveries li span:last-child { color: var(--ink-2); text-align: right; }
.summary--static { text-align: left; margin: 24px 0; }
.summary__body { display: grid; gap: 14px; }
/* A line at 0: kept so it can be raised again, not ordered. */
.cart-line.is-zero .cart-line__img, .cart-line.is-zero .cart-line__info, .cart-line.is-zero .cart-line__total,
.summary__line.is-zero .summary__name, .summary__line.is-zero .summary__sum { opacity: .45; }
.btn.is-disabled, .summary .btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.summary .btn[aria-disabled="true"] { opacity: .6; cursor: progress; }
.summary__body[aria-busy="true"] { opacity: .6; transition: opacity .2s .15s; }
/* Checkout summary lines: name and line sum, then −/qty/+ and remove below. */
.summary__items .summary__line { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; }
.summary__name { min-width: 0; }
.summary__sum { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary__qty { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 2px; }
.summary__qty[hidden] { display: none; }
.summary__qty button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink); font-size: 1rem; line-height: 1; cursor: pointer; }
.summary__qty button:hover:not(:disabled) { background: var(--sand); }
.summary__qty button:disabled { opacity: .35; cursor: default; }
.summary__qty span { min-width: 24px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.summary__qty .summary__remove { margin-left: 4px; width: auto; padding: 0 8px; border-color: transparent; color: var(--ink-2);
  font-size: .8125rem; text-decoration: underline; text-underline-offset: 3px; }
.fine { font-size: .75rem; color: var(--ink-2); margin: 0; }

.checkout { display: grid; gap: 36px; }
.checkout fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 16px; min-width: 0; }
.checkout legend { font: 600 1.625rem var(--serif); margin-bottom: 16px; padding: 0; }
.field { display: grid; gap: 6px; }
.field label { font-size: .8125rem; font-weight: 600; }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); font: 400 1rem var(--sans); color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.field--error input, .field--error textarea { border-color: #a23b3b; }
/* Phone: country code picker + number (static/js/phone.js). Without the script the native select is invisible
   over the flag and code, so it still works. */
.phone { position: relative; display: flex; gap: 8px; }
.phone__country { position: relative; flex: none; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  font: 600 .9375rem var(--sans); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.phone__country::after { content: ""; width: 6px; height: 6px; margin: -3px 0 0 2px; border: solid var(--ink-2); border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg); transition: transform .15s; }
.phone__country[aria-expanded="true"]::after { transform: translateY(3px) rotate(-135deg); }
.phone__country:hover { border-color: var(--ink-2); }
.phone__country select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font-size: 1rem; }
.phone__country:focus-visible, .phone__country:focus-within, .phone__country[aria-expanded="true"] { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.phone__flag, .phone__list img { flex: none; width: 22px; height: 16px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(34, 29, 26, .12); }
.field--error .phone__country { border-color: #a23b3b; }
.phone__panel { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; max-width: 380px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(34, 29, 26, .14); }
.field .phone__search { min-height: 42px; padding: 8px 12px; font-size: .9375rem; background: var(--bg); border-color: transparent; }
.field .phone__search:focus { background: var(--surface); }
.phone__list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 288px; overflow-y: auto; overscroll-behavior: contain; }
.phone__list [role="option"] { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-sm);
  font-size: .9375rem; cursor: pointer; }
.phone__list [role="option"].is-active { background: var(--accent-soft); }
.phone__list [role="option"][aria-selected="true"] { font-weight: 600; }
.phone__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone__dial { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.phone__list [hidden] { display: none; }
.phone__divider { height: 1px; margin: 6px 10px; background: var(--line); }
.phone__none { margin: 0; padding: 14px 10px; color: var(--ink-2); font-size: .875rem; }
.field__error, .form-error { color: #a23b3b; font-size: .8125rem; }
.form-error { background: #f7e6e6; padding: 12px 14px; border-radius: var(--radius-sm); margin: 0; font-size: .875rem; }
.address-fields { display: grid; gap: 16px; }
.address-fields[hidden] { display: none; }
@media (min-width: 640px) { .address-fields { grid-template-columns: 1fr 1.6fr; } }
.options { display: grid; gap: 10px; }
.option {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 16px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.option:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.option input { margin: 3px 0 0; accent-color: var(--ink); width: 18px; height: 18px; }
.option__body { display: grid; gap: 2px; }
.option__title { font-weight: 600; }
.option__note { font-size: .8125rem; color: var(--ink-2); }
.option__price { font-size: .875rem; font-weight: 600; text-align: right; max-width: 14ch; }
/* The address of a pickup point: on its own line, never split (catalog/templatetags/ocode.py option_title). */
.option__place { display: block; white-space: nowrap; }
/* Phones: the price under the title, so the title and the address get the card's whole width. */
@media (max-width: 639px) {
  .option { grid-template-columns: auto 1fr; row-gap: 4px; }
  .option__price { grid-column: 2; text-align: left; max-width: none; }
}
.hp { position: absolute; left: -9999px; }

.empty-state, .done { max-width: 560px; margin: 24px auto 0; text-align: center; display: grid; justify-items: center; gap: 12px; }
.empty-state img, .done > img { opacity: .25; margin-bottom: 8px; }
.done h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); }
.done__number { font-size: 1.125rem; margin: 0; }
.done .summary { width: 100%; }

/* Quick add on product cards: icon-only on narrow cards, icon + label when the card is wide enough. */
.card__add { position: relative; z-index: 2; flex: none; }
.card__add button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; min-width: 44px; padding: 0 12px;
  border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--bg);
  font: 600 .8125rem/1 var(--sans); cursor: pointer; transition: background-color .2s, border-color .2s, transform .15s;
}
.card__add button:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.card__add button:active { transform: scale(.96); }
.card__add svg { width: 18px; height: 18px; }
.card__add-label, .card__add-done { display: none; }
@container (min-width: 250px) {
  .card__add button { padding: 0 16px; }
  .card__add-label { display: inline; }
}
.card__add.is-added button { background: var(--ok); border-color: var(--ok); }
.card__add.is-added .card__add-icon { display: none; }
.card__add.is-added .card__add-done { display: inline-flex; }

/* Discount codes */
.promo { display: grid; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.promo label { font-size: .8125rem; font-weight: 600; }
.promo__row { display: flex; gap: 8px; }
.promo__row input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); font: 600 .9375rem var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink);
}
.promo__row input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; }
.promo__row input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.promo__row .btn { min-height: 44px; padding: 0 18px; }
.promo__applied {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px;
  border-radius: var(--radius-sm); background: color-mix(in srgb, var(--ok) 12%, var(--surface)); color: var(--ok); font-size: .875rem;
}
.promo__applied strong { letter-spacing: .06em; }
.promo__error { color: #a23b3b; font-size: .8125rem; margin: 0; }
.summary .summary__discount dt, .summary .summary__discount dd { color: var(--ok); font-weight: 600; }

/* Cookie consent banner: a card at the bottom, does not block the page (no cookie wall). */
.consent {
  position: fixed; z-index: 80; left: 16px; right: 16px; bottom: 16px; margin: 0 auto; max-width: 560px;
  display: grid; gap: 12px; padding: 20px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(34, 29, 26, .18);
}
.consent[hidden] { display: none; }
.consent__title { font-size: 1.375rem; }
.consent__text { margin: 0; font-size: .875rem; color: var(--ink-2); }
.consent__options { display: grid; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.consent__options[hidden] { display: none; }
.consent__option { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: .8125rem; color: var(--ink-2); cursor: pointer; }
.consent__option strong { color: var(--ink); }
.consent__option input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ink); }
/* Accept and reject look the same and are the same size; "customise" sits below as the secondary option. */
.consent__actions { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "reject accept" "custom custom"; gap: 8px; }
.consent__actions .btn { min-height: 44px; padding: 8px 12px; line-height: 1.2; }
.consent__actions [data-consent-reject] { grid-area: reject; }
.consent__actions [data-consent-accept] { grid-area: accept; }
.consent__actions [data-consent-custom] { grid-area: custom; }
@media (min-width: 640px) {
  .consent { left: 24px; right: auto; bottom: 24px; }
}
