/* SezonHit theme: cart (checkout/cart.twig). Lines on the left, the sum in a card on the right that stays in view;
   on phones the sum follows the lines. */
.cart { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; margin-top: 24px; }
.cart__lines ul { border-top: 1px solid var(--line); }

/* a line: photo | name, options, unit price | quantity + remove | line total */
.cline { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto 110px; gap: 8px 20px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--line); }
.cline__img img { width: 80px; height: 80px; border-radius: var(--r); object-fit: cover; background: var(--paper-2); display: block; }
/* the buyer's photo for a round lid («Своє фото»): round, as it's printed */
.cline__img img.is-round { border-radius: 50%; }
.cline__info { display: grid; gap: 4px; min-width: 0; }
/* the padding makes a 44 px target; the negative margin keeps it out of the layout */
.cline__name { justify-self: start; padding: 12px 0; margin: -12px 0; font: 600 16.5px/1.3 var(--ui); color: var(--ink); text-decoration: none; }
.cline__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.cline__opt { font-size: 14.5px; color: var(--ink-2); }
.cline__opt b { font-weight: 600; color: var(--ink); }
.cline__stock { justify-self: start; padding: 3px 8px; border-radius: 999px; background: var(--brown-tint); color: var(--brown); font: 600 12.5px/1.2 var(--ui); }
.cline__unit { font-size: 14px; color: var(--ink-3); }
.cline__nudge { font: 600 14px/1.3 var(--ui); color: var(--green); }
/* «Акція N+1»: the line whose piece is free, and variant a's hint under a product (in the promo's brown) */
.cline__gift { display: flex; align-items: center; gap: 8px; font: 700 14px/1.3 var(--ui); color: var(--brown); }
.cline__gift .promo-badge { height: 22px; padding: 0 7px; font-size: 12px; }
.cline__nudge--promo { color: var(--brown); }
.cline__qty { display: grid; justify-items: center; gap: 2px; }
.qty--sm { height: 44px; }
.qty--sm button { width: 40px; font-size: 20px; }
.qty--sm input { width: 44px; font-size: 16px; }
.cline__rm { min-height: 44px; padding: 0 10px; border: 0; background: none; font: 500 14px/1 var(--ui); color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }
.cline__rm:hover { color: var(--warn); }
.cline__total { justify-self: end; padding-top: 10px; font: 700 17px/1.2 var(--ui); white-space: nowrap; }
.cart[aria-busy="true"] .cart__lines { opacity: .6; transition: opacity var(--t) var(--ease); }

/* the sum */
.cart__sum { position: sticky; top: calc(var(--hdr-stick) + 16px); display: grid; gap: 16px; padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); }
.cart__totals { display: grid; gap: 8px; margin: 0; }
.cart__totals div { display: flex; justify-content: space-between; gap: 12px; font-size: 15.5px; color: var(--ink-2); }
.cart__totals dd { margin: 0; font-weight: 600; color: var(--ink); }
.cart__totals .cart__grand { font: 600 17px/1.3 var(--ui); color: var(--ink); }
.cart__totals .cart__grand dd { font-size: 24px; font-weight: 700; }
.cart__sum .btn--primary { min-height: 52px; font-size: 16px; }
.cart__terms { display: grid; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.cart__terms b { font-weight: 600; color: var(--ink); }
.cart__more { justify-self: start; }
/* «Акція N+1», variants b and c: how far to the next free piece; c fills N+1 boxes, the last a gift: one row of them
   (6 with 5+1; 11 with 10+1 still fit a 360 px phone), two rows from 11+1 (cart.twig sets --cols, half of them) */
.cart-promo { display: grid; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--brown-tint); }
.cart-promo p { display: flex; align-items: center; gap: 10px; margin: 0; font: 600 14.5px/1.35 var(--ui); color: var(--ink); }
.cart-promo__note { font-size: 13.5px; line-height: 1.35; color: var(--ink-2); }
.cart-promo__boxes { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cart-promo__boxes[style] { grid-auto-flow: row; grid-template-columns: repeat(var(--cols), 1fr); }
.cart-promo__boxes li { display: grid; place-items: center; height: 26px; border-radius: 6px; border: 1.5px solid var(--line-2); background: var(--card); color: var(--brown); }
.cart-promo__boxes li.is-on { border-color: var(--brown); background: var(--brown); color: var(--card); }
.cart-promo__boxes li:last-child { border-style: dashed; border-color: var(--brown); }
.cart-promo__boxes li:last-child.is-on { border-style: solid; }
.cart-promo__boxes svg { width: 18px; height: 18px; }
.cart__update { margin-top: 16px; }

@media (max-width: 960px) {
  .cart { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .cart__sum { position: static; }
}
/* a short screen (a phone on its side): the header isn't sticky there, so the sum doesn't stick either (it would be taller than the screen) */
@media (max-height: 500px) { .cart__sum { position: static; } }
@media (max-width: 640px) {
  /* photo + text on top, quantity and total in the row below */
  .cline { grid-template-columns: 72px minmax(0, 1fr) auto; grid-template-areas: "img info info" "qty qty total"; gap: 12px 14px; }
  .cline__img { grid-area: img; }
  .cline__img img { width: 72px; height: 72px; }
  .cline__info { grid-area: info; }
  .cline__qty { grid-area: qty; display: flex; align-items: center; gap: 8px; justify-self: start; }
  .cline__total { grid-area: total; align-self: center; padding: 0; }
  .cart__sum { padding: 18px; }
}
