/* ============================================================
   Webshop checkout page styling

   Moved from static/webshop/css/style.css (regels 1850-3170, sections
   16-23) als onderdeel van PLAN_FRONTEND_GODFILES COMMIT_10a.

   Bevat: checkout layout, fulfilment, calendar, location tiles, form
   fields, sidebar, minimum order warning + pay button, mobile pay bar +
   cart drawer.

   Geladen via templates/webshop/checkout.html in {% block extra_css %}.
   Safari 14 baseline gerespecteerd (geen modern CSS).
   ============================================================ */

/* ============================================================
   16. CHECKOUT LAYOUT
   ============================================================ */
.checkout-page {
    display: grid;
    grid-template-columns: 1fr minmax(0, 640px) 1fr;
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 24px 140px;
    position: relative;
    gap: 20px;
}
.checkout-page::before {
    content: '';
}
.checkout-main { min-width: 0; }
.checkout-scroll-section { scroll-margin-top: 160px; }
.checkout-title {
    font-family: var(--font-heading);
    font-size: 32px;
    color: var(--color-text);
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}

/* Checkout form validation error */
.checkout-form-error {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--color-error);
    background: var(--red-light-bg, #fef2f2);
    border: 1px solid var(--color-error);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 16px;
    text-align: center;
}
/* Zachte "kies opnieuw"-notice: de gekozen dag viel weg (andere locatie,
   gewijzigd mandje of cutoff). Geen fout -> amber i.p.v. rood. */
.date-rechoose {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--color-accent);
    background: var(--color-accent-light-bg);
    border: 1px solid var(--color-accent-border);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 16px;
    text-align: center;
}

/* Checkout API error box */
.checkout-error-box {
    background: var(--red-light-bg, #fef2f2);
    border: 1px solid var(--color-error);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-top: 12px;
}
.checkout-error-msg {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--color-error);
    font-weight: 600;
}

/* Checkout sticky topbar */
.checkout-topbar {
    position: sticky;
    top: 60px;
    z-index: 49;
    background: var(--color-background);
    margin-bottom: 16px;
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    flex-direction: column;
    gap: 0;
}
@media (max-width: 639px) {
    .checkout-topbar {
        top: 52px;
        margin-top: -1px;
        padding-top: 1px;
    }
}

/* Checkout back link */
.checkout-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--color-text-light);
    text-decoration: none;
    padding: 8px 0;
}
.checkout-back-link:hover {
    color: var(--color-accent);
}

/* Checkout sections */
.section {
    background: var(--color-background-light);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px var(--shadow-color);
}
.section-label {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--color-text-light);
    margin-bottom: 14px;
}

/* ============================================================
   17. CHECKOUT FULFILMENT
   ============================================================ */
.fulfilment-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fulfilment-option {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    text-align: center;
    background: var(--color-background-light);
    transition: all 0.2s ease;
}
.fulfilment-option:hover { border-color: var(--color-accent-border); }
.fulfilment-option.selected { border-color: var(--color-accent); background: var(--color-accent-light-bg); box-shadow: 0 0 0 1px var(--color-accent); }
.fulfilment-icon { width: 28px; height: 28px; margin: 0 auto 8px; color: var(--color-text-light); transition: color 0.2s; }
.fulfilment-option.selected .fulfilment-icon { color: var(--color-accent); }
.fulfilment-name {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
}
.fulfilment-desc {
    font-family: var(--font-ui);
    font-size: 11px;
    color: var(--color-text-light);
}
.tile-hint {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    line-height: 1.4;
}
.tile-hint-success {
    background: var(--green-light-bg, rgba(46, 125, 50, 0.08));
    color: var(--color-success, #2e7d32);
}
.tile-hint-progress {
    background: var(--color-accent-light-bg, rgba(183, 153, 98, 0.1));
    color: var(--color-accent);
}

/* ============================================================
   18. CHECKOUT CALENDAR
   ============================================================ */
.calendar {
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius);
    background: var(--color-background-light);
    overflow: hidden;
}
.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px dashed var(--color-border);
}
.cal-month {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
}
.cal-nav {
    width: 32px; height: 32px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-background-light);
    font-size: 18px;
    color: var(--color-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
}
.cal-nav:hover:not(:disabled) {
    border-color: var(--color-accent);
    color: var(--color-accent);
}
.cal-nav:disabled {
    opacity: 0.3;
    cursor: default;
}

.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); padding: 10px 12px 6px; }
.cal-weekday {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-light);
    text-align: center;
}

/* minmax(0, 1fr) + min-width:0: laat de 7 kolommen krimpen op smalle schermen.
   Zonder dit forceert min-width:44px een intrinsic-minimum breder dan de box en
   knipt overflow:hidden op .calendar de zondag-kolom af (koppen krimpen wel mee). */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 4px 12px 12px; gap: 5px; }
.cal-day {
    min-height: 44px; min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-ui);
    font-size: 0.95em;
    font-weight: 500;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--color-border);
    cursor: default;
    transition: all 0.2s ease;
}
.cal-day.other-month { opacity: 0.35; }
.cal-day.other-month.available {
    opacity: 1;
    color: var(--color-text-light);
    background: var(--color-accent-light-bg);
    cursor: pointer;
}
.cal-day.available {
    cursor: pointer;
    color: var(--color-text);
    font-weight: 600;
    background: var(--color-accent-light-bg);
}
.cal-day.available:hover {
    background: var(--color-accent-border);
    color: var(--color-text);
}
.cal-day.selected {
    background: var(--color-accent);
    color: var(--color-text-button);
    font-weight: 700;
    box-shadow: 0 1px 3px var(--shadow-color);
}
.cal-day.selected:hover {
    background: var(--color-accent);
    filter: brightness(1.08);
}
.cal-day.today:not(.selected) {
    box-shadow: inset 0 0 0 1.5px var(--color-accent);
}
/* Gesloten dag (sluiting): rood + diagonale streep, niet-kiesbaar. Visueel anders
   dan de grijze niet-beschikbare dag. Reden staat in het title-attribuut. Vaste
   semantische rood-tinten (geen brandkit-accent); contrast tekst/bg >= 4.5:1. */
.cal-day.closed {
    background: #f9d9d3;
    color: #a32b1c;
    font-weight: 600;
    /* Rode rand via inset box-shadow (zoals .today), zodat de celgrootte niet verspringt. */
    box-shadow: inset 0 0 0 1.5px #c0392b;
    cursor: not-allowed;
    opacity: 1;
    position: relative;
}
.cal-day.closed::after {
    content: "";
    position: absolute;
    width: 58%;
    height: 1.5px;
    background: #c0392b;
    transform: rotate(-45deg);
    opacity: 0.55;
}
.cal-day-num {
    line-height: 1;
}
.cal-day-label {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1;
    margin-top: 1px;
    color: inherit;
}

/* ============================================================
   19. CHECKOUT LOCATION TILES
   ============================================================ */
.location-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; transition: grid-template-columns 0.3s ease; }
.location-tile {
    position: relative;
    border: 2px solid var(--color-border-light);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    background: var(--color-background-light);
    transition: all 0.3s ease, max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease, border-width 0.3s ease;
    max-height: 400px;
    overflow: hidden;
}
.location-tile,
.location-tile * {
    cursor: pointer;
}
.location-tile:hover { border-color: var(--color-accent-border); }
.location-tile.selected { border-color: var(--color-accent); background: var(--color-accent-light-bg); }

/* Collapsed location grid */
.location-tiles.collapsed { grid-template-columns: 1fr; }
.location-tiles.collapsed .location-tile:not(.selected) {
    max-height: 0;
    padding: 0 16px;
    border-width: 0;
    opacity: 0;
    margin: 0;
    overflow: hidden;
    pointer-events: none;
}
.location-tiles.collapsed .location-tile.selected {
    cursor: default;
}
.location-tiles.collapsed .loc-details { display: none; }
.location-tiles.collapsed .loc-collapsed-info { display: flex; }

/* Collapsed info row (hidden by default) */
.loc-collapsed-info {
    display: none;
    align-items: center;
    gap: 10px;
}
.loc-collapsed-check {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: var(--color-accent, #16A34A);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.loc-collapsed-check svg {
    width: 12px;
    height: 12px;
    stroke: #fff;
    stroke-width: 3;
    fill: none;
}
.loc-collapsed-name {
    flex: 1;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    min-width: 0;
}
.loc-collapsed-edit {
    background: none;
    border: none;
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--color-accent, #16A34A);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.loc-collapsed-edit:hover { opacity: 0.8; }
.location-name {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 10px;
}
.location-type-badge {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--color-accent);
    background: var(--color-accent-light-bg);
    border-radius: 4px;
    padding: 2px 7px;
    margin-bottom: 8px;
}
.location-address {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--color-text-light);
    line-height: 1.5;
}

/* Location meta wrapper */
.location-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Phone and hours - same style as address */
.location-phone {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--color-text-light);
    line-height: 1.5;
}
.location-hours {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--color-text-light);
    line-height: 1.5;
}

/* Open days chips */
.location-days {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.location-day {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--color-text-light);
    background: var(--color-background);
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    padding: 3px 7px;
    line-height: 1.4;
}
.location-tile.selected .location-day {
    background: var(--color-background-light);
    border-color: var(--color-border);
}

/* Location dropdown (4+ locations) */
.location-select-wrap {
    margin-bottom: 4px;
}
.location-select {
    width: 100%;
    cursor: pointer;
    appearance: auto;
}
.location-selected-detail {
    margin-top: 10px;
    padding: 12px 16px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius);
    background: var(--color-accent-light-bg);
}

/* ============================================================
   20. CHECKOUT FORM FIELDS
   ============================================================ */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field-label {
    display: block;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}
.field-optional { font-weight: 400; color: var(--color-text-light); }
.field-input {
    width: 100%; height: 44px;
    padding: 0 14px;
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-background-light);
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field-input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-light-bg); }
.field-input.valid { border-color: var(--color-success); }
.field-input.invalid { border-color: var(--color-error); background: var(--red-light-bg); }
.field-input::placeholder { color: var(--color-border); }
textarea.field-input { height: 80px; padding: 12px 14px; resize: vertical; }

.field-error {
    font-family: var(--font-ui);
    font-size: 11px;
    color: var(--color-error);
    margin-top: 4px;
    display: none;
}
.field-error.show { display: block; }
.field-check {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--color-success);
}
.field-wrap { position: relative; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Has-error helper for Alpine.js */
.has-error .field-input { border-color: var(--color-error); background: var(--red-light-bg); }
.has-error .field-error { display: block; }

/* Delivery fields transition */
.delivery-fields {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}
.delivery-fields.visible { max-height: 1000px; opacity: 1; margin-top: 16px; overflow: visible; }

/* Reden in plaats van het herhaal-vinkje: de knop is er niet, de uitleg wel. */
.checkout-recurring-reason {
    margin: 16px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--color-text-light);
}

/* Checkbox rows */
.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    margin-top: 16px;
    background: var(--color-background-light);
    border-radius: 8px;
    border: 1px solid var(--color-border-light);
    cursor: pointer;
    transition: all 0.2s ease;
}
.checkbox-row:hover { border-color: var(--color-accent-border); background: var(--color-accent-light-bg); }
.checkbox-row.checked { border-color: var(--color-accent-border); background: var(--color-accent-light-bg); }
.checkbox-box {
    width: 20px; height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-background-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.checkbox-row.checked .checkbox-box { background: var(--color-accent); border-color: var(--color-accent); }
.checkbox-check {
    width: 12px; height: 12px;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.15s ease;
}
.checkbox-row.checked .checkbox-check { opacity: 1; transform: scale(1); }
.checkbox-label {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--color-text);
    line-height: 1.4;
}
.checkbox-sublabel {
    font-family: var(--font-ui);
    font-size: 11px;
    color: var(--color-text-light);
    margin-top: 2px;
}

/* ============================================================
   21. CHECKOUT SIDEBAR
   ============================================================ */
.checkout-sidebar {
    align-self: start;
    width: 280px;
    position: sticky;
    top: 80px;
}
.sidebar-card {
    background: var(--color-background-light);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 3px var(--shadow-color);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.sidebar-header {
    padding: 14px 18px;
    border-bottom: 1px dashed var(--color-border);
    flex-shrink: 0;
}
.sidebar-title {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--color-text-light);
}

.sidebar-items {
    padding: 8px 18px;
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}
.sidebar-items::-webkit-scrollbar {
    width: 4px;
}
.sidebar-items::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-items::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
}
.sidebar-item,
.cart-drawer-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-light);
}
.sidebar-item:last-child,
.cart-drawer-item:last-child { border-bottom: none; }

/* Row 1: thumbnail + product name */
.item-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.item-thumb {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.item-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-border-light);
    color: var(--color-text-light);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}
.item-name {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

/* Row 2: unit price + qty controls + line total */
.item-row-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
}
.item-unit-price {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--color-text-light);
    white-space: nowrap;
}
.item-line-total {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    margin-left: auto;
}
.item-price {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--color-text-light);
}
.item-qty {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-accent-border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--color-background-light);
    height: 26px;
}
.item-qty button {
    width: 24px; height: 26px;
    border: none;
    background: transparent;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.item-qty button:hover { background: var(--color-accent-light-bg); }
.item-qty-num {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 700;
    color: var(--color-accent);
    min-width: 18px;
    text-align: center;
    border-left: 1px solid var(--color-accent-border);
    border-right: 1px solid var(--color-accent-border);
    height: 26px;
    line-height: 26px;
}
.item-remove {
    width: 22px; height: 22px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--color-text-light);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.item-remove:hover { background: var(--red-light-bg); color: var(--color-error); }

/* Upsell section */
.upsell-section {
    padding: 10px 18px;
    border-top: 1px dashed var(--color-border);
    max-height: 120px;
    overflow-y: auto;
}
.upsell-title {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 10px;
}
.upsell-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.upsell-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--color-background);
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
}
.upsell-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.upsell-thumb-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--color-background-dark);
    flex-shrink: 0;
}
.upsell-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.upsell-name {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upsell-price {
    font-family: var(--font-ui);
    font-size: 11px;
    color: var(--color-text-light);
}
.upsell-add {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: var(--color-accent);
    color: var(--color-text-button);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease;
}
.upsell-add:hover {
    background: var(--color-button-hover);
}
.upsell-add.added {
    background: var(--color-success);
    cursor: default;
}
.upsell-item-adding {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

/* Sidebar totals */
.sidebar-totals {
    padding: 10px 18px;
    border-top: 1px dashed var(--color-border);
    flex-shrink: 0;
}
.shipping-progress {
    padding: 12px 16px;
    margin-bottom: 12px;
    background: var(--color-background-light);
    border-radius: 8px;
    border: 1px solid var(--color-border-light);
}
.shipping-progress.achieved { border-color: var(--color-success); background: var(--green-light-bg); }
.shipping-msg {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 8px;
}
.shipping-progress.achieved .shipping-msg { color: var(--color-success); }
.shipping-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--color-border-light);
    overflow: hidden;
}
.shipping-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--color-accent);
    transition: width 0.4s ease;
}
.shipping-progress.achieved .shipping-bar-fill {
    background: var(--color-success);
}

/* Sidebar fulfilment summary */
/* Preselected summary bar (checkout skip picker) */
.preselect-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-accent-light, #F0FDF4);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--color-text);
}
.preselect-dot {
    width: 8px;
    height: 8px;
    border-radius: 6px;
    background: var(--color-accent, #16A34A);
    flex-shrink: 0;
}
.preselect-text {
    flex: 1;
    min-width: 0;
}
.preselect-edit {
    background: none;
    border: none;
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--color-accent, #16A34A);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.preselect-edit:hover {
    opacity: 0.8;
}

.sidebar-fulfilment-summary {
    padding: 8px 0 12px;
    border-bottom: 1px dashed var(--color-border);
    margin-bottom: 8px;
}
.fulfilment-summary-label {
    font-family: var(--font-ui);
    font-size: 11px;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 2px;
}
.fulfilment-summary-detail {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--color-text);
    margin: 0;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--color-text-light);
    margin-bottom: 6px;
}
.total-row.free { color: var(--color-success); }
.total-row.minor { font-size: 11px; opacity: 0.7; }
.total-row.grand {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin-top: 6px;
    margin-bottom: 0;
}

/* Pulse on total change */
@keyframes total-pulse {
    0% { background-color: var(--color-accent-light-bg); }
    100% { background-color: transparent; }
}
.total-row.grand.total-pulse {
    animation: total-pulse 0.6s ease-out forwards;
}

/* ============================================================
   22. MINIMUM ORDER WARNING + CHECKOUT PAY BUTTON
   ============================================================ */
.minimum-order-warning {
    background: color-mix(in srgb, var(--color-warning) 12%, var(--color-background-light) 88%);
    border: 1px solid var(--color-warning);
    border-radius: var(--radius);
    padding: 8px 12px;
    margin: 0 14px 4px;
}
.minimum-order-warning p {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--color-text);
    font-weight: 500;
    line-height: 1.4;
}

/* Payment method selector (B2B on-account). Mobile-variant default-state staat onderaan in @media (min-width: 1101px); een naked rule hier verbergt de selector ook onder 1100px omdat _checkout.css na style.css laadt. */
.sidebar-payment-method { padding: 6px 18px 0; flex-shrink: 0; }
.payment-method-options { display: flex; flex-direction: column; gap: 8px; }
.payment-method-option {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px 14px;
    cursor: pointer;
    background: var(--color-background-light);
    transition: all 0.2s ease;
}
.payment-method-option:hover { border-color: var(--color-accent-border); }
.payment-method-option.selected {
    border-color: var(--color-accent);
    background: var(--color-accent-light-bg);
    box-shadow: 0 0 0 1px var(--color-accent);
}
.payment-method-radio {
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease;
}
.payment-method-option.selected .payment-method-radio { border-color: var(--color-accent); }
.payment-method-radio-dot {
    width: 8px;
    height: 8px;
    border-radius: 6px;
    background: var(--color-accent);
    transform: scale(0);
    transition: transform 0.15s ease;
}
.payment-method-option.selected .payment-method-radio-dot { transform: scale(1); }
.payment-method-name {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}
.payment-method-desc {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--color-text-light);
    margin: 2px 0 0;
}

.sidebar-pay {
    padding: 14px 18px;
    flex-shrink: 0;
}
.btn-pay {
    width: 100%; height: 48px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    background: var(--color-button);
    color: var(--color-text-button);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 6px var(--shadow-color);
    transition: all 0.2s ease;
}
.btn-pay:hover {
    background: var(--color-button-hover);
    box-shadow: 0 4px 12px var(--shadow-color);
    transform: translateY(-2px);
}
.btn-pay:active {
    transform: scale(0.98);
    filter: brightness(0.95);
}
.btn-pay:disabled:not(.loading) {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-pay:disabled:not(.loading):hover {
    transform: none;
    box-shadow: 0 2px 6px var(--shadow-color);
    background: var(--color-button);
}
/* Loading spinner on pay button */
.btn-pay.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
    padding-left: 36px;
}
.btn-pay.loading::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 6px;
    animation: spin 0.6s linear infinite;
}

/* Pay trust section */
.pay-trust {
    text-align: center;
    padding: 16px 0 8px;
}
/* Turnstile-widget gecentreerd onder de betaalknop (gedeelde partial). */
.turnstile-box {
    display: flex;
    justify-content: center;
    margin: 12px 0 4px;
}
/* Vangnet: nooit buiten de container/rand vallen, ongeacht widget-formaat. */
.turnstile-box .cf-turnstile {
    max-width: 100%;
}
.pay-trust-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--color-text-light, #888);
    margin-bottom: 8px;
}
.pay-trust-label svg {
    flex-shrink: 0;
}
.pay-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}
.pay-icons img {
    height: 24px;
    width: auto;
}
.pay-trust-sub {
    font-family: var(--font-ui);
    font-size: 11px;
    color: var(--color-text-light, #888);
    margin: 0;
}

/* ============================================================
   23. CHECKOUT MOBILE PAY BAR + CART DRAWER
   ============================================================ */
/* NB: default `.mobile-pay-bar { display: none }` is verwijderd in
   COMMIT_10a-fix. Reden: style.css `@media (max-width:1100px)` zet
   display:flex op mobile, en `@media (min-width:1101px)` zet display:none
   op desktop. Met _checkout.css na style.css geladen, trumpte de
   unconditional display:none beide media-rules en verborg pay-bar overal. */
.mobile-pay-bar .btn-pay.loading {
    padding-left: 32px;
}
.mobile-pay-bar .btn-pay.loading::before {
    left: 10px;
    width: 14px;
    height: 14px;
    margin-top: -7px;
}

/* Mobile pay info (left half, clickable for drawer) */
.mobile-pay-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-align: left;
    min-width: 0;
}
.mobile-pay-top {
    display: flex;
    align-items: center;
    gap: 6px;
}
.mobile-pay-count {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-light);
}
.mobile-pay-dot {
    color: var(--color-text-light);
    font-size: 12px;
}
.mobile-pay-total {
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
}
.mobile-pay-chevron {
    color: var(--color-text-light);
    transition: transform 0.2s ease;
}
.mobile-pay-hint {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 500;
    color: var(--color-success);
    white-space: nowrap;
}
/* Pay button right half */
.mobile-pay-btn {
    width: 45%;
    flex-shrink: 0;
    height: 44px;
}

/* Cart drawer backdrop */
.cart-drawer-backdrop {
    /* display: none verwijderd - style.css @media (max-width:1100px) zet display:block
       op mobile; desktop-hide nu in @media (min-width:1101px) onder cart-drawer-rules. */
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 250;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.cart-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* Cart drawer panel — sits ABOVE the pay bar */
.cart-drawer {
    /* display: none verplaatst naar @media (min-width:1101px) onderaan dit
       blok - mobile gebruikt style.css's @media (max-width:1100px) display:flex,
       desktop hide nu expliciet via cascade-fix (zie mobile-pay-bar regressie). */
    position: fixed;
    bottom: 64px; left: 0; right: 0;
    background: var(--color-background-light);
    z-index: 260;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -8px 30px var(--shadow-color);
    max-height: 60vh;
    transform: translateY(100%);
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    flex-direction: column;
    overflow: hidden;
}
.cart-drawer.open {
    transform: translateY(0);
}
@media (min-width: 1441px) {
    .cart-drawer { display: none; }
    .cart-drawer-backdrop { display: none; }
}

/* Drawer handle */
.cart-drawer-handle {
    padding: 10px 0 4px;
    display: flex;
    justify-content: center;
    cursor: pointer;
}
.cart-drawer-handle-bar {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--color-border);
}

/* Drawer header */
.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 18px 12px;
    border-bottom: 1px dashed var(--color-border);
}
.cart-drawer-title {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--color-text-light);
}
.cart-drawer-close {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: 1px solid var(--color-border-light);
    background: none;
    font-size: 16px;
    color: var(--color-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-drawer-close:hover {
    background: var(--color-background-dark);
    color: var(--color-text);
}

/* Drawer items (scrollable) */
.cart-drawer-items {
    padding: 4px 18px;
    overflow-y: auto;
    flex: 1;
}
/* Drawer totals */
.cart-drawer-totals {
    padding: 14px 18px;
    border-top: 1px dashed var(--color-border);
}

/* Compact drawer totals: shipping + total in one row */
.drawer-totals-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}
.drawer-shipping-compact {
    flex: 1;
    min-width: 0;
}
.shipping-msg-compact {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-accent);
    white-space: nowrap;
}
.shipping-msg-compact.is-free {
    color: var(--color-success);
}
.shipping-bar-compact {
    height: 4px;
    background: var(--color-border-light);
    border-radius: 2px;
    margin-top: 4px;
    max-width: 180px;
}
.shipping-bar-compact-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
}
.drawer-shipping-compact.is-free .shipping-bar-compact-fill {
    background: var(--color-success);
}
.drawer-total-compact {
    display: flex;
    gap: 10px;
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
}

/* ============================================================
   Checkout success page + demo capture (was inline <style> in
   templates/webshop/checkout.html, geextracteerd in COMMIT_15a).
   ============================================================ */

        .checkout-success {
            max-width: 480px; margin: 0 auto;
            text-align: center; padding: 40px 20px;
        }
        .success-header { text-align: center; margin-bottom: 28px; }
        .success-icon {
            width: 56px; height: 56px;
            background: var(--color-success-bg, #DCFCE7);
            color: var(--color-success, #6b8e5a);
            border-radius: 6px; display: flex; align-items: center;
            justify-content: center; font-size: 1.5rem; margin: 0 auto 16px;
        }
        .success-header h1 { font-family: var(--font-heading, serif); font-size: 1.5rem; margin-bottom: 8px; }
        .success-header .order-number {
            font-weight: 600; font-size: 0.85rem;
            color: var(--color-text-light);
            background: var(--color-border-light, #e8ddd0);
            display: inline-block; padding: 5px 12px; border-radius: 6px;
        }
        .demo-inline-capture {
            background: var(--color-accent-light, rgba(180, 83, 9, 0.08));
            border: 1px solid rgba(180, 83, 9, 0.15);
            border-radius: var(--radius, 8px); padding: 24px; margin-bottom: 24px;
        }
        .demo-inline-badge {
            display: inline-flex; align-items: center; gap: 5px;
            font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
            letter-spacing: 0.06em; color: var(--color-accent); margin-bottom: 10px;
        }
        .demo-inline-capture h3 {
            font-family: var(--font-heading, serif); font-size: 1.05rem; margin-bottom: 6px;
        }
        .demo-inline-capture > p {
            font-size: 0.88rem; color: var(--color-text-light);
            line-height: 1.55; margin-bottom: 16px;
        }
        .demo-inline-capture { text-align: center; }
        .demo-inline-form {
            display: flex; flex-direction: column; gap: 8px;
            max-width: 320px; margin: 0 auto;
        }
        .demo-inline-form input {
            flex: 1; min-width: 0; padding: 10px 14px;
            border: 1.5px solid var(--color-border);
            border-radius: var(--radius, 8px);
            font-family: var(--font-body, sans-serif); font-size: 0.9rem;
            color: var(--color-text); background: var(--color-background-light);
            transition: border-color 0.15s; outline: none;
        }
        .demo-inline-form input:focus { border-color: var(--color-accent); }
        .demo-inline-form input::placeholder { color: var(--color-text-faint, #c4b5a4); }
        .demo-inline-form button {
            width: 100%; padding: 12px 20px; white-space: nowrap;
            background: var(--color-accent); color: var(--color-text-button, #fff);
            border: none; border-radius: var(--radius, 8px);
            font-family: var(--font-ui, sans-serif); font-size: 0.9rem;
            font-weight: 600; cursor: pointer; transition: background 0.15s;
        }
        .demo-inline-form button:hover:not(:disabled) { background: var(--color-accent-hover, var(--color-accent)); }
        .demo-inline-form button:disabled { opacity: 0.6; cursor: wait; }
        .demo-inline-hint { font-size: 0.76rem; color: var(--color-text-light); margin-top: 8px; text-align: center; }
        .demo-inline-error {
            font-size: 0.85rem; color: #B91C1C; background: #FEE2E2;
            padding: 8px 12px; border-radius: 6px; margin-bottom: 12px;
        }
        .demo-inline-sent { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 4px 0; }
        .demo-inline-sent-icon {
            width: 36px; height: 36px; flex-shrink: 0;
            background: var(--color-success-bg, #DCFCE7);
            color: var(--color-success, #6b8e5a);
            border-radius: 6px; display: flex; align-items: center;
            justify-content: center; font-size: 1.1rem;
        }
        .demo-inline-sent p { font-size: 0.9rem; color: var(--color-text); }
        .demo-inline-sent strong { font-weight: 600; }
        .demo-bridge {
            background: var(--color-success); color: white;
            border-radius: var(--radius, 8px); padding: 28px 24px;
            margin-bottom: 16px; text-align: center;
        }
        .demo-bridge h3 {
            font-family: var(--font-heading, serif); font-size: 1.15rem;
            margin-bottom: 8px; color: white;
        }
        .demo-bridge p {
            font-size: 0.88rem; line-height: 1.55;
            color: rgba(255, 255, 255, 0.85); margin-bottom: 20px;
        }
        .demo-bridge-btn {
            display: block; width: 100%; padding: 14px;
            background: white; color: var(--color-success);
            border: none; border-radius: var(--radius, 8px);
            font-family: var(--font-ui, sans-serif); font-size: 1rem;
            font-weight: 700; cursor: pointer; text-decoration: none;
            text-align: center; transition: background 0.15s;
        }
        .demo-bridge-btn:hover { background: var(--color-success-bg, #f0fdf4); color: var(--color-success); text-decoration: none; }
        .demo-bridge-hint {
            font-size: 0.76rem; color: rgba(255, 255, 255, 0.6);
            margin-top: 10px;
        }

/* ============================================================
   CHECKOUT RESPONSIVE (verplaatst uit style.css, COMMIT_10/15
   refactor: default-states en mobile-overrides hoorden in
   verschillende bestanden, waardoor cascade-volgorde de mobile-
   override kon trumpen. Hier samengebracht zodat cascade binnen
   één bestand klopt.)
   ============================================================ */
@media (min-width: 1441px) {
    .mobile-pay-bar { display: none; }
    .mobile-minimum-warning { display: none !important; }
}
/* Mobiel↔desktop-grens voor de cart/checkout-UI op 1440 i.p.v. 1100, zodat
   de mobiele pay-bar + drawer tot 1440px blijven en de 280px-zijbalk het pas
   vanaf 1441 overneemt (paste niet eerder). Dichtte de iPad-dode-zone
   1101-1440 (geen mandje/afreken-knop zichtbaar). */
@media (max-width: 1440px) {
    .checkout-page {
        grid-template-columns: 1fr;
        max-width: 640px;
        padding-bottom: 100px;
    }
    .checkout-sidebar { display: none !important; }
    .mobile-minimum-warning {
        position: fixed;
        bottom: 62px;
        left: 0; right: 0;
        z-index: 249;
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        text-align: center;
        padding: 8px 16px;
    }
    .mobile-pay-bar {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: var(--color-background-light);
        border-top: 1px solid var(--color-border);
        box-shadow: 0 -2px 10px var(--shadow-color);
        padding: 10px 16px;
        z-index: 270;
        display: flex;
        align-items: center;
        gap: 14px;
    }
    .cart-drawer-backdrop { display: block; }
    .cart-drawer { display: flex; }
    .toast { bottom: 90px; }
}
@media (max-width: 600px) {
    .checkout-page { padding: 20px 16px 100px; }
    .checkout-title { font-size: 26px; margin-bottom: 20px; }
    .section { padding: 16px; }
    .fulfilment-toggle { gap: 8px; }
    .fulfilment-option { padding: 12px; }
    .location-tiles { grid-template-columns: 1fr; }
    .field-row { grid-template-columns: 1fr; }
}

/* ============================================================
   PAYMENT SHEET (mobile-only confirmation step). Sticky-bar
   "Voltooien" opent deze sheet als er >1 betaalwijze is; klant
   bevestigt expliciet via finale CTA. Sheet vervangt het oude
   .mobile-payment-method blok in de form.
   ============================================================ */
.payment-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 14, 6, 0.5);
    z-index: 280;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.payment-sheet-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}
.payment-sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--color-background-light);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 30px var(--shadow-color);
    z-index: 290;
    padding: 8px 18px 20px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 80vh;
    overflow-y: auto;
}
.payment-sheet.open {
    transform: translateY(0);
}
.payment-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    margin: 6px auto 12px;
}
.payment-sheet-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.payment-sheet-head h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 600;
    color: var(--color-text);
}
.payment-sheet-close {
    background: none;
    border: none;
    color: var(--color-text-light);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}
.payment-sheet .payment-method-options {
    margin-bottom: 14px;
}
.payment-sheet-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--color-border-light, var(--color-border));
    padding-top: 12px;
    margin-bottom: 12px;
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
}
.payment-sheet-cta {
    width: 100%;
    height: 48px;
}
@media (min-width: 1441px) {
    .payment-sheet-backdrop,
    .payment-sheet { display: none; }
}

/* ── Tijdsblokken (afhaal): verplichte slot-rij ──────────────────────── */
.slot-sublabel {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin: 0 0 0.5rem;
}
.slot-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.slot-chip {
    min-height: 44px;
    padding: 0 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--color-text);
    background: var(--color-background-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
}
.slot-chip:hover {
    border-color: var(--color-accent);
}
.slot-chip.sel {
    background: var(--color-accent);
    color: var(--color-text-button);
    border-color: var(--color-accent);
    font-weight: 700;
}
.slot-chip.dim {
    opacity: 0.5;
    cursor: not-allowed;
}
.slot-chip-full {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-error);
}
