/* Custom WooCommerce Cart Page Styling */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* Reset WooCommerce defaults that break layout */
.woocommerce-cart .woocommerce-cart-form,
.woocommerce-cart .cart-collaterals {
    float: none !important;
    width: auto !important;
}

.woocommerce-cart .woocommerce {
    margin: 40px auto;
    font-family: 'Montserrat', sans-serif;
    padding: 0 20px;
}

/* Cart Page Header */
.cc-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.cc-cart-title {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.cc-cart-btn-buy-more {
    font-size: 14px;
    font-weight: 600;
    color: var(--cc-primary-color);
    text-decoration: none;
    border: 1.5px solid var(--cc-primary-color);
    padding: 9px 18px;
    border-radius: 8px;
    transition: all 0.2s;
}

.cc-cart-btn-buy-more:hover {
    background: var(--cc-primary-color);
    color: #fff !important;
}

/* ============================
   TWO COLUMN LAYOUT
   ============================ */
.cc-cart-columns-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    margin-top: 24px;
}

/* Left column: product table */
.cc-cart-columns-wrapper .cc-cart-left-col {
    flex: 0 0 65% !important;
    width: 65% !important;
    min-width: 0;
    margin: 0 !important;
}

/* Right column: coupon + totals */
.cc-cart-columns-wrapper .cc-cart-right-col {
    flex: 0 0 calc(35% - 24px) !important;
    width: calc(35% - 24px) !important;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* The collaterals box itself */
.cc-cart-columns-wrapper .cart-collaterals {
    width: 100% !important;
    float: none !important;
}

/* Left column: product table */
.cc-custom-cart .cc-cart-left-col {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

/* Right column: coupon + totals */
.cc-custom-cart .cc-cart-right-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Remove default WooCommerce cart_totals width constraint */
.cc-custom-cart .cart-collaterals .cart_totals {
    float: none !important;
    width: 100% !important;
}

/* ============================
   TABLE DESIGN
   ============================ */
/* Hide WooCommerce default thumbnail column — we render the image in our name cell */
.shop_table.cart .product-thumbnail {
    display: none !important;
}

/* Table Design */
.shop_table.cart {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Montserrat', sans-serif;
    table-layout: fixed !important;
}

.shop_table.cart thead th {
    background: #f9fafb;
    padding: 12px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    text-align: left;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.shop_table.cart tbody tr.cart_item {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.shop_table.cart tbody tr.cart_item:hover {
    background: #fafafa;
}

.shop_table.cart tbody td {
    padding: 16px 10px;
    vertical-align: middle;
}

/* Explicit Table Column Constraints for a Compact Layout */
.shop_table.cart th.product-remove,
.shop_table.cart td.product-remove {
    width: 40px !important;
    padding-right: 0 !important;
    text-align: center;
}

.shop_table.cart th.product-price,
.shop_table.cart td.product-price {
    width: 110px !important;
    white-space: nowrap;
    text-align: center;
}

.shop_table.cart th.product-quantity,
.shop_table.cart td.product-quantity {
    width: 140px !important;
    white-space: nowrap;
    text-align: center;
}

.shop_table.cart th.product-subtotal,
.shop_table.cart td.product-subtotal {
    width: 140px !important;
    white-space: nowrap;
    text-align: center;
}

.shop_table.cart th.product-name {
    width: auto !important;
    text-align: center;
}

/* Checkbox */
.cc-cart-checkbox-wrap input[type="checkbox"] {
    width: 17px;
    height: 17px;
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--cc-primary-color);
    text-align: center;
}

/* Product Info */
.cc-cart-item-info-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cc-cart-item-thumb img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
    max-width: 60px !important;
}

.cc-cart-item-name {
    font-weight: 600;
    font-size: 13px;
    color: #111827;
    display: block;
    line-height: 1.4;
    word-break: break-word;
}

.cc-cart-item-name a {
    font-weight: 600 !important;
}

/* Unit Price */
.cc-cart-item-unit-price {
    font-weight: 600;
    font-size: 14px;
    color: #ef4444;
}

.cc-cart-item-unit-price del {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
    text-decoration: line-through;
}

.product-subtotal .woocommerce-Price-amount {
    font-weight: 700;
    color: #ef4444;
    font-size: 15px;
}

/* Quantity Selector */
.cc-cart-qty-picker {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cc-qty-btn {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1.5px solid #d1d5db;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.cc-qty-btn:hover {
    border-color: var(--cc-primary-color);
    color: var(--cc-primary-color);
}

.cc-qty-input {
    width: 40px;
    flex-shrink: 0;
    text-align: center;
    border: none;
    font-weight: 700;
    font-size: 16px;
    color: #111827;
    background: transparent;
    font-family: 'Montserrat', sans-serif;
    /* Hide browser number input spinners */
    -moz-appearance: textfield;
    appearance: textfield;
}

.cc-qty-input::-webkit-outer-spin-button,
.cc-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Actions Footer - Hidden since cart auto-updates seamlessly */
.shop_table.cart td.actions {
    display: none !important;
}

/* Remove/Trash */
.product-remove .remove {
    color: #9ca3af !important;
    font-size: 20px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.product-remove .remove:hover {
    color: #ef4444 !important;
    background: transparent !important;
}

/* ============================
   SIDEBAR CARDS
   ============================ */
.cc-cart-sidebar-card {
    background: #fff;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.07);
}

.cc-cart-sidebar-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #111827;
    font-family: 'Montserrat', sans-serif;
}

.cc-cart-sidebar-card h3 svg {
    fill: var(--cc-primary-color);
    background: var(--cc-primary-alpha);
    padding: 6px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-sizing: border-box;
}

/* Sidebar Real Coupon Form */
.cc-coupon-real-form {
    display: flex;
    gap: 12px;
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: stretch;
}

.cc-coupon-real-form .input-text {
    flex: 1;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0px 18px;
    font-size: 15px;
    color: #374151;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    width: 100%;
    transition: all 0.2s;
}

.cc-coupon-real-form .input-text::placeholder {
    color: #9ca3af;
    font-weight: 500;
}

.cc-coupon-real-form .input-text:focus {
    border-color: var(--cc-primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px var(--cc-primary-alpha);
}

.cc-btn-apply-coupon {
    background: var(--cc-primary-color) !important;
    /* Exact purple/indigo match from image */
    color: #fff !important;
    border: none;
    border-radius: 8px;
    padding: 0 26px;
    /* Let it stretch or flex */
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: background 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cc-btn-apply-coupon:hover {
    background: var(--cc-primary-hover) !important;
}

/* WooCommerce totals styling inside card */
.cc-totals-card .cart_totals h2 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 16px 0;
    font-family: 'Montserrat', sans-serif;
    color: #111827;
}

.cc-totals-card .cart_totals table {
    width: 100%;
    border-collapse: collapse;
}

.cc-totals-card .cart_totals table tr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f3f4f6;
    padding: 10px 0;
}

.woocommerce-cart-form .woocommerce-shipping-totals {
    display: none !important;
}

.cc-totals-card .cart_totals table tr th,
.cc-totals-card .cart_totals table tr td {
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    font-family: 'Montserrat', sans-serif;
    border: none;
    display: block !important;
}

.cc-totals-card .cart_totals table tr td {
    text-align: right;
}

/* Hide WooCommerce native ::before labels if they appear */
.cc-totals-card .cart_totals table.shop_table_responsive tr td::before {
    display: none !important;
}

.cc-totals-card .cart_totals table tr:last-child {
    border-bottom: none;
}

.cc-totals-card .cart_totals table .order-total {
    padding-top: 14px;
    margin-top: 4px;
}

.cc-totals-card .cart_totals table .order-total th,
.cc-totals-card .cart_totals table .order-total td {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.cc-totals-card .cart_totals table .order-total .woocommerce-Price-amount {
    color: #ef4444;
    font-weight: 800;
}

.cc-totals-card .wc-proceed-to-checkout {
    margin-top: 16px;
}

.checkout-button {
    width: 100% !important;
    background: var(--cc-primary-color) !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    padding: 15px 24px !important;
    border-radius: 10px !important;
    text-transform: none !important;
    transition: background 0.25s !important;
    letter-spacing: 0.01em !important;
    display: block !important;
    text-align: center !important;
    font-family: 'Montserrat', sans-serif !important;
}

.checkout-button:hover {
    background: var(--cc-primary-hover) !important;
}

/* WooCommerce coupon + update bar */
.woocommerce-cart .actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-top: 1px solid #f3f4f6;
}

.woocommerce-cart .actions .coupon {
    display: flex;
    gap: 8px;
    align-items: center;
}

.woocommerce-cart .actions .coupon input[type="text"] {
    padding: 9px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.woocommerce-cart .actions .coupon input[type="text"]:focus {
    border-color: var(--cc-primary-color);
}

/* ============================
   RESPONSIVE MOBILE
   ============================ */
@media (max-width: 991px) {
    .cc-custom-cart .woocommerce {
        flex-direction: column !important;
        padding: 0 12px !important;
    }

    .cc-cart-columns-wrapper {
        flex-direction: column !important;
        margin-top: 16px !important;
    }

    .cc-cart-columns-wrapper .cc-cart-left-col,
    .cc-cart-columns-wrapper .cc-cart-right-col,
    .cc-custom-cart .cc-cart-left-col,
    .cc-custom-cart .cart-collaterals {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Beautify Mobile Cart List (Cards layout) */
    .cc-custom-cart .cc-cart-left-col {
        background: transparent !important;
        box-shadow: none !important;
    }

    table.shop_table_responsive thead,
    .shop_table.cart tbody tr.cart_item td::before {
        display: none !important;
    }

    .shop_table.cart {
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    .shop_table.cart tbody {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .shop_table.cart tbody tr.cart_item {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        padding: 16px !important;
        background: #fff !important;
        border-radius: 12px !important;
        box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05) !important;
        border: 1px solid #e5e7eb !important;
        position: relative !important;
        margin: 0 !important;
    }

    .shop_table.cart tbody td {
        display: flex !important;
        border: none !important;
        padding: 0 !important;
        text-align: left !important;
    }

    .shop_table.cart td.product-remove {
        position: absolute !important;
        top: 16px !important;
        right: 16px !important;
        width: auto !important;
        z-index: 10;
        margin: 0 !important;
    }

    .product-remove .remove {
        width: 32px !important;
        height: 32px !important;
        background: #f9fafb !important;
        border-radius: 8px !important;
        color: #9ca3af !important;
    }

    .shop_table.cart td.product-name {
        width: 100% !important;
        margin-bottom: 16px !important;
        padding-right: 32px !important;
        /* space for trash */
    }

    .shop_table.cart td.product-price {
        display: none !important;
        /* Hide unit price on mobile to save space */
    }

    .shop_table.cart td.product-quantity {
        width: auto !important;
    }

    .shop_table.cart td.product-subtotal {
        width: auto !important;
        flex-grow: 1 !important;
        justify-content: flex-end !important;
        align-items: center !important;
    }

    .product-subtotal .woocommerce-Price-amount {
        font-size: 16px !important;
    }
}