/* Cart page (shop/cart, assets/js/cart-page.js). Colours come from the checkout tokens' pattern (light + .dark).
   Mobile-first: each item is a card; from 900px the items become table rows and from 1100px the order summary
   sits beside them (sticky). */
:root {
    --vh-cart-text: #0f172a;
    --vh-cart-muted: #64748b;
    --vh-cart-border: #e5e7eb;
    --vh-cart-surface: #ffffff;
    --vh-cart-surface-2: #f8fafc;
    --vh-cart-primary: var(--c-primary-600, #2563eb);
    --vh-cart-primary-dark: var(--c-primary-700, #1d4ed8);
    --vh-cart-primary-soft: var(--c-primary-50, #eff6ff);
    --vh-cart-ok: #16a34a;
    --vh-cart-ok-soft: #f0fdf4;
    --vh-cart-bad: #dc2626;
    --vh-cart-bad-soft: #fef2f2;
    --vh-cart-warn: #b45309;
    --vh-cart-warn-soft: #fffbeb;
}
.dark {
    --vh-cart-text: #f9fafb;
    --vh-cart-muted: #9ca3af;
    --vh-cart-border: #374151;
    --vh-cart-surface: #111827;
    --vh-cart-surface-2: #1f2937;
    --vh-cart-primary-soft: rgba(59, 130, 246, .14);
    --vh-cart-ok: #4ade80;
    --vh-cart-ok-soft: rgba(22, 163, 74, .12);
    --vh-cart-bad: #f87171;
    --vh-cart-bad-soft: rgba(220, 38, 38, .14);
    --vh-cart-warn: #fcd34d;
    --vh-cart-warn-soft: rgba(245, 158, 11, .12);
}

.vh-cart { max-width: var(--shop-container, 80rem); margin: 0 auto; padding: 14px 1rem 40px; box-sizing: border-box; color: var(--vh-cart-text); }
@media (min-width: 640px) { .vh-cart { padding: 20px 1.5rem 56px; } }
@media (min-width: 1024px) { .vh-cart { padding: 24px 2rem 64px; } }
.vh-cart *, .vh-cart *::before, .vh-cart *::after { box-sizing: border-box; }
.vh-cart h2 { margin: 0; font-size: 18px; font-weight: 800; }

/* Head */
.vh-cart-crumbs { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13px; color: var(--vh-cart-muted); }
.vh-cart-crumbs a { color: inherit; text-decoration: none; }
.vh-cart-crumbs a:hover { color: var(--vh-cart-primary); }
.vh-cart-crumbs span { color: var(--vh-cart-text); }
.vh-cart-crumbs .bi { font-size: 10px; }
.vh-cart-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin-bottom: 18px; }
.vh-cart-head h1 { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.2; }
@media (min-width: 640px) { .vh-cart-head h1 { font-size: 30px; } }
.vh-cart-head h1 small { font-size: .6em; font-weight: 600; color: var(--vh-cart-muted); }
.vh-cart-head p { margin: 4px 0 0; font-size: 14px; color: var(--vh-cart-muted); }
.vh-cart-back { display: inline-flex; align-items: center; gap: 6px; color: var(--vh-cart-primary); font-size: 14px; font-weight: 600; text-decoration: none; }
.vh-cart-back:hover { text-decoration: underline; }

.vh-cart-note { display: flex; gap: 10px; margin-bottom: 16px; padding: 14px; border: 1px solid #fde68a; border-radius: 12px; background: var(--vh-cart-warn-soft); color: var(--vh-cart-warn); font-size: 13.5px; }
.vh-cart-note p, .vh-cart-note ul { margin: 2px 0 0; padding: 0; list-style: none; }
.vh-cart-note .is-up { color: var(--vh-cart-bad); } .vh-cart-note .is-down { color: var(--vh-cart-ok); }

/* Layout */
.vh-cart-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
/* Phones: items, summary, then suggestions. Wide screens: suggestions under the items, summary on the right. */
@media (min-width: 1100px) {
    .vh-cart-grid { grid-template-columns: minmax(0, 1fr) 380px; grid-template-rows: auto 1fr; grid-template-areas: "main side" "more side"; gap: 24px; }
    .vh-cart-main { grid-area: main; } .vh-cart-side { grid-area: side; } .vh-cart-more { grid-area: more; }
}
.vh-cart-main, .vh-cart-side { display: grid; gap: 18px; min-width: 0; }
@media (min-width: 1100px) { .vh-cart-side { position: sticky; top: 90px; } }
.vh-cart-box { min-width: 0; border: 1px solid var(--vh-cart-border); border-radius: 16px; background: var(--vh-cart-surface); }

/* Items: cards on phones, a table from 900px */
.vh-cart-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "check item acts" "check price price" "check qty total"; gap: 10px 12px; align-items: center; padding: 16px; border-bottom: 1px solid var(--vh-cart-border); }
.vh-cart-row--head { display: none; }
.vh-cart-line > .vh-cart-check { grid-area: check; align-self: start; padding-top: 4px; }
.vh-cart-item { grid-area: item; }
.vh-cart-price { grid-area: price; }
.vh-cart-qty { grid-area: qty; }
.vh-cart-total { grid-area: total; justify-self: end; }
.vh-cart-acts { grid-area: acts; align-self: start; }
@media (min-width: 900px) {
    .vh-cart-row { grid-template-columns: 28px minmax(0, 2.6fr) minmax(0, 1fr) 132px minmax(0, 1fr) 96px; grid-template-areas: "check item price qty total acts"; gap: 14px; padding: 16px 20px; }
    .vh-cart-row--head { display: grid; grid-template-areas: none; border-radius: 16px 16px 0 0; background: var(--vh-cart-surface-2); color: var(--vh-cart-muted); font-size: 13px; font-weight: 600; }
    .vh-cart-row--head > .vh-cart-check { grid-column: 1 / 3; }
    .vh-cart-row--head .vh-cart-col--product { display: none; }
    .vh-cart-line > .vh-cart-check { align-self: center; padding-top: 0; }
    .vh-cart-total { justify-self: start; text-align: left; }
    .vh-cart-total__label { display: none; }
    .vh-cart-acts { align-self: center; }
    .vh-cart-col--act { text-align: center; }
}
.vh-cart-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; color: var(--vh-cart-text); font-weight: 600; }
.vh-cart-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--vh-cart-primary); cursor: pointer; }
.vh-cart-line.is-unavailable .vh-cart-item__img img { opacity: .5; filter: grayscale(.6); }

.vh-cart-item { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vh-cart-item__img { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 76px; height: 76px; overflow: hidden; border: 1px solid var(--vh-cart-border); border-radius: 12px; background: var(--vh-cart-surface-2); color: var(--vh-cart-muted); }
@media (min-width: 640px) { .vh-cart-item__img { width: 96px; height: 96px; } }
.vh-cart-item__img img { width: 100%; height: 100%; object-fit: contain; }
.vh-cart-item__body { display: grid; gap: 4px; min-width: 0; }
.vh-cart-item__name { color: var(--vh-cart-text); font-size: 15px; font-weight: 700; line-height: 1.3; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vh-cart-item__name:hover { color: var(--vh-cart-primary); }
.vh-cart-item__variant { font-size: 13px; color: var(--vh-cart-muted); }
.vh-cart-stock { display: inline-flex; align-items: center; gap: 4px; justify-self: start; padding: 2px 8px; border-radius: 999px; background: var(--vh-cart-ok-soft); color: var(--vh-cart-ok); font-size: 12px; font-weight: 600; }
.vh-cart-stock.is-low { background: var(--vh-cart-warn-soft); color: var(--vh-cart-warn); }
.vh-cart-stock.is-out { background: var(--vh-cart-bad-soft); color: var(--vh-cart-bad); }

.vh-cart-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 15px; }
@media (min-width: 900px) { .vh-cart-price { display: grid; justify-items: start; gap: 2px; } }
.vh-cart-price s { color: var(--vh-cart-muted); font-size: 13px; }
.vh-cart-off { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 6px; background: var(--vh-cart-bad-soft); color: var(--vh-cart-bad); font-size: 11.5px; font-weight: 700; }

.vh-cart-qty { display: inline-flex; align-items: stretch; justify-self: start; overflow: hidden; border: 1px solid var(--vh-cart-border); border-radius: 10px; background: var(--vh-cart-surface); }
.vh-cart-qty button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 40px; border: 0; background: transparent; color: var(--vh-cart-text); font-size: 16px; cursor: pointer; }
.vh-cart-qty button:hover { background: var(--vh-cart-surface-2); }
.vh-cart-qty button:disabled { opacity: .4; cursor: not-allowed; }
.vh-cart-qty input { width: 46px; border: 0; border-left: 1px solid var(--vh-cart-border); border-right: 1px solid var(--vh-cart-border); background: transparent; color: var(--vh-cart-text); font: inherit; font-weight: 700; text-align: center; -moz-appearance: textfield; }
.vh-cart-qty input::-webkit-outer-spin-button, .vh-cart-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.vh-cart-line.is-saving .vh-cart-qty { opacity: .6; }

.vh-cart-total { display: grid; gap: 1px; text-align: right; }
.vh-cart-total__label { font-size: 12px; color: var(--vh-cart-muted); }
.vh-cart-total strong { font-size: 16px; }

.vh-cart-acts { display: flex; justify-content: flex-end; gap: 6px; }
@media (min-width: 900px) { .vh-cart-acts { justify-content: center; } }
.vh-cart-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--vh-cart-border); border-radius: 10px; background: var(--vh-cart-surface); color: var(--vh-cart-text); font-size: 16px; cursor: pointer; transition: border-color .15s, color .15s; }
.vh-cart-icon:hover { border-color: var(--vh-cart-primary); color: var(--vh-cart-primary); }
.vh-cart-icon--danger { background: var(--vh-cart-bad-soft); border-color: transparent; color: var(--vh-cart-bad); }
.vh-cart-icon--danger:hover { border-color: var(--vh-cart-bad); color: var(--vh-cart-bad); }
.vh-cart-icon .bi-heart-fill { color: var(--vh-cart-bad); }

.vh-cart-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
@media (min-width: 900px) { .vh-cart-foot { padding: 16px 20px; } }
.vh-cart-foot__acts { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.vh-cart-link { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--vh-cart-text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.vh-cart-link:hover { color: var(--vh-cart-primary); }

/* Buttons */
.vh-cart-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border: 1px solid var(--vh-cart-primary); border-radius: 10px; background: var(--vh-cart-primary); color: #fff; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s; }
.vh-cart-btn:hover { background: var(--vh-cart-primary-dark); }
.vh-cart-btn--ghost { background: var(--vh-cart-surface); color: var(--vh-cart-text); border-color: var(--vh-cart-border); }
.vh-cart-btn--ghost:hover { background: var(--vh-cart-surface-2); }
.vh-cart-btn--ghost.is-dirty { border-color: var(--vh-cart-primary); color: var(--vh-cart-primary); }
.vh-cart-btn--dark { background: var(--vh-cart-text); border-color: var(--vh-cart-text); color: var(--vh-cart-surface); }
.vh-cart-btn--dark:hover { background: var(--vh-cart-text); opacity: .9; }
.vh-cart-btn--block { width: 100%; }
.vh-cart-btn--lg { min-height: 50px; font-size: 16px; }

/* Summary */
.vh-cart-sum { display: grid; gap: 14px; padding: 20px; }
.vh-cart-sum__rows { display: grid; gap: 12px; margin: 0; font-size: 15px; }
.vh-cart-sum__rows > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vh-cart-sum__rows dt { color: var(--vh-cart-text); }
.vh-cart-sum__rows dd { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; text-align: right; }
.vh-cart-sum__rows dd form { margin: 0; }
.vh-cart-sum__rows .is-save dd { color: var(--vh-cart-ok); }
.vh-cart-sum__rows .is-free { color: var(--vh-cart-ok); }
.vh-cart-sum__rows .is-later { color: var(--vh-cart-muted); font-weight: 500; font-size: 13.5px; }
.vh-cart-x { display: inline-flex; padding: 2px; border: 0; background: none; color: var(--vh-cart-muted); font-size: 12px; cursor: pointer; }
.vh-cart-x:hover { color: var(--vh-cart-bad); }
.vh-cart-freebar { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--vh-cart-primary-soft); color: var(--vh-cart-primary); font-size: 13px; font-weight: 600; }
.vh-cart-coupon { display: flex; gap: 8px; }
.vh-cart-coupon__field { position: relative; display: flex; flex: 1; align-items: center; min-width: 0; }
.vh-cart-coupon__field .bi { position: absolute; left: 12px; color: var(--vh-cart-muted); }
.vh-cart-coupon__field input { width: 100%; min-width: 0; height: 42px; padding: 0 12px 0 36px; border: 1px solid var(--vh-cart-border); border-radius: 10px; background: var(--vh-cart-surface); color: var(--vh-cart-text); font: inherit; font-size: 14px; text-transform: uppercase; }
.vh-cart-coupon__field input:focus { outline: 2px solid var(--vh-cart-primary); outline-offset: -1px; }
.vh-cart-msg { margin: -6px 0 0; font-size: 13px; }
.vh-cart-msg.is-bad { color: var(--vh-cart-bad); } .vh-cart-msg.is-ok { color: var(--vh-cart-ok); }
.vh-cart-sum__total { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--vh-cart-border); }
.vh-cart-sum__total span { font-size: 17px; font-weight: 700; }
.vh-cart-sum__total strong { font-size: 26px; font-weight: 800; }
.vh-cart-sum__note { margin: -10px 0 0; text-align: right; font-size: 12.5px; color: var(--vh-cart-muted); }
.vh-cart-pay { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--vh-cart-surface-2); font-size: 13px; color: var(--vh-cart-text); text-align: center; }
.vh-cart-pay span { color: var(--vh-cart-muted); }
.vh-cart-trust { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--vh-cart-muted); }
.vh-cart-trust li { display: inline-flex; align-items: center; gap: 5px; }
.vh-cart-trust .bi { color: var(--vh-cart-text); font-size: 15px; }

/* Offer */
.vh-cart-offer { position: relative; display: grid; gap: 4px; justify-items: start; overflow: hidden; min-height: 190px; padding: 22px 20px; border-radius: 16px; background: linear-gradient(135deg, #dbeafe, #eff6ff 55%, #e0e7ff); color: #0f172a; text-decoration: none; }
.dark .vh-cart-offer { background: linear-gradient(135deg, #1e3a8a, #1e293b); color: #f8fafc; }
.vh-cart-offer__kicker { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--vh-cart-primary); }
.vh-cart-offer__head { font-size: 26px; font-weight: 800; line-height: 1.15; color: var(--vh-cart-primary); }
.vh-cart-offer__title { font-size: 16px; font-weight: 700; }
.vh-cart-offer__text { max-width: 62%; font-size: 13px; opacity: .85; }
.vh-cart-offer__btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 9px 16px; border-radius: 9px; background: #0f172a; color: #fff; font-size: 14px; font-weight: 600; }
.vh-cart-offer:hover .vh-cart-offer__btn { background: var(--vh-cart-primary); }
.vh-cart-offer__pics { position: absolute; right: 10px; bottom: 10px; display: flex; align-items: flex-end; }
.vh-cart-offer__pics img { width: 70px; height: 70px; margin-left: -18px; object-fit: contain; border-radius: 12px; background: rgba(255, 255, 255, .7); box-shadow: 0 6px 16px rgba(15, 23, 42, .12); }

/* Suggestions (cards: .vh-pcc from pb-sections.css) */
.vh-cart-more { display: grid; gap: 14px; padding: 18px; }
.vh-cart-more__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vh-cart-more__all { display: inline-flex; align-items: center; gap: 4px; color: var(--vh-cart-primary); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.vh-cart-more__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
/* Five suggestions (config cart_page.suggestions.limit): 2 a row on phones, 3 on tablets, all 5 in one row on wide screens. */
@media (min-width: 640px) { .vh-cart-more__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .vh-cart-more__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.vh-cart-more__grid > * { min-width: 0; }
.vh-cart-more .vh-pcc__cart { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Empty */
.vh-cart-empty { display: grid; justify-items: center; gap: 10px; padding: 60px 16px; text-align: center; border: 1px solid var(--vh-cart-border); border-radius: 16px; background: var(--vh-cart-surface); }
.vh-cart-empty__icon { display: inline-flex; align-items: center; justify-content: center; width: 84px; height: 84px; border-radius: 50%; background: var(--vh-cart-surface-2); color: var(--vh-cart-muted); font-size: 38px; }
.vh-cart-empty p { margin: 0 0 6px; color: var(--vh-cart-muted); }

/* Promises strip */
.vh-cart-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 26px 0 0; padding: 18px; list-style: none; border: 1px solid var(--vh-cart-border); border-radius: 16px; background: var(--vh-cart-surface); }
@media (min-width: 900px) { .vh-cart-features { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 22px 26px; } }
.vh-cart-features li { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vh-cart-features .bi { flex-shrink: 0; font-size: 30px; color: var(--vh-cart-primary); }
.vh-cart-features span { display: grid; gap: 2px; min-width: 0; }
.vh-cart-features strong { font-size: 14.5px; }
.vh-cart-features small { font-size: 12.5px; color: var(--vh-cart-muted); }

/* Delivery location (order summary) */
.vh-cart-deliver { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--vh-cart-border); border-radius: 12px; background: var(--vh-cart-surface-2); }
.vh-cart-deliver__head { display: flex; align-items: flex-start; gap: 10px; }
.vh-cart-deliver__head > .bi { flex-shrink: 0; margin-top: 2px; font-size: 18px; color: var(--vh-cart-primary); }
.vh-cart-deliver__to { display: grid; gap: 2px; flex: 1; min-width: 0; font-size: 14px; }
.vh-cart-deliver__to small { font-size: 12.5px; color: var(--vh-cart-muted); }
.vh-cart-deliver__to strong { overflow-wrap: anywhere; }
.vh-cart-deliver__change { flex-shrink: 0; padding: 0; border: 0; background: none; color: var(--vh-cart-primary); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.vh-cart-deliver__change:hover { text-decoration: underline; }
.vh-cart-deliver__form { display: flex; gap: 8px; }
.vh-cart-deliver__form input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid var(--vh-cart-border); border-radius: 10px; background: var(--vh-cart-surface); color: var(--vh-cart-text); font: inherit; font-size: 14px; letter-spacing: .04em; }
.vh-cart-deliver__form input:focus { outline: 2px solid var(--vh-cart-primary); outline-offset: -1px; }
.vh-cart-deliver__res { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13.5px; font-weight: 600; }
.vh-cart-deliver__res.is-ok { color: var(--vh-cart-ok); }
.vh-cart-deliver__res.is-bad { color: var(--vh-cart-bad); }
.vh-cart-deliver__meta { margin: -4px 0 0; font-size: 12.5px; color: var(--vh-cart-muted); }
.vh-cart-deliver .vh-cart-msg { margin: 0; }
