/* =================================================
   COMMERCE CART PAGE — Modern Design
   ================================================= */

/* === Cart Page Header (title + continue shopping) === */
.cart-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 32px auto 20px;
    max-width: 1400px;
    padding: 0 20px;
}

.cart-page-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 28px;
    font-weight: 900;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.5px;
}

.cart-page-title svg {
    color: #AC0401;
    flex-shrink: 0;
}

.btn-continue-shopping {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    background: #ffffff;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-continue-shopping:hover {
    border-color: #AC0401;
    color: #AC0401;
    text-decoration: none;
    background: #fff5f5;
    transform: translateX(-3px);
}

.commerce-cart-form-container {
    max-width: 1400px;
    margin: 40px auto 100px;
    padding: 0 20px 60px;
}

/* 2-Column Grid Layout */
.cart-layout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    align-items: start;
}

/* Items Section */
form[id*="views-form-commerce-cart-form"] {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 30px;
    border: 1px solid #f0f0f0;
}

/* Table Styling - Modernizing the Bootstrap Table */
form[id*="views-form-commerce-cart-form"] .table-responsive {
    border: none;
    overflow: visible !important;
    overflow-x: hidden !important;
}

form[id*="views-form-commerce-cart-form"] table.views-table {
    border-collapse: separate;
    border-spacing: 0 15px;
    margin-top: -15px;
    width: 100%;
    --bs-table-striped-bg: transparent !important;
    --bs-table-hover-bg: transparent !important;
    --bs-table-accent-bg: transparent !important;
}

/* Remove Bootstrap Stripe/Hover Backgrounds Completely */
form[id*="views-form-commerce-cart-form"] table.table-striped>tbody>tr:nth-of-type(odd)>*,
form[id*="views-form-commerce-cart-form"] table.table-hover>tbody>tr:hover>* {
    background-color: transparent !important;
    box-shadow: none !important;
}

/* === Desktop Table Header === */
form[id*="views-form-commerce-cart-form"] thead tr {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
}

form[id*="views-form-commerce-cart-form"] thead th {
    border: none;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    padding: 12px 20px;
    letter-spacing: 1px;
    background: transparent;
}

/* Remove button — desktop styles kept intact */
.delete-order-item {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
}

form[id*="views-form-commerce-cart-form"] tbody tr {
    background: #fff !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

form[id*="views-form-commerce-cart-form"] tbody td {
    padding: 20px;
    vertical-align: middle;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

form[id*="views-form-commerce-cart-form"] tbody td:first-child {
    border-left: 1px solid #f1f5f9;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

form[id*="views-form-commerce-cart-form"] tbody td:last-child {
    border-right: 1px solid #f1f5f9;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Image Column — constrained size */
.views-field-field-product-image img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 10px;
    background: #f8fafc;
    padding: 6px;
    border: 1px solid #e2e8f0;
    display: block;
}

/* Title Column */
.views-field-purchased-entity a {
    font-weight: 700;
    color: #1e293b;
    font-size: 15px;
    text-decoration: none;
    transition: color 0.2s;
    line-height: 1.4;
}

.views-field-purchased-entity a:hover {
    color: #AC0401;
}

/* Price column */
.views-field-unit-price__number,
.views-field-total-price__number {
    font-weight: 700;
    color: #1e293b;
    font-size: 15px;
}

/* Quantity Input */
.quantity-edit-input {
    max-width: 80px;
    height: 40px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #cbd5e1 !important;
    font-weight: 600;
}

/* Remove Button */
.delete-order-item {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
}

.delete-order-item:hover {
    background: #fecaca !important;
    transform: scale(1.05);
}

/* Summary Section */
.cart-summary-section {
    position: sticky;
    top: 20px;
}

.cart-summary-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
}

.summary-title {
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
}

/* Order Totals */
.order-total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 15px;
    color: #64748b;
}

.order-total-line__total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f1f5f9;
    font-size: 22px;
    font-weight: 800;
    color: #1e293b;
}

.order-total-line-value {
    color: #1e293b;
    font-weight: 700;
}

.order-total-line__total .order-total-line-value {
    color: #AC0401;
}

/* Form Actions */
.cart-form-actions {
    margin-top: 30px;
}

#edit-actions {
    margin-bottom: 50px !important;
}

.cart-form-actions .form-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* Increased gap */
}

.cart-form-actions .btn {
    width: 100%;
    height: 55px;
    border-radius: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

#edit-submit {
    background: #ffffff !important;
    color: #475569 !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 50px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
    transition: all 0.25s ease !important;
}

.btn-update-cart-icon {
    display: inline-block;
    font-size: 16px;
    line-height: 1;
}

#edit-submit::before {
    content: "↺";
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
}

#edit-submit:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #1e293b !important;
}

#edit-checkout {
    background: linear-gradient(135deg, #8b0000 0%, #AC0401 50%, #c5060a 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 50px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 20px rgba(172, 4, 1, 0.35) !important;
    transition: all 0.3s ease !important;
}

#edit-checkout::before {
    content: "🛒";
    font-size: 16px;
    line-height: 1;
}

#edit-checkout:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 30px rgba(172, 4, 1, 0.5) !important;
    background: linear-gradient(135deg, #6e0000 0%, #9a0301 50%, #b2050a 100%) !important;
}

/* Responsive Customizations */
@media (max-width: 1200px) {
    .cart-layout-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

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

@media (max-width: 991px) {

    /* === CONTAINER OVERRIDES === */
    .commerce-cart-form-container {
        overflow-x: hidden;
        padding: 0 12px 40px;
    }

    .cart-page-header {
        padding: 0 12px;
        margin: 20px auto 14px;
    }

    .cart-page-title {
        font-size: 22px;
    }

    form[id*="views-form-commerce-cart-form"] {
        padding: 0;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    /* === KILL TABLE STRUCTURE === */
    form[id*="views-form-commerce-cart-form"] .table-responsive {
        overflow: hidden !important;
        overflow-x: hidden !important;
        border: none !important;
    }

    form[id*="views-form-commerce-cart-form"] table.views-table {
        display: block !important;
        width: 100% !important;
        border-collapse: collapse !important;
        border-spacing: 0 !important;
    }

    /* Hide table headers */
    form[id*="views-form-commerce-cart-form"] thead,
    form[id*="views-form-commerce-cart-form"] table thead,
    form[id*="views-form-commerce-cart-form"] table.views-table thead,
    form[id*="views-form-commerce-cart-form"] thead tr,
    form[id*="views-form-commerce-cart-form"] thead th,
    form[id*="views-form-commerce-cart-form"] table thead tr,
    form[id*="views-form-commerce-cart-form"] table thead th {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    form[id*="views-form-commerce-cart-form"] tbody {
        display: block !important;
        width: 100%;
    }

    /* Reset Bootstrap stripe/hover */
    form[id*="views-form-commerce-cart-form"] table.table-striped>tbody>tr:nth-of-type(odd)>*,
    form[id*="views-form-commerce-cart-form"] table.table-hover>tbody>tr:hover>* {
        background-color: transparent !important;
        box-shadow: none !important;
        color: inherit !important;
    }

    /* === EACH ROW = PRODUCT CARD === */
    form[id*="views-form-commerce-cart-form"] tbody tr {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: stretch !important;
        margin-bottom: 16px !important;
        margin-top: 16px !important;
        padding: 16px !important;
        border: 1px solid #e8ecf1 !important;
        border-radius: 14px !important;
        background: #ffffff !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        position: relative !important;
    }

    /* Reset all TDs */
    form[id*="views-form-commerce-cart-form"] tbody td {
        display: block !important;
        border: none !important;
        padding: 0 !important;
        background: transparent !important;
        text-align: left !important;
        color: #1e293b !important;
    }

    form[id*="views-form-commerce-cart-form"] tbody td::before {
        display: none !important;
        content: none !important;
    }

    /* ===========================
       TOP ROW: Image | Title | Trash
       =========================== */

    /* Product Image */
    form[id*="views-form-commerce-cart-form"] .views-field-field-product-image {
        width: 72px !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: flex-start !important;
        justify-content: center !important;
    }

    form[id*="views-form-commerce-cart-form"] .views-field-field-product-image img {
        width: 68px !important;
        height: 68px !important;
        object-fit: contain !important;
        border-radius: 10px !important;
        background: #f5f7fa !important;
        border: 1px solid #e8ecf1 !important;
        padding: 4px !important;
        margin: 0 !important;
        display: block !important;
    }

    /* Product Name */
    form[id*="views-form-commerce-cart-form"] .views-field-purchased-entity {
        width: calc(100% - 120px) !important;
        flex: 0 0 calc(100% - 120px) !important;
        padding: 0 10px !important;
        display: flex !important;
        align-items: flex-start !important;
        min-width: 0 !important;
    }

    form[id*="views-form-commerce-cart-form"] .views-field-purchased-entity a {
        font-size: 14px !important;
        font-weight: 700 !important;
        color: #1e293b !important;
        text-decoration: none !important;
        line-height: 1.35 !important;
        word-break: break-word !important;
    }

    /* Remove Button = trash icon, top-right */
    form[id*="views-form-commerce-cart-form"] .views-field-remove-button {
        width: 36px !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: flex-start !important;
        justify-content: center !important;
        padding-top: 2px !important;
        border: none !important;
        margin: 0 !important;
    }

    form[id*="views-form-commerce-cart-form"] .views-field-remove-button .delete-order-item {
        font-size: 0 !important;
        color: transparent !important;
        background: transparent !important;
        border: none !important;
        padding: 4px !important;
        width: 32px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: none !important;
        transform: none !important;
        cursor: pointer !important;
    }

    form[id*="views-form-commerce-cart-form"] .views-field-remove-button .delete-order-item::before {
        content: "\1F5D1";
        font-size: 18px !important;
        color: #dc2626 !important;
        display: block !important;
    }

    /* ========================================
       BOTTOM ROW: Unit Price | Qty | Total
       ======================================== */

    /* Unit Price */
    form[id*="views-form-commerce-cart-form"] .views-field-unit-price__number {
        order: 10 !important;
        flex: 1 1 0% !important;
        margin-top: 14px !important;
        padding-top: 14px !important;
        border-top: 1px solid #f0f2f5 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    form[id*="views-form-commerce-cart-form"] .views-field-unit-price__number::before {
        content: "UNIT PRICE" !important;
        display: block !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        color: #94a3b8 !important;
        letter-spacing: 0.8px !important;
        text-transform: uppercase !important;
        margin-bottom: 4px !important;
    }

    form[id*="views-form-commerce-cart-form"] .views-field-unit-price__number .field-content,
    form[id*="views-form-commerce-cart-form"] .views-field-unit-price__number {
        font-size: 15px !important;
        font-weight: 800 !important;
        color: #1e293b !important;
    }

    /* Quantity */
    form[id*="views-form-commerce-cart-form"] .views-field-edit-quantity {
        order: 11 !important;
        flex: 1 1 0% !important;
        margin-top: 14px !important;
        padding-top: 14px !important;
        border-top: 1px solid #f0f2f5 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    form[id*="views-form-commerce-cart-form"] .views-field-edit-quantity::before {
        content: "QUANTITY" !important;
        display: block !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        color: #94a3b8 !important;
        letter-spacing: 0.8px !important;
        text-transform: uppercase !important;
        margin-bottom: 4px !important;
    }

    form[id*="views-form-commerce-cart-form"] .views-field-edit-quantity .form-number,
    form[id*="views-form-commerce-cart-form"] .views-field-edit-quantity input[type="number"] {
        width: 50px !important;
        height: 36px !important;
        text-align: center !important;
        border-radius: 8px !important;
        border: 1px solid #cbd5e1 !important;
        font-size: 14px !important;
        font-weight: 700 !important;
    }

    /* Total Price */
    form[id*="views-form-commerce-cart-form"] .views-field-total-price__number {
        order: 12 !important;
        flex: 1 1 0% !important;
        margin-top: 14px !important;
        padding-top: 14px !important;
        border-top: 1px solid #f0f2f5 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
    }

    form[id*="views-form-commerce-cart-form"] .views-field-total-price__number::before {
        content: "TOTAL" !important;
        display: block !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        color: #94a3b8 !important;
        letter-spacing: 0.8px !important;
        text-transform: uppercase !important;
        margin-bottom: 4px !important;
    }

    form[id*="views-form-commerce-cart-form"] .views-field-total-price__number .field-content,
    form[id*="views-form-commerce-cart-form"] .views-field-total-price__number {
        font-size: 15px !important;
        font-weight: 800 !important;
        color: #AC0401 !important;
    }

    /* === SUMMARY / ACTIONS === */
    .cart-summary-card {
        padding: 18px !important;
        border-radius: 14px !important;
    }

    .summary-title {
        font-size: 16px;
    }

    .order-total-line {
        font-size: 13px;
    }

    .order-total-line__total {
        font-size: 16px;
    }

    /* Buttons side-by-side on mobile */
    #edit-actions {
        display: flex !important;
        gap: 12px !important;
        margin-bottom: 40px !important;
    }

    #edit-submit,
    #edit-checkout {
        flex: 1 !important;
        height: 46px !important;
        font-size: 13px !important;
    }
}




/* =================================================
   EMPTY CART PAGE
   ================================================= */

.cart-empty-page {
    max-width: 1320px;
    margin: 40px auto;
    padding: 0 24px;
    text-align: center;
}

.cart-empty-wrapper {
    background: #ffffff;
    border-radius: 16px;
    padding: 80px 40px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
    max-width: 520px;
    margin: 80px auto;
}

.cart-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    color: #cbd5e1;
}

.cart-empty-icon svg {
    width: 100%;
    height: 100%;
}

.cart-empty-page h2 {
    font-size: 24px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 12px;
}

.cart-empty-page p {
    font-size: 15px;
    color: #64748b;
    margin: 0 0 28px;
    line-height: 1.6;
}

.cart-empty-page .btn-continue-shopping {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 32px;
    background: linear-gradient(135deg, #AC0401 0%, #d90429 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(172, 4, 1, 0.3);
}

.cart-empty-page .btn-continue-shopping:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(172, 4, 1, 0.4);
    color: #ffffff;
    text-decoration: none;
}

@media (max-width: 768px) {
    .cart-empty-wrapper {
        padding: 48px 24px;
        margin: 40px auto;
    }

    .cart-empty-page h2 {
        font-size: 20px;
    }

    .cart-empty-page p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .cart-empty-wrapper {
        padding: 40px 20px;
    }
}