/* ==========================================================================
   KEYSHU CART PAGE COMPONENT STYLESHEET
   ========================================================================== */

/* Core Theme Variables */
:root {
    --primary-color: #03B0B1;
    /* Brand Teal */
    --primary-hover: #029495;
    --orange-accent: #c62828;
    /* Deep Crimson Red matching Homepage cart button */
    --orange-hover: #b71c1c;
    --text-color: #475569;
    --heading-color: #1e293b;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --soft-red: #c62828;
}

/* Page Wrapper */
.cart-container-wrap {
    max-width: 1216px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* Breadcrumbs Section */
.cart-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 24px 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #94a3b8;
    border-bottom: 1px solid #f1f5f9;
}

.cart-breadcrumb a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cart-breadcrumb a:hover {
    color: var(--primary-color);
}

.cart-breadcrumb i {
    font-size: 9px;
}

.cart-breadcrumb .active-crumb {
    color: #475569;
    font-weight: 700;
}

/* ==========================================================================
   TWO-COLUMN CART GRID LAYOUT
   ========================================================================== */
.cart-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    margin-top: 32px;
    align-items: start;
}

/* ==========================================================================
   LEFT COLUMN: CART ITEMS LIST
   ========================================================================== */
.cart-items-section {
    min-width: 0;
}

.cart-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 16px 24px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.01);
}

.cart-header-controls h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--heading-color);
    margin: 0;
}

.cart-header-controls h1 span {
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    margin-left: 8px;
}

/* Custom Checkbox Design */
.select-all-label,
.item-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--heading-color);
    user-select: none;
}

.select-all-label input[type="checkbox"],
.item-checkbox-label input[type="checkbox"] {
    display: none;
}

.custom-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-checkbox i {
    font-size: 10px;
    color: #ffffff;
    display: none;
}

input[type="checkbox"]:checked+.custom-checkbox {
    background: #c62828;
    border-color: #c62828;
}

input[type="checkbox"]:checked+.custom-checkbox i {
    display: block;
}

/* Cart Item Card */
.cart-item-card {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    margin-bottom: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}

.cart-item-card:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.04);
    border-color: #e2e8f0;
}

.cart-item-main-row {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* Item Thumbnail */
.cart-item-thumb {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f1f5f9;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cart-item-thumb img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* Item Info block */
.cart-item-info {
    flex-grow: 1;
    min-width: 0;
}

.cart-item-info h3 {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--heading-color);
    line-height: 1.4;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-capsule {
    display: inline-block;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 8px;
}

.price-gift-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.gift-badge {
    background: var(--soft-red);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 100px;
    text-transform: uppercase;
}

.delete-item-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    color: #94a3b8;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

.delete-item-btn:hover {
    color: var(--soft-red);
}

/* Right Actions Column inside Item Card */
.cart-item-right-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

.item-checkbox-spacer {
    width: 20px;
}

/* Quantity Selector */
.qty-selector {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 100px;
    padding: 3px;
}

.qty-btn {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: #ffffff;
    color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.qty-num {
    width: 28px;
    text-align: center;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--heading-color);
}

/* Total Block Inside Card */
.item-subtotal-block {
    text-align: right;
    min-width: 100px;
}

.subtotal-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.subtotal-val {
    display: block;
    font-size: 16px;
    font-weight: 800;
    color: var(--heading-color);
}

.subtotal-val.orange {
    color: var(--soft-red);
}

.subtotal-old {
    display: block;
    font-size: 11.5px;
    color: #94a3b8;
    text-decoration: line-through;
    margin-top: 1px;
}

/* ==========================================================================
   COMBO PROMO DETAILS & NESTED ITEMS
   ========================================================================== */
.combo-item-card {
    padding-bottom: 18px;
}

.combo-promo-alert {
    background: #fff7ed;
    border: 1px solid #ffedd5;
    border-radius: 12px;
    padding: 12px 18px;
    margin: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #c2410c;
    font-weight: 700;
    cursor: pointer;
}

.promo-text-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.promo-text-wrap i {
    font-size: 15px;
    color: var(--orange-accent);
}

.promo-text-wrap strong {
    color: #ea580c;
}

.promo-arrow {
    font-size: 11px;
    color: #ea580c;
}

/* Nested sub items inside combo card */
.combo-sub-items-list {
    border-left: 2px dashed #cbd5e1;
    padding-left: 24px;
    margin-left: 40px;
}

.sub-item-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
}

.sub-item-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sub-item-thumb img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.sub-item-info {
    flex-grow: 1;
    min-width: 0;
}

.sub-item-info h4 {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--heading-color);
    margin: 0 0 6px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sub-item-meta {
    display: flex;
    gap: 8px;
}

.meta-tag {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 2px 8px;
    border-radius: 4px;
}

.sub-item-right {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

.sub-item-qty {
    font-size: 13px;
    color: #64748b;
}

.sub-item-qty strong {
    color: var(--heading-color);
    font-weight: 800;
}

.sub-item-price-block {
    text-align: right;
    min-width: 90px;
}

.sub-price-val {
    display: block;
    font-size: 14.5px;
    font-weight: 800;
    color: var(--soft-red);
}

.sub-price-old {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    text-decoration: line-through;
}

/* ==========================================================================
   RIGHT COLUMN: ORDER SUMMARY COLUMN
   ========================================================================== */
.cart-summary-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 100px;
}

.summary-card {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

.summary-card h2 {
    font-size: 16px;
    font-weight: 800;
    color: var(--heading-color);
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.summary-details-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
    font-weight: 600;
    color: #64748b;
}

.summary-row strong {
    color: var(--heading-color);
    font-weight: 800;
}

.summary-total-checkout {
    border-top: 1px solid #f1f5f9;
    margin-top: 16px;
    padding-top: 16px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--heading-color);
}

.total-val.orange {
    font-size: 20px;
    font-weight: 850;
    color: var(--soft-red);
}

.vat-note {
    font-size: 11.5px;
    color: #94a3b8;
    text-align: right;
    margin: 4px 0 0 0;
    font-style: italic;
}

/* Coupon & Offer trigger Capsule Bar */
.summary-coupon-offer-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 16px 24px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    transition: all 0.25s ease;
}

.summary-coupon-offer-trigger:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(3, 176, 177, 0.04);
}

.trigger-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--heading-color);
}

.trigger-coupon-icon {
    font-size: 16px;
    color: var(--primary-color);
}

.trigger-arrow {
    font-size: 12px;
    color: #64748b;
}

/* Coupon Form card specific styles */
.coupon-apply-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.coupon-apply-form input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    padding: 12px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    outline: none;
    color: #334155;
    text-align: center;
    background: #ffffff;
    transition: all 0.25s ease;
}

.coupon-apply-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(3, 176, 177, 0.08);
}

.coupon-submit-btn {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 100px;
    padding: 12px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.5px;
}

.coupon-submit-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(3, 176, 177, 0.2);
}

/* Checkout checklist and Orange Button */
.summary-checkout-notice {
    font-size: 11.5px;
    color: #64748b;
    font-weight: 600;
    text-align: center;
    margin: 4px 0;
    line-height: 1.4;
}

.cart-checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, #f44336 0%, #c62828 100%);
    color: #ffffff;
    border: none;
    border-radius: 100px;
    padding: 16px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 8px 20px rgba(198, 40, 40, 0.2);
    letter-spacing: 0.5px;
}

.cart-checkout-btn:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(183, 28, 28, 0.3);
}

.cart-checkout-btn:active {
    transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */

/* Tablet Viewports */
@media (max-width: 1024px) {
    .cart-container-wrap {
        padding: 0 24px 60px;
    }

    .cart-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .cart-summary-column {
        position: static;
    }
}

/* Mobile Viewports */
@media (max-width: 768px) {
    .cart-container-wrap {
        padding: 0 16px 40px;
    }

    .cart-breadcrumb {
        padding: 16px 0;
        font-size: 11px;
    }

    .cart-header-controls {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 14px 18px;
        margin-bottom: 16px;
    }

    .cart-header-controls h1 {
        font-size: 17px;
    }

    .cart-item-card {
        padding: 16px;
    }

    /* Grid layout: Col 1 is 80px (Thumb), Col 2 is 1fr (Info/Actions) */
    .cart-item-main-row {
        display: grid;
        grid-template-columns: 80px 1fr;
        gap: 16px 20px;
        position: relative;
        padding-bottom: 8px;
        /* Room for a clean bottom spacing */
    }

    /* Row 1 Col 1: Product Image */
    .cart-item-thumb {
        grid-column: 1;
        grid-row: 1;
        width: 80px;
        height: 80px;
        margin: 0;
    }

    /* Row 1 Col 2: Title & Unit Price (stacked vertically) */
    .cart-item-info {
        grid-column: 2;
        grid-row: 1;
        padding-right: 32px;
        /* Prevent title from overlapping top-right checkbox */
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .cart-item-info h3 {
        font-size: 13.5px;
        margin: 0 0 6px 0;
        line-height: 1.4;
    }

    .price-capsule {
        margin-bottom: 0;
        /* Placed directly below the product title */
        align-self: flex-start;
    }

    /* Row 2 Col 1: Delete Button centered below image */
    .cart-item-info .delete-item-btn {
        position: absolute;
        left: 0;
        bottom: 30px;
        /* Centered vertically on the bottom row */
        width: auto;
        text-align: left;
        margin: 0;
        font-size: 13px;
        font-weight: 700;
    }

    /* Row 2 Col 2: Quantity selector & Subtotal block */
    .cart-item-right-actions {
        grid-column: 2;
        grid-row: 2;
        position: static;
        /* Let checkbox look up to .cart-item-main-row */
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: none;
        padding-top: 0;
        margin-top: 8px;
        /* Spacing between Row 1 and Row 2 */
    }

    /* Checkbox absolute top-right alignment relative to .cart-item-main-row */
    .item-checkbox-label {
        position: absolute;
        top: 2px;
        right: 0;
        margin: 0;
    }

    .item-checkbox-spacer {
        display: none;
    }

    .qty-selector {
        margin: 0;
    }

    .item-subtotal-block {
        margin: 0;
        text-align: right;
    }

    /* Nested Combo Items Mobile Layout */
    .combo-sub-items-list {
        margin-left: 10px;
        padding-left: 14px;
    }

    .sub-item-row {
        display: grid;
        grid-template-columns: 60px 1fr;
        gap: 12px 16px;
        position: relative;
    }

    .sub-item-thumb {
        grid-column: 1;
        grid-row: 1;
    }

    .sub-item-info {
        grid-column: 2;
        grid-row: 1;
    }

    .sub-item-right {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: none;
        padding-top: 0;
        margin-top: 0;
    }
}