/* ==========================================
   CART PAGE
   ========================================== */
.cart-page {
    padding: 10px 0 30px;
    background: #f5f5f5;
    min-height: 60vh;
}

.cart-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 14px;
}

.breadcrumb {
    color: #666;
    font-size: 1rem;
    text-decoration: none;
    font-weight: 600;
    transition: color .2s ease;
}

    .breadcrumb a,
    .breadcrumb .breadcrumb-current {
        color: #666;
        text-decoration: none;
        font-weight: 600;
        font-size: 1rem;
        transition: color .2s ease;
    }

        .breadcrumb a:hover {
            color: var(--primary, #e53935);
            text-decoration: underline;
        }

    .breadcrumb .breadcrumb-sep {
        color: #bbb;
        margin: 0 8px;
        font-weight: 400;
        font-size: 1rem;
    }

    /* Last breadcrumb segment (current page) is visually emphasized to
       indicate the active location, while still matching the same
       font-family/size as the rest of the breadcrumb. */
    .breadcrumb .breadcrumb-current:last-child {
        /*color: var(--primary, #e53935);*/
        font-weight: 700;
    }

.cart-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #222;
}

.cart-layout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.cart-items {
    flex: 1 1 auto;
    min-width: 0;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 8px;
    overflow: hidden;
}

.cart-summary {
    flex: 0 0 300px;
    max-width: 300px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 8px;
    padding: 20px;
    position: sticky;
    top: 20px;
}

    .cart-summary h3 {
        font-size: 1.1rem;
        font-weight: 700;
        margin-bottom: 16px;
        padding-bottom: 12px;
        border-bottom: 2px solid #eee;
    }

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: .95rem;
    color: #444;
}

.cart-summary-total {
    border-top: 1px solid #eee;
    margin-top: 8px;
    padding-top: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #222;
}

.cart-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    margin-top: 16px;
    border-radius: 4px;
    text-decoration: none;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

    .cart-table th {
        text-align: left;
        font-size: .85rem;
        text-transform: uppercase;
        color: #888;
        padding: 14px 16px;
        border-bottom: 2px solid #eee;
    }

    .cart-table td {
        padding: 16px;
        border-bottom: 1px solid #f2f2f2;
        vertical-align: middle;
    }

    .cart-table tr:last-child td {
        border-bottom: none;
    }

.cart-product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .cart-product-cell img {
        width: 64px;
        height: 64px;
        object-fit: contain;
        border: 1px solid #ececec;
        border-radius: 6px;
        padding: 4px;
        background: #fff;
    }

.cart-item-name {
    font-weight: 600;
    color: #222;
}
.cart-item-fit {
    font-size: .8rem;
    color: #222;
    margin-top: 2px;
}

.cart-item-sku {
    font-size: .8rem;
    color: #222;
}

.cart-qty-input {
    width: 70px;
}

.cart-line-subtotal {
    font-weight: 700;
}

.cart-remove-btn {
    border: none;
    background: transparent;
    color: #c62828;
    font-size: 1.05rem;
    cursor: pointer;
    padding: 6px;
}

    .cart-remove-btn:hover {
        color: #8e0000;
    }

/* ---- Fitment mismatch dialog (SweetAlert2 content) ---- */
.cart-fitment-issue-list {
    list-style: none;
    margin: 12px 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
}

.cart-fitment-issue-item {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: .9rem;
}

    .cart-fitment-issue-item:last-child {
        border-bottom: none;
    }

.cart-item-text {
    color: #333;
    font-weight: 500;
    font-size: 0.8rem;
}

.cart-item-small {
    color: #555;
    font-size: 0.8rem;
}

@media (max-width: 767px) {
    .cart-page {
        padding: 20px 0 40px;
    }

    .cart-title {
        font-size: 1.3rem;
    }

    .cart-layout {
        flex-direction: column;
        gap: 16px;
    }

    .cart-summary {
        flex: 1 1 auto;
        max-width: 100%;
        width: 100%;
        position: static;
    }

    /* ---- Convert the cart table into stacked "cards" on mobile ----
       Table semantics are kept (for accessibility) but each row is
       re-laid-out as a self-contained card, with the header row hidden
       and each cell labelled via a ::before using its data-label. */
    .cart-items {
        border: none;
        background: transparent;
        overflow: visible;
    }

    .cart-table {
        display: block;
    }

        .cart-table thead {
            display: none;
        }

        .cart-table tbody {
            display: block;
        }

        .cart-table tr {
            display: block;
            background: #fff;
            border: 1px solid #ececec;
            border-radius: 8px;
            padding: 14px;
            margin-bottom: 12px;
        }

        .cart-table td {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid #f2f2f2;
        }

            .cart-table td:last-child {
                border-bottom: none;
            }

            /* Label each cell using its column name, shown to the left of
               the value so the row reads like "Price: $24.99" etc. */
            .cart-table td::before {
                content: attr(data-label);
                font-size: .75rem;
                font-weight: 700;
                text-transform: uppercase;
                color: #888;
                flex-shrink: 0;
                margin-right: 12px;
            }

        /* Product cell is the exception: it stays as a full-width image +
           name/sku row instead of the label/value pattern, and has no
           bottom border label since it's the card's "header". */
        .cart-table .cart-product-cell {
            justify-content: flex-start;
        }

            .cart-table .cart-product-cell::before {
                content: none;
            }

        .cart-table .cart-qty-input {
            width: 70px;
            margin-left: auto;
        }

        .cart-table .cart-remove-btn {
            margin-left: auto;
        }
}