:root {
    /* Brand palette */
    --cozzicotton-primary: #B89658;
    --cozzicotton-primary-hover: #947844;
    --text-default: #212529;

    /* Optional defaults (silence IDE warnings; safe fallbacks) */
    --fi-cream: #fafafa;
    --fi-border: #eaecef;
    --fi-orange: var(--cozzicotton-primary);
    --fi-ink: var(--text-default);

    /* Runtime vars (JS / inline style). Defaults keep layout stable. */
    --cc-cart-bar-h: 132px; /* safe fallback until JS measures the bar */
    --cc-vv-bottom: 0px;
    --cc-free-ship-pct: 0%;
}

/* Scope to cart page only */
.cart-page .summary-card {
    background: #fafafa;
    border: 1px solid #eaecef;
    border-radius: 10px;
    padding: 16px;
    overflow: hidden;
}

/* Prevent the summary card from sitting on the footer on short pages */


.cart-page .proceed-btn {
    background: var(--cozzicotton-primary);
    border-color: var(--cozzicotton-primary);
}

.cart-page .proceed-btn:hover,
.cart-page .proceed-btn:focus {
    background: var(--cozzicotton-primary-hover);
    border-color: var(--cozzicotton-primary-hover);
}

.cart-page .trust-copy {
    color: #777;
    font-size: 12px;
    margin: 10px 0 0;
}

/* Trust strip (Step 2 - P0-3) */
.cart-page .cc-trust-strip {
    margin: 12px 0 12px;
    padding: 12px 12px;
    border: 1px solid rgba(184, 150, 88, 0.22);
    border-radius: 14px;
    background: rgba(184, 150, 88, 0.06);
    color: #111827;
    font-size: 12.5px;
    line-height: 1.25;
}

.cart-page .cc-trust-strip__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.cart-page .cc-trust-strip__item {
    position: relative;
    padding: 8px 10px 8px 30px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    background: #fff;
}

.cart-page .cc-trust-strip__item:before {
    content: "";
    position: absolute;
    left: 10px;
    top: 10px;
    width: 16px;
    height: 16px;
    background-color: var(--cozzicotton-primary, #B89658);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    opacity: 0.95;
}

.cart-page .cc-trust-strip__item + .cc-trust-strip__item {
    margin-top: 0;
}

/* Icon per item (no HTML change needed) */
.cart-page .cc-trust-strip__item:nth-child(1):before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v1H3V7zm0 3h18v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-9zm12 4h5v2h-5v-2z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v1H3V7zm0 3h18v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-9zm12 4h5v2h-5v-2z'/%3E%3C/svg%3E");
}

.cart-page .cc-trust-strip__item:nth-child(2):before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4V1L7 6l5 5V7a6 6 0 1 1-6 6H4a8 8 0 1 0 13.65-6.65z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0 0 12 4V1L7 6l5 5V7a6 6 0 1 1-6 6H4a8 8 0 1 0 13.65-6.65z'/%3E%3C/svg%3E");
}

.cart-page .cc-trust-strip__item:nth-child(3):before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm1 11h4v-2h-3V6h-2v7z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm1 11h4v-2h-3V6h-2v7z'/%3E%3C/svg%3E");
}

/* Make EN + AR scannable (AR on its own line) */
.cart-page .cc-trust-strip__item .cc-en {
    display: block;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.70);
}

.cart-page .cc-trust-strip__item .cc-ar {
    display: block;
    margin-top: 2px;
    direction: rtl;
    text-align: right;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.56);
}

.cart-page .cc-trust-strip__link {
    font-weight: 900;
    color: var(--cozzicotton-primary);
    text-decoration: underline;
}

/* Shipping visibility note (Step 1 P0-1) */
.cart-page .cc-shipping-note {
    margin: 12px 0 12px;
    padding: 10px 12px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #fff;
    color: #777;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 600;
}

.cart-page .cc-shipping-note .cc-ar {
    display: block;
    margin-top: 4px;
    direction: rtl;
    text-align: right;
    font-weight: 700;
}


/* Gentle gutters so columns don’t feel cramped (DESKTOP ONLY to avoid horizontal overflow on mobile) */
@media (min-width: 992px) {
    .cart-page .row > .col-lg-8 {
        padding-right: 18px;
    }

    .cart-page .row > .col-lg-4 {
        padding-left: 18px;
    }
}

/* Art-card touches for list items in basket_content */
.cart-line {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.cart-line .thumbnail {
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.cart-line-meta {
    color: #777;
    margin: 6px 0 0;
    font-size: 12px;
}

.qty-stepper .btn {
    min-width: 34px;
}

.qty-input {
    text-align: center;
}

/* Quantity column tidy-up */
.cart-page .qty-stepper .btn {
    min-width: 34px;
}

.cart-page .line-actions {
    margin-top: 6px;
    font-size: 12px;
}

.cart-page .line-actions a + a {
    margin-left: 6px;
}

.cart-page .qty-input {
    text-align: center;
    width: 96px;
}

/* instead of max-width:70px */
/* Fix the tiny gap between minus and the input in the quantity stepper */
.cart-page .qty-stepper .input-group-btn:first-child > .btn {
    margin-right: -1px;
}

.cart-page .qty-stepper .input-group-btn:last-child > .btn {
    margin-left: -1px;
}

/* Optional: make the three controls read as one pill */
.cart-page .qty-stepper .qty-input {
    border-left-width: 0;
    border-right-width: 0;
}

.cart-page .qty-stepper .btn,
.cart-page .qty-stepper .qty-input {
    border-radius: 0;
}

/* Sizing/centering for readability */
.cart-page .qty-input {
    width: 96px;
    text-align: center;
}

.cart-page .qty-stepper .btn {
    min-width: 34px;
}

.cart-page .qty-stepper .input-group-btn:first-child > .btn {
    margin-right: -1px;
}

.cart-page .qty-stepper .input-group-btn:last-child > .btn {
    margin-left: -1px;
}

.cart-page .qty-stepper .qty-input {
    width: 96px;
    text-align: center;
    border-left-width: 0;
    border-right-width: 0;
}

/* ---- Quantity stepper: remove gaps completely ---- */
.cart-page .qty-stepper {
    display: inline-flex;
    align-items: stretch;
    vertical-align: middle;
}

.cart-page .qty-stepper .input-group-btn {
    display: inline-flex;
}

.cart-page .qty-stepper .btn {
    margin: 0 !important;
    border-radius: 0;
    min-width: 34px;
}

.cart-page .qty-stepper .input-group-btn:first-child > .btn {
    margin-right: -1px;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.cart-page .qty-stepper .input-group-btn:last-child > .btn {
    margin-left: -1px;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* Center & size the number field; remove side borders so it reads as one pill */
.cart-page .qty-stepper .qty-input {
    width: 96px;
    text-align: center;
    border-left-width: 0;
    border-right-width: 0;
}

/* ---- Hide browser spinner arrows on number inputs ---- */
/* Chrome/Safari/Edge (WebKit) */
.cart-page .qty-stepper .qty-input::-webkit-outer-spin-button,
.cart-page .qty-stepper .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
.cart-page .qty-stepper .qty-input[type="number"] {
    -moz-appearance: textfield;
}

/* Ensure consistent height across all three controls */
.cart-page .qty-stepper .btn,
.cart-page .qty-stepper .qty-input {
    height: 32px;
    line-height: 32px;
    padding: 0 10px;
}

/* Quantity pill: new, framework-agnostic control */
.cart-page .qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    height: 34px;
    vertical-align: middle;
    background: #fff;
}

.cart-page .qty-stepper .btn {
    border: 0;
    box-shadow: none;
    height: 34px;
    line-height: 34px;
    padding: 0 10px;
    margin: 0 !important; /* kill any theme margins */
}

.cart-page .qty-stepper .btn:first-child {
    border-right: 1px solid #ddd;
}

.cart-page .qty-stepper .btn:last-child {
    border-left: 1px solid #ddd;
}

.cart-page .qty-stepper .qty-input {
    width: 96px;
    text-align: center;
    height: 34px;
    line-height: 34px;
    border: 0;
    box-shadow: none;
    padding: 0 8px;
    background: #fff;
}

/* Hide native number spinners */
.cart-page .qty-stepper .qty-input::-webkit-outer-spin-button,
.cart-page .qty-stepper .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cart-page .qty-stepper .qty-input[type="number"] {
    -moz-appearance: textfield;
}

/* Quantity pill (framework-agnostic) */
.cart-page .qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    height: 34px;
    vertical-align: middle;
    background: #fff;
}

.cart-page .qty-stepper .btn {
    border: 0;
    box-shadow: none;
    height: 34px;
    line-height: 34px;
    padding: 0 10px;
    margin: 0 !important;
}

.cart-page .qty-stepper .btn:first-child {
    border-right: 1px solid #ddd;
}

.cart-page .qty-stepper .btn:last-child {
    border-left: 1px solid #ddd;
}

.cart-page .qty-stepper .qty-input {
    width: 96px;
    text-align: center;
    height: 34px;
    line-height: 34px;
    border: 0;
    box-shadow: none;
    padding: 0 8px;
    background: #fff;
}

/* Hide native spinners */
.cart-page .qty-stepper .qty-input::-webkit-outer-spin-button,
.cart-page .qty-stepper .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cart-page .qty-stepper .qty-input[type="number"] {
    -moz-appearance: textfield;
}

/* Use theme tokens */
.cart-page .summary-card {
    background: var(--fi-cream);
    border-color: var(--fi-border);
}

.cart-page .proceed-btn {
    background: var(--fi-orange);
    border-color: var(--fi-orange);
}

.cart-page .proceed-btn:hover, .cart-page .proceed-btn:focus {
    background: var(--cozzicotton-primary-hover);
    border-color: var(--cozzicotton-primary-hover);
}

.cart-page .summary-rows dt {
    color: var(--fi-ink);
}

/* Kill the top border on the first visible row inside the cart summary table */
.cart-page #basket_totals .table > tbody > tr:first-child > th,
.cart-page #basket_totals .table > tbody > tr:first-child > td {
    border-top: 0 !important;
}


/* --- Cart responsive fixes (tablet & below) --- */
.cart-page {
    padding-bottom: 80px;
}

/* desktop default */

@media (max-width: 991px) {
    /* IMPORTANT:
       Don't pad the whole BODY, otherwise you'll see a white gap *after the footer*
       when you scroll to the end of the page.
       Pad only the cart content container instead. */
    body.cart-basket {
        padding-bottom: 0;
    }

    body.cart-basket .cart-page {
        padding-bottom: calc(
                var(--cc-cart-bar-h, 132px)
                + max(env(safe-area-inset-bottom, 0px), var(--cc-vv-bottom, 0px))
                + 24px
        );
    }

    /* Prevent the fixed bar from covering the footer on mobile/tablet */
    body.cart-basket #footer {
        background-color: #222; /* prevents white gap in padded area */
        padding-bottom: calc(
                var(--cc-cart-bar-h, 132px)
                + max(env(safe-area-inset-bottom, 0px), var(--cc-vv-bottom, 0px))
        );
    }
}

/* Center product titles under the image on phones only */
@media (max-width: 767px) {
    .cart-line .title-col,
    .cart-line .title-col h3 {
        text-align: center;
    }

    /* keep the link from stretching full width, for nicer centering */
    .cart-line .title-col h3 a {
        display: inline-block;
    }
}

/* --- Mobile fixed checkout bar (Cart) --- */
@media (max-width: 991px) {
    /* Hide the in-card checkout CTA on mobile to avoid duplicate primary CTAs
       (don’t rely on sidecart-checkout; cart template button often doesn’t have it) */
    body.cart-basket .cart-page .summary-card .proceed-btn {
        display: none !important;
    }
}

html, body.cart-basket {
    overflow-x: hidden;
}

.cc-cart-mobile-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(env(safe-area-inset-bottom) + var(--cc-vv-bottom, 0px));
    z-index: 60;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 10px 12px;
}

@media (min-width: 992px) {
    .cc-cart-mobile-cta {
        display: none !important;
    }
}

.cc-cart-mobile-cta__inner {
    max-width: 520px;
    margin: 0 auto;
}


/* Tablet: 520px looks too narrow and creates awkward empty sides */
@media (min-width: 768px) and (max-width: 991px) {
    .cc-cart-mobile-cta__inner {
        max-width: 100%;
    }

    .cc-cart-mobile-cta__btn {
        min-width: 160px;
        height: 48px;
        font-size: 15px;
        padding: 0 18px;
    }

    .cc-cart-mobile-cta__meta {
        font-size: 13px;
        line-height: 1.25;
    }

    .cc-cart-mobile-checkout {
        height: 48px;
        min-width: 160px;
        padding: 0 18px;
        font-size: 16px;
    }
}

.cc-cart-mobile-cta__progress {
    margin-bottom: 8px;
}

.cc-cart-mobile-cta__progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    line-height: 1.2;
    color: #333;
    margin-bottom: 6px;
}

.cc-cart-mobile-cta__progress-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.cc-cart-mobile-cta__progress-fill {
    height: 100%;
    width: var(--cc-free-ship-pct, 0%);
    background: #b89658;
}

.cc-cart-mobile-cta__row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cc-cart-mobile-cta__total {
    flex: 1;
    min-width: 0;
}

.cc-cart-mobile-cta__total-label {
    font-size: 12px;
    color: #666;
    line-height: 1.2;
}

.cc-cart-mobile-cta__total-amount {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cc-cart-mobile-cta__note {
    font-size: 11px;
    color: #777;
    margin-top: 4px;
    line-height: 1.2;
}

.cc-cart-mobile-checkout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    font-weight: 700;
    white-space: nowrap;
}

/* Ensure the arrow pseudo-element doesn't add weird spacing */
.cc-cart-mobile-checkout::after {
    content: none !important;
}