/* =========================================================
   shop.css — each business's own online shop (shop/layout and its pages, the branch picker and the closed page; the table QR menu too),
   redesigned to the SC wireframes. The shop's own colour (--shop-accent, set by the layout from the business's receipt
   colour, with the text that reads on it and the colour darkened enough to read on white) carries its buttons, its cart
   and its highlights; the rest is white, grouped by space: products as tiles on a soft fill, no card edges or lines.
   The class names are the pages' and their scripts' as they were; only how they look changed.
   ========================================================= */

:root {
    --shop-ink: #1f2933;
    --shop-ink-soft: #52606d;
    --shop-faint: #616e7c;
    --shop-quiet: #9aa5b1;
    --shop-fill: #f1f4f6;
    --shop-fill-hover: #e6ebee;
    --shop-chrome: #f6f8f9;
    --shop-border: #e6ebee;        /* (kept for old markup: used as a fill, not as lines) */
    --shop-surface: #ffffff;
    --shop-surface-2: #f1f4f6;
    --shop-bg: #ffffff;
    --shop-accent: #16181c;        /* overridden inline per business via receipt_color */
    --shop-accent-ink: #ffffff;    /* the text on the accent */
    --shop-accent-soft: color-mix(in srgb, var(--shop-accent) 11%, #ffffff);
    --shop-danger: #b91c1c;
    --shop-success: #047857;
    --shop-warning: #b45309;
    --shop-radius: 14px;
    --shop-radius-sm: 10px;
    --shop-shadow: 0 16px 40px -14px rgba(17, 24, 31, .24), 0 2px 6px rgba(17, 24, 31, .06);
    --shop-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --shop-font-display: var(--shop-font);
    --shop-gutter: 80px;
}
@media (max-width: 1099px) { :root { --shop-gutter: 32px; } }
@media (max-width: 767px)  { :root { --shop-gutter: 16px; } }

@font-face { font-family: 'Inter'; src: url('/fonts/inter/inter-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter/inter-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter/inter-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter/inter-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0; font-family: var(--shop-font); font-size: 14px; line-height: 1.5; background: var(--shop-bg); color: var(--shop-ink);
    -webkit-font-smoothing: antialiased;
    /* The footer at the foot of the screen on a short page (an empty cart), below the content on a long one. */
    display: flex; flex-direction: column; min-height: 100vh;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--shop-accent-text, var(--shop-accent)); outline-offset: 2px; }
.shop-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ── The header: the shop, where it is, then Track order, Sign in and the cart ─────────────────────── */
.shop-nav {
    position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .97);
    padding: 0 max(var(--shop-gutter), calc((100% - 1280px) / 2)); min-height: 72px;   /* (level with the page under it) */ display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.shop-nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.shop-nav-brand img, .shop-nav-initial { width: 36px; height: 36px; border-radius: 9px; object-fit: contain; flex-shrink: 0; }
.shop-nav-initial { display: inline-flex; align-items: center; justify-content: center; background: var(--shop-accent); color: var(--shop-accent-ink); font-weight: 700; font-size: 16px; }
.shop-nav-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.shop-nav-logo { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--shop-ink); }
.shop-nav-tag { font-size: 12px; color: var(--shop-ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-nav-right { display: flex; align-items: center; gap: 22px; flex-shrink: 0; }
.shop-nav-links { display: flex; align-items: center; gap: 22px; }
.shop-nav-track { color: var(--shop-ink); text-decoration: none; white-space: nowrap; }
.shop-nav-track:hover { color: var(--shop-accent-text, var(--shop-accent)); }
.shop-nav-cart {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 20px; flex-shrink: 0;
    background: var(--shop-accent); color: var(--shop-accent-ink); font-weight: 600; text-decoration: none;
}
.shop-nav-cart:hover { filter: brightness(.92); }
.shop-nav-cart svg { width: 16px; height: 16px; flex-shrink: 0; }
.cart-badge { font-weight: 700; }
.cart-badge::before { content: '· '; }

/* ── The page ─────────────────────────────────────────────────────────── */
.shop-wrap { width: 100%; max-width: calc(1280px + 2 * var(--shop-gutter)); margin: 0 auto; padding: 10px var(--shop-gutter) 48px; flex: 1 0 auto; }

/* ── Messages ─────────────────────────────────────────────────────────── */
.alert { padding: 12px 14px; border-radius: var(--shop-radius-sm); margin-bottom: 18px; font-size: 14px; line-height: 1.5; background: var(--shop-chrome); color: var(--shop-ink); }
.alert-success { background: #e8f5ef; color: #065f46; }
.alert-error, .alert-danger { background: #fdecec; color: #991b1b; }
/* The message after an action floats under the header and goes on its own (it no longer pushes the page down). */
.shop-toast {
    position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 60; margin: 0;
    max-width: calc(100vw - 32px); width: fit-content; box-shadow: var(--shop-shadow); transition: opacity .25s, transform .25s;
}
.shop-toast.shop-toast-hide { opacity: 0; transform: translate(-50%, -12px); }

/* ── Buttons: pills only as wide as their words, in the shop's colour ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: fit-content; height: 42px; padding: 0 18px;
    border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 600; text-decoration: none; white-space: nowrap;
    line-height: 1.2; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn-dark { background: var(--shop-accent); color: var(--shop-accent-ink); }
.btn-dark:hover { filter: brightness(.92); }
.btn-dark:disabled { background: var(--shop-fill); color: var(--shop-quiet); cursor: not-allowed; filter: none; }
.btn-outline { background: var(--shop-fill); color: var(--shop-ink); }
.btn-outline:hover { background: var(--shop-fill-hover); }
.btn-block { width: fit-content; }

/* ── Categories: chips to tap ─────────────────────────────────────────── */
.category-pills { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; margin: 0 0 26px; padding-bottom: 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.category-pills::-webkit-scrollbar { display: none; }
.category-pill {
    flex: 0 0 auto; display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 18px;
    background: var(--shop-fill); color: var(--shop-ink); text-decoration: none; white-space: nowrap;
}
.category-pill-dot { display: none; }
.category-pill:hover { background: var(--shop-fill-hover); }
.category-pill.active { background: var(--shop-ink); color: #fff; font-weight: 600; }

/* ── Bundles and deals: a band in the shop's soft colour ───────────────── */
.shop-deals { margin: 0 0 30px; padding: 22px 26px; border-radius: 16px; background: var(--shop-accent-soft); }
.shop-deals-title { margin: 0 0 14px; font-size: 12px; font-weight: 700; color: var(--shop-accent-text, var(--shop-accent)); }
.shop-deals .product-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.shop-deals .product-tile, .shop-deals .product-tile-photo { background-color: rgba(255, 255, 255, .7); }
/* Its title with the arrows and View all at its right; then one row that moves along (the cards as wide as the grid's, the rest a
   swipe or an arrow away). On View all (.is-all) the deals are a grid, as the products are. */
.shop-deals-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.shop-deals-head .shop-deals-title { margin: 0; }
.shop-deals-nav { display: flex; align-items: center; gap: 8px; }
.shop-deals-arrow {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
    border: 0; border-radius: 16px; background: rgba(255, 255, 255, .85); color: var(--shop-ink); cursor: pointer;
}
.shop-deals-arrow svg { width: 16px; height: 16px; }
.shop-deals-arrow:hover { background: #fff; }
.shop-deals-arrow[hidden] { display: none; }
.shop-deals-link { margin-left: 4px; font-size: 13px; white-space: nowrap; }
.shop-deals:not(.is-all) .shop-deals-track {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc((100% - 4 * 22px) / 5);
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.shop-deals:not(.is-all) .shop-deals-track::-webkit-scrollbar { display: none; }
.shop-deals:not(.is-all) .shop-deals-track > .product-card { scroll-snap-align: start; }

/* ── Products: tiles ──────────────────────────────────────────────────── */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 26px 22px; }
.product-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.product-card-link { text-decoration: none; color: inherit; display: block; }
.bundle-card-clickable { cursor: pointer; }
.product-tile {
    position: relative; height: 150px; border-radius: var(--shop-radius); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background-color: var(--shop-fill) !important;     /* (each product's colour block is now one quiet fill) */
    color: var(--shop-quiet); font-size: 34px; font-weight: 700;
}
.product-tile span { position: relative; z-index: 1; }
.product-tile-photo { width: 100%; height: 150px; object-fit: contain; display: block; border-radius: var(--shop-radius); background: var(--shop-fill); }
.product-card-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 0; }
.product-card-name { margin: 0; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-price { margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price-was { font-size: 12px; font-weight: 400; color: var(--shop-ink-soft); text-decoration: line-through; }
.price-off-badge { font-size: 12px; font-weight: 700; color: var(--shop-success); }
/* The business's own discounts (ShopOffers): which one a product has, the store-wide ones above the products, and a cart line's. */
.product-offer { margin: 0; font-size: 12px; line-height: 1.35; color: var(--shop-success); }
.shop-offers { margin: 0 0 22px; padding: 12px 18px; border-radius: 14px; background: color-mix(in srgb, var(--shop-success) 9%, #ffffff); color: var(--shop-ink); }
.shop-offer { margin: 0; font-size: 14px; line-height: 1.45; }
.shop-offer + .shop-offer { margin-top: 4px; }
.shop-offer strong { color: var(--shop-success); }
.shop-offer-name { font-weight: 600; }
.cart-line-offer { font-size: 12px; color: var(--shop-success); }
.cart-line-total .price-was { margin-left: 4px; }
.product-rating-line { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--shop-warning); }
.product-rating-line .stars-display { font-size: 12px; letter-spacing: 0; color: var(--shop-warning); }
.product-rating-line a { color: var(--shop-ink-soft); }
.stars-display { color: var(--shop-warning); letter-spacing: 1px; }
.stars-display .star-empty { color: var(--shop-fill-hover); }
/* Stock: words in a tone, not a badge ("In stock" only on a product's own page) */
.stock-badge { display: inline-flex; width: fit-content; margin: 0; font-size: 12px; font-weight: 700; }
.stock-badge.in { color: var(--shop-success); }
.stock-badge.low { color: var(--shop-warning); }
.stock-badge.out { color: var(--shop-danger); }
.product-card-body .stock-badge.in { display: none; }
.product-card-body form, .product-card-body > .btn { margin-top: 4px; }
.product-card-body .btn { height: 38px; padding: 0 16px; }
.product-card-body .btn-dark { background: var(--shop-fill); color: var(--shop-ink); }
.product-card-body .btn-dark:hover { background: var(--shop-accent); color: var(--shop-accent-ink); filter: none; }

.empty-state { text-align: center; padding: 72px 16px; color: var(--shop-ink-soft); }
.empty-state svg { width: 28px; height: 28px; opacity: .45; margin-bottom: 12px; }
.empty-state p { margin: 0; line-height: 1.5; }
.shop-wrap nav[role="navigation"] { margin-top: 32px; display: flex; justify-content: center; }

/* ── A product's page: its picture beside what it is, its price, delivery and Add to cart; its reviews below ── */
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; color: var(--shop-ink-soft); text-decoration: none; font-size: 13px; }
.back-link:hover { color: var(--shop-ink); }
.product-info { max-width: 520px; }
.product-category-link { display: inline-block; margin-bottom: 6px; color: var(--shop-ink-soft); font-size: 13px; text-decoration: none; }
.product-category-link:hover { color: var(--shop-ink); }
.product-detail { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 48px; align-items: start; }
/* A tablet keeps the picture beside the details, each half the page (in one column the 520px picture sat at the left with
   the page's other 220px empty beside it); a phone has them one under the other. */
@media (max-width: 899px) { .product-detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; } }
@media (max-width: 767px) { .product-detail { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.product-img-box {
    position: relative; aspect-ratio: 1 / 1; max-height: 520px; border-radius: 18px; overflow: hidden;
    display: flex; align-items: center; justify-content: center; background-color: var(--shop-fill) !important;
    color: var(--shop-quiet); font-size: 64px; font-weight: 700;
}
.product-img-box span { position: relative; z-index: 1; }
.product-img-box-photo { padding: 0; }
.product-img-box-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.product-gallery-swipe { display: none; }
@media (max-width: 767px) {
    .product-gallery-swipe { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; border-radius: 16px; background: var(--shop-fill); aspect-ratio: 1 / 1; }
    .product-gallery-swipe img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: start; }
    .product-gallery-swipe::-webkit-scrollbar { display: none; }
    .product-detail > div:first-child > .product-img-box-photo,
    .product-detail > div:first-child > .product-gallery-thumbs { display: none; }
}
.product-gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumb { width: 56px; height: 56px; object-fit: contain; background: var(--shop-fill); border-radius: 10px; cursor: pointer; border: 2px solid transparent; opacity: .8; }
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.active { border-color: var(--shop-accent); opacity: 1; }

.product-title, .cart-title { margin: 0 0 8px; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.3px; overflow-wrap: anywhere; }
.cart-title { margin-bottom: 20px; }
.product-price { margin: 6px 0 14px; font-size: 26px; font-weight: 700; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.product-price .price-was { font-size: 14px; }
.product-price .price-off-badge { font-size: 13px; }
.product-detail .product-rating-line { margin: 0 0 6px; font-size: 13px; }
.product-detail .product-rating-line .stars-display { font-size: 15px; }
.product-desc { margin: 10px 0 20px; color: var(--shop-ink-soft); line-height: 1.6; font-size: 15px; }
.product-detail .stock-badge { font-size: 13px; }
/* An option to choose before Add to cart ("Choose a size"), and the waiting list of a sold-out option */
.option-needed { margin: -4px 0 14px; font-size: 13px; font-weight: 600; color: var(--shop-danger); }
.option-waitlist-link { margin: 8px 0 0; }
.product-detail #add-to-cart-btn { height: 46px; padding: 0 22px; }

/* Delivery: where to and what it costs, on a soft fill */
.delivery-estimate { margin: 4px 0 22px; padding: 16px 18px; border-radius: var(--shop-radius); background: var(--shop-chrome); }
.delivery-estimate-label { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-weight: 600; }
.delivery-estimate-label svg { width: 16px; height: 16px; flex-shrink: 0; }
.delivery-option-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; }
.delivery-option-row svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--shop-ink-soft); }
.delivery-option-title { font-size: 14px; }
.delivery-option-title strong { color: var(--shop-ink); }
.delivery-option-sub { margin-top: 2px; font-size: 12px; color: var(--shop-ink-soft); }

/* On a phone, Add to cart stays at the foot of the screen */
.mobile-buy-bar { display: none; }
@media (max-width: 767px) {
    .mobile-buy-bar {
        display: flex; align-items: center; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--shop-chrome);
    }
    .mobile-buy-bar .mobile-buy-price { flex: 0 0 auto; font-weight: 700; font-size: 16px; white-space: nowrap; }
    .mobile-buy-bar .mobile-buy-note { flex: 1 1 auto; min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--shop-danger); }
    .mobile-buy-bar button { margin-left: auto; }
    .product-detail .qty-row + button#add-to-cart-btn { display: none; }
    body:has(.mobile-buy-bar) { padding-bottom: 72px; }
}

/* ── Fields ───────────────────────────────────────────────────────────── */
.form-field, .form-group { margin-bottom: 14px; }
.form-field label, .form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.form-control {
    width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: var(--shop-radius-sm);
    background: var(--shop-fill); color: var(--shop-ink); font: inherit; outline: none;
}
.form-control:focus { background: #fff; box-shadow: 0 0 0 2px var(--shop-accent); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2352606d' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea.form-control { min-height: 96px; resize: vertical; line-height: 1.5; }
.hint { color: var(--shop-ink-soft); font-size: 13px; line-height: 1.5; }
.qty-row { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.qty-row label { font-weight: 600; }
.qty-input { width: 84px; text-align: center; }
.waitlist-box { margin-top: 28px; padding: 22px; border-radius: var(--shop-radius); background: var(--shop-chrome); }
.waitlist-box h3 { margin: 0 0 6px; font-size: 16px; }
.waitlist-box p { margin: 0 0 16px; color: var(--shop-ink-soft); }
.waitlist-box .form-control, .return-request-box .form-control, .return-request-box .btn-outline { background: #fff; }   /* (a field or a button on the soft fill needs its own edge) */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .form-grid-2 { grid-template-columns: 1fr; } }
.radio-row, .checkbox-row { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; cursor: pointer; }
.radio-row input, .checkbox-row input { width: 16px; height: 16px; accent-color: var(--shop-accent); }
.form-group .radio-row, .form-group .checkbox-row { display: flex; margin-bottom: 8px; font-weight: 400; }   /* (not a field's heading) */
.section-title { margin: 32px 0 14px; font-size: 18px; font-weight: 700; }
.checkout-form { max-width: 520px; }
.checkout-error { color: var(--shop-danger); font-weight: 600; font-size: 13px; }

/* ── The cart: open rows, the totals under them ───────────────────────── */
.cart-table-wrap { margin-bottom: 24px; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { padding: 0 10px 8px; text-align: left; font-size: 12px; font-weight: 600; color: var(--shop-faint); }
.cart-table td { padding: 10px; vertical-align: middle; }
.cart-table :is(th, td):first-child { padding-left: 0; }
.cart-table :is(th, td):last-child { padding-right: 0; }
.cart-total-row td { padding: 6px 10px; color: var(--shop-ink-soft); }
.cart-total-row.grand td { padding-top: 12px; font-size: 16px; font-weight: 700; color: var(--shop-ink); }
.qty-form { display: inline-flex; align-items: center; gap: 6px; }
.qty-form input { width: 52px; height: 36px; padding: 4px; text-align: center; border: 0; border-radius: 18px; background: var(--shop-fill); font: inherit; }
.qty-form input:focus { outline: none; background: #fff; box-shadow: 0 0 0 2px var(--shop-accent); }
.qty-update-btn { border: 0; background: none; color: var(--shop-ink-soft); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 2px; text-decoration: underline; }
.qty-update-btn:hover { color: var(--shop-ink); }
.cart-remove-btn { border: 0; background: none; color: var(--shop-ink-soft); cursor: pointer; padding: 8px; display: inline-flex; border-radius: 999px; }
.cart-remove-btn:hover { background: #fdecec; color: var(--shop-danger); }
.cart-remove-btn svg { width: 16px; height: 16px; }
/* The cart's own lines: the name takes the room, the quantity, the total and remove keep to the right */
.cart-lines .cart-col-qty { width: 150px; }
.cart-lines .cart-col-total { width: 110px; }
.cart-lines .cart-col-remove { width: 48px; }
.cart-lines .cart-line-total, .cart-lines .cart-line-remove { text-align: right; }
/* The coupon, and the totals under it */
.cart-coupon { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; max-width: 420px; margin-bottom: 24px; }
.cart-coupon-field { flex: 1; min-width: 180px; }
.cart-coupon-input { text-transform: uppercase; }
.cart-coupon-input::placeholder { text-transform: none; }
.cart-coupon-msg { margin-top: 6px; }
.cart-totals { width: 100%; max-width: 520px; border-collapse: collapse; margin-bottom: 18px; }
.cart-totals td:first-child { padding-left: 0; }
.cart-totals td:last-child { padding-right: 0; text-align: right; }
.cart-totals .is-discount td { color: var(--shop-success); }
/* From a tablet up the totals' figures stand under the lines' totals (the lines are as wide as the cart; the totals stopped at
   520px, so a line's KSh 150 and the Total's KSh 150 were 160 to 240px apart): the totals end where a line's total ends,
   the remove column (48px) and the total's own 10px padding before the cart's edge. */
@media (min-width: 768px) { .cart-totals { max-width: none; width: calc(100% - 58px); } }
.cart-note { max-width: 520px; margin: 0 0 18px; }
.shop-link { color: var(--shop-accent-text, var(--shop-accent)); font-weight: 600; text-decoration: none; }
.shop-link:hover { text-decoration: underline; }

/* A page with what it is about at the left and its form at the side (the cart and its checkout) */
.shop-split { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 56px; align-items: start; }
.shop-side { display: flex; flex-direction: column; gap: 14px; }
.shop-side .section-title:first-child { margin-top: 0; }
@media (max-width: 1099px) { .shop-split { grid-template-columns: minmax(0, 1fr); gap: 32px; } .shop-side { max-width: 560px; } }

/* ── After ordering: what happened, where the order is, what is in it ─── */
.confirm-wrap { max-width: 720px; margin: 24px auto 0; text-align: left; }
.confirm-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-bottom: 14px; border-radius: 50%; }
.confirm-icon svg { width: 18px; height: 18px; }
.confirm-icon.success { background: #e8f5ef; color: var(--shop-success); }
.confirm-icon.pending { background: #fdf3e6; color: var(--shop-warning); }
.confirm-icon.error { background: #fdecec; color: var(--shop-danger); }
.confirm-title { margin: 0 0 8px; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.3px; }
.confirm-text { margin: 0 0 22px; color: var(--shop-ink-soft); line-height: 1.6; }
.confirm-text.is-warning { color: var(--shop-warning); }
.confirm-watch { margin: -10px 0 14px; font-weight: 600; color: var(--shop-accent-text, var(--shop-accent)); }   /* (waiting for the payment) */
.confirm-refresh, .confirm-block { margin-bottom: 26px; }
/* A note from the shop, in its own soft colour */
.shop-note { margin-bottom: 26px; background: var(--shop-accent-soft); }
/* A row of a field and its button, or of buttons */
.shop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.shop-actions .form-control { flex: 1 1 220px; width: auto; }
/* Paying by the M-Pesa QR code */
#qrSection { margin-bottom: 28px; }
#shopQrImage { display: block; width: 220px; max-width: 100%; height: auto; margin: 0 0 10px; border-radius: 12px; }
/* Where the order is: Paid › Being prepared › Shipped › Delivered */
.shop-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 24px; color: var(--shop-quiet); }
.shop-steps .is-done { color: var(--shop-success); font-weight: 600; }
.shop-steps .is-now { color: var(--shop-ink); font-weight: 700; }
.shop-steps .shop-step-sep { color: var(--shop-quiet); }
.order-summary { margin-bottom: 26px; text-align: left; }
.order-summary-title { display: block; margin-bottom: 8px; font-weight: 700; font-size: 16px; }
.order-summary-row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; }
.order-summary-row.total { padding-top: 12px; margin-top: 4px; font-weight: 700; font-size: 16px; }
.return-request-box { margin: 0 0 20px; padding: 18px; border-radius: var(--shop-radius); background: var(--shop-chrome); text-align: left; }
.return-request-status { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; }
.order-status-pill { display: inline; font-size: 13px; font-weight: 700; }
.order-status-pill.pending { color: var(--shop-warning); }
.order-status-pill.success { color: var(--shop-success); }
.order-status-pill.error { color: var(--shop-danger); }

/* ── Reviews ──────────────────────────────────────────────────────────── */
.review-section { margin-top: 44px; max-width: 760px; }
.review-summary { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; }
.review-summary .avg-rating { font-size: 22px; font-weight: 700; }
.review-summary .review-count { color: var(--shop-ink-soft); }
.review-list { display: flex; flex-direction: column; gap: 20px; margin-top: 8px; }
.review-item-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 4px; }
.review-author { font-weight: 600; }
.verified-purchase-badge { font-size: 12px; font-weight: 600; color: var(--shop-success); }
.review-date { color: var(--shop-ink-soft); font-size: 13px; }
.review-body { margin-top: 2px; line-height: 1.6; }
.review-reply { margin-top: 8px; padding: 10px 12px; border-radius: var(--shop-radius-sm); background: var(--shop-chrome); color: var(--shop-ink-soft); }
.no-reviews { color: var(--shop-ink-soft); padding: 8px 0; }
.star-picker { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; margin: 4px 0 16px; }
.star-picker input { position: absolute; opacity: 0; width: 0; height: 0; }
.star-picker label { font-size: 26px; line-height: 1; color: var(--shop-quiet); cursor: pointer; transition: color .12s; }
.star-picker input:checked ~ label, .star-picker label:hover, .star-picker label:hover ~ label { color: var(--shop-warning); }
.review-form-box { margin-top: 28px; }
.review-form-box h3 { margin: 0 0 4px; font-size: 16px; }
.review-form-box p.hint { margin-bottom: 14px; }

/* ── Choosing a branch (a shop on its own domain with several stores) ─── */
.picker-card { max-width: 560px; margin: 32px auto 0; }
.picker-title { margin: 0 0 6px; font-size: 26px; font-weight: 700; }
.picker-subtitle { margin: 0 0 22px; color: var(--shop-ink-soft); }
.store-list { display: flex; flex-direction: column; gap: 8px; }
.store-option { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--shop-radius-sm); background: var(--shop-chrome); color: var(--shop-ink); text-decoration: none; }
.store-option:hover { background: var(--shop-fill-hover); }
button.store-option { width: 100%; border: 0; font: inherit; text-align: left; cursor: pointer; }   /* (a branch is a button in its own form) */
.store-option img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; flex-shrink: 0; }
.store-option-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.store-option .name { font-weight: 600; }

/* ── The footer ───────────────────────────────────────────────────────── */
.shop-footer { margin-top: 40px; padding: 18px 16px 22px; text-align: center; color: var(--shop-quiet); font-size: 12px; }

/* ── Tablet and phone ─────────────────────────────────────────────────── */
@media (max-width: 1099px) and (min-width: 768px) { .product-grid, .shop-deals .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1099px) and (min-width: 768px) { .shop-deals:not(.is-all) .shop-deals-track { grid-auto-columns: calc((100% - 2 * 22px) / 3); } }
@media (max-width: 767px) {
    .shop-nav { min-height: 60px; gap: 12px; }
    .shop-nav-brand img, .shop-nav-initial { width: 30px; height: 30px; border-radius: 8px; }
    .shop-nav-logo { font-size: 15px; }
    .shop-nav-right, .shop-nav-links { gap: 14px; font-size: 13px; }
    .shop-nav-cart { height: 34px; padding: 0 12px; border-radius: 17px; }
    .shop-nav-cart svg { display: none; }
    .shop-wrap { padding: 4px var(--shop-gutter) 36px; }
    .product-grid, .shop-deals .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }   /* (the deals as the products: two a row) */
    .product-tile, .product-tile-photo { height: 120px; border-radius: 12px; }
    .shop-deals { padding: 14px; border-radius: 14px; }
    .shop-deals:not(.is-all) .shop-deals-track { grid-auto-columns: calc((100% - 14px) / 2); }   /* (two in sight, as the grid) */
    .shop-deals-arrow { width: 30px; height: 30px; }
    .shop-offers { margin-bottom: 16px; padding: 10px 14px; }
    .shop-offer { font-size: 13px; }
    .product-title, .cart-title, .confirm-title { font-size: 22px; }
    .product-price { font-size: 22px; }
    .form-control, .qty-form input { font-size: 16px; }   /* (iOS zooms the page on a field under 16px) */

    /* The cart's rows: the product over its price, quantity and remove */
    .cart-table, .cart-table thead, .cart-table tbody, .cart-table tfoot, .cart-table th, .cart-table td, .cart-table tr { display: block; }
    .cart-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .cart-table tbody tr { padding: 12px 0; }
    .cart-table tbody td { padding: 3px 0; position: relative; padding-left: 40%; text-align: right; min-height: 22px; }
    .cart-table tbody td::before { position: absolute; left: 0; width: 38%; text-align: left; font-size: 12px; color: var(--shop-faint); content: attr(data-label); }
    .cart-table tfoot tr { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
    .cart-table tfoot td { padding: 0; }
    /* The cart's own lines: the name over its price each, then the quantity, the total and remove on one line */
    .cart-lines tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 8px; padding: 10px 0; }
    .cart-lines tbody td { padding: 0; min-height: 0; text-align: left; }
    .cart-lines tbody td::before { content: none; }
    .cart-lines .cart-line-name { grid-column: 1 / -1; margin-bottom: 6px; }
    .cart-lines .cart-line-total { text-align: right; }
    .qty-update-btn { padding: 10px 8px; }
    .cart-remove-btn { padding: 12px; }
    .radio-row, .checkbox-row { padding: 8px 0; }
    .shop-toast { top: 70px; }
}
@media (max-width: 480px) { .category-pill { height: 34px; padding: 0 14px; font-size: 13px; } }

/* A narrow phone: the shop's name and the cart on top, the links (Change store, Track order, Sign in) in a row under them.
   In one row they cut the name to "Kial…" (and left none of it on the narrowest phones). */
@media (max-width: 480px) {
    .shop-nav { flex-wrap: wrap; row-gap: 4px; padding-top: 10px; padding-bottom: 8px; }
    .shop-nav-brand { flex: 1 1 0; }
    .shop-nav-right { display: contents; }
    .shop-nav-cart { order: 1; }
    .shop-nav-links { order: 2; flex: 1 1 100%; gap: 16px; }
    .shop-toast { top: 96px; }
}
