/* QQuack Cart page — loads after base.css; cart data comes from static/js/cart.js */
.cart-container { width: min(1240px, 92%); margin: 0 auto; padding-bottom: 96px; }
.cart-breadcrumb { display: flex; align-items: center; gap: 10px; padding: 28px 0 20px; color: #aab3bb; font-size: 14px; }
.cart-breadcrumb a:hover { color: var(--yellow); }
.cart-breadcrumb i { font-size: 10px; color: #5d676e; }
.cart-breadcrumb span { color: #fff; font-weight: 600; }

.cart-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.cart-head h1 { margin: 0 0 6px; font: 900 clamp(46px, 5.4vw, 72px)/.95 var(--display); font-style: italic; }
.cart-head h1 em { color: var(--yellow); font-style: inherit; }
.cart-head p { margin: 0; color: #aab3bb; font-size: 17px; }
.cart-steps { display: flex; align-items: center; gap: 10px; margin: 0; padding: 0; list-style: none; }
.cart-steps li { display: flex; align-items: center; gap: 8px; color: #6b757c; font-size: 14px; font-weight: 700; }
.cart-steps li + li:before { content: ""; width: 28px; height: 2px; margin-right: 2px; background: #2c363d; }
.cart-steps span { display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid #2c363d; border-radius: 50%; font-size: 13px; }
.cart-steps li.done { color: #fff; }
.cart-steps li.done span { border-color: var(--yellow); background: var(--yellow); color: #111; }

/* Empty */
.cart-empty { max-width: 560px; margin: 24px auto 0; padding: 56px 28px; border: 1px dashed #2c363d; border-radius: 22px; text-align: center; }
.empty-icon { display: inline-grid; place-items: center; width: 96px; height: 96px; margin-bottom: 22px; border-radius: 50%; background: #ffd90014; border: 1px solid #ffd90044; color: var(--yellow); font-size: 38px; box-shadow: 0 0 40px -10px #ffd90066; }
.cart-empty h2 { margin: 0 0 10px; font: 900 40px/1 var(--display); font-style: italic; }
.cart-empty p { margin: 0 0 26px; color: #aab3bb; font-size: 16px; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* Layout */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
.cart-layout[hidden], .cart-empty[hidden] { display: none; }
.cart-items { min-width: 0; }
.items-head { display: grid; grid-template-columns: minmax(0, 1fr) 140px 150px; gap: 16px; padding: 0 20px 12px; border-bottom: 1px solid #222c33; color: #8d979e; font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.items-head span:last-child { text-align: right; }
#cart-list { margin: 0; padding: 0; list-style: none; }
.cart-item { display: grid; grid-template-columns: minmax(0, 1fr) 140px 150px; align-items: center; gap: 16px; padding: 20px; border-bottom: 1px solid #182127; animation: cart-in .3s ease; }
.item-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.item-img { flex: 0 0 104px; height: 104px; display: grid; place-items: center; border-radius: 14px; background: radial-gradient(ellipse at 50% 85%, #e8ebee, #fff 70%); }
.item-img img { width: 86%; height: 86%; object-fit: contain; }
.item-info { min-width: 0; }
.item-info .tyre-brand { min-height: 0; font-size: 16px; }
.item-info h3 { margin: 6px 0 2px; font-size: 18px; line-height: 1.25; }
.item-info h3 a:hover { color: var(--yellow); }
.item-info p { margin: 0; color: #8d979e; font-size: 14px; }
.item-info .item-unit { margin-top: 4px; color: #c7ced3; }
.item-unit s { margin-left: 6px; color: #6b757c; }
.cart-item .qty { display: inline-flex; align-items: center; justify-self: start; border: 1px solid #2c363d; border-radius: 12px; background: #0e1418; }
.cart-item .qty button { width: 40px; height: 44px; border: 0; background: none; color: #fff; font-size: 13px; cursor: pointer; transition: color .2s; }
.cart-item .qty button:hover:not(:disabled) { color: var(--yellow); }
.cart-item .qty button:disabled { color: #3e484f; cursor: default; }
.cart-item .qty span { min-width: 28px; text-align: center; font-size: 17px; font-weight: 800; }
.item-total { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.item-total strong { font-size: 20px; }
.item-remove { border: 0; background: none; color: #8d979e; font: 600 13px var(--body); cursor: pointer; transition: color .2s; }
.item-remove:hover { color: #ff7a7a; }
.items-foot { display: flex; justify-content: space-between; gap: 16px; padding: 18px 20px 0; }
.link-back { color: var(--yellow); font-size: 15px; font-weight: 700; }
.link-back:hover { text-decoration: underline; }
.link-clear { border: 0; background: none; color: #8d979e; font: 600 14px var(--body); cursor: pointer; }
.link-clear:hover { color: #ff7a7a; }

/* Options */
.cart-options { margin-top: 32px; padding: 26px; border: 1px solid #222c33; border-radius: 18px; background: #0b1013; }
.cart-options h2 { margin: 0 0 16px; font-size: 19px; }
.cart-options h2 i { color: var(--yellow); margin-right: 8px; }
.option-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.option-cards input { position: absolute; opacity: 0; pointer-events: none; }
.option-cards span { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; height: 100%; padding: 16px; border: 1px solid #2c363d; border-radius: 14px; background: #0e1418; cursor: pointer; transition: border-color .2s, background .2s; }
.option-cards span i { grid-row: span 2; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #ffd90014; color: var(--yellow); font-size: 17px; }
.option-cards strong { font-size: 15px; }
.option-cards small { grid-column: 2; color: #8d979e; font-size: 13px; }
.option-cards b { grid-column: 3; grid-row: 1 / span 2; color: var(--yellow); font-size: 15px; }
.option-cards label:hover span { border-color: #ffd90088; }
.option-cards input:checked + span { border-color: var(--yellow); background: #ffd90010; box-shadow: inset 0 0 0 1px var(--yellow); }
.option-cards input:focus-visible + span { outline: 2px solid var(--yellow); outline-offset: 2px; }
.fitting { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 16px; border: 1px solid #2c363d; border-radius: 14px; cursor: pointer; }
.fitting input { position: absolute; opacity: 0; pointer-events: none; }
.fit-ui { position: relative; flex: 0 0 44px; height: 26px; border: 2px solid #46525a; border-radius: 999px; transition: background .2s, border-color .2s; }
.fit-ui:after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #8d979e; transition: transform .2s, background .2s; }
.fitting input:checked + .fit-ui { background: var(--yellow); border-color: var(--yellow); }
.fitting input:checked + .fit-ui:after { transform: translateX(18px); background: #111; }
.fitting input:focus-visible + .fit-ui { outline: 2px solid var(--yellow); outline-offset: 3px; }
.fit-text { display: flex; flex-direction: column; }
.fit-text strong { font-size: 15px; }
.fit-text small { color: #8d979e; font-size: 13px; }

/* Summary */
.cart-summary { position: sticky; top: 100px; padding: 28px; border: 1px solid #ffd90044; border-radius: 20px; background: radial-gradient(320px 180px at 100% 0%, #ffd9001a, transparent 70%), linear-gradient(160deg, #121b21, #080c0f); box-shadow: 0 30px 60px -30px #000; }
.cart-summary h2 { margin: 0 0 18px; font: 900 32px/1 var(--display); font-style: italic; }
.cart-summary dl { margin: 0; }
.cart-summary dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 15px; }
.cart-summary dl > div[hidden] { display: none; }
.cart-summary dt { color: #aab3bb; }
.cart-summary dd { margin: 0; font-weight: 700; }
.cart-summary .savings dd, .cart-summary #s-promo { color: #5fe08a; }
.cart-summary dd.muted { color: #6b757c; font-weight: 500; font-size: 14px; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; margin: 12px 0 20px; padding-top: 16px; border-top: 1px solid #ffffff1a; }
.summary-total span { font-size: 16px; font-weight: 700; }
.summary-total strong { color: var(--yellow); font-size: 32px; font-weight: 800; letter-spacing: -.5px; }
.promo { display: flex; gap: 8px; }
.promo input { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid #2c363d; border-radius: 10px; background: #0e1418; color: #fff; font: 600 15px var(--body); text-transform: uppercase; outline: none; }
.promo input::placeholder { text-transform: none; color: #6b757c; }
.promo input:focus { border-color: var(--yellow); }
.promo .button { padding: 12px 16px; font-size: 14px; }
.promo-msg { min-height: 20px; margin: 8px 0 14px; font-size: 13px; }
.promo-msg.ok { color: #5fe08a; }
.promo-msg.bad { color: #ff8a8a; }
.checkout { width: 100%; padding: 17px; font-size: 17px; }
.checkout-note { margin: 10px 0 18px; color: #8d979e; font-size: 13px; text-align: center; }
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; padding: 16px 0 0; border-top: 1px solid #ffffff14; list-style: none; }
.trust li { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #aab3bb; font-size: 12px; text-align: center; }
.trust i { color: var(--yellow); font-size: 18px; }

@keyframes cart-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cart-item { animation: none; } }

/* Responsive */
@media (max-width: 1000px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr); }
  .cart-summary { position: static; }
}
@media (max-width: 700px) {
  .cart-container { width: calc(100% - 32px); padding-bottom: 64px; }
  .cart-head { margin-bottom: 20px; }
  .cart-steps li { font-size: 12px; }
  .cart-steps li + li:before { width: 14px; }
  .items-head { display: none; }
  .cart-item { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main main" "qty total"; gap: 14px; padding: 18px 0; }
  .item-main { grid-area: main; gap: 14px; }
  .item-img { flex-basis: 84px; height: 84px; }
  .item-info h3 { font-size: 16px; }
  .cart-item .qty { grid-area: qty; }
  .item-total { grid-area: total; }
  .items-foot { padding: 16px 0 0; }
  .option-cards { grid-template-columns: 1fr; }
  .cart-options, .cart-summary { padding: 20px 16px; }
}
