/**
 * CS2 Skins Marketplace - Cart Page Styles
 * Premium dark-themed cart experience
 * 
 * @package CS2Skins
 * @version 1.0.0
 */

/* ===========================================
   CART CONTAINER
   =========================================== */

/* Override Tailwind max-width restriction */
.woocommerce-cart .max-w-4xl,
.wc-block-cart.alignwide {
    max-width: 100% !important;
}

.wc-block-cart {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ===========================================
   CART LAYOUT - TWO COLUMNS
   =========================================== */

@media (min-width: 992px) {
    .wc-block-cart {
        padding: 3rem 2rem;
    }
    
    /* Main wrapper - flexbox layout */
    .wc-block-components-sidebar-layout {
        display: flex;
        gap: 2rem;
        align-items: flex-start;
    }
    
    /* Left side: Cart items table */
    .wc-block-cart__main {
        flex: 1;
        min-width: 50%;
    }
    
    /* Right side: Cart totals */
    .wc-block-cart__sidebar {
        flex: 0 0 38%;
        position: sticky;
        top: 2rem;
    }
}

/* ===========================================
   CART TABLE
   =========================================== */

.wc-block-cart-items {
    width: 100%;
    background: var(--cs2-bg-primary);
    border: 1px solid var(--cs2-border);
    border-radius: 8px;
    overflow: hidden;
}

/* Table Header */
.wc-block-cart-items thead {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 2px solid var(--cs2-border);
}

.wc-block-cart-items__header th {
    padding: 1rem;
    font-family: 'Saira Semi Condensed', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cs2-accent-orange);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
}

.wc-block-cart-items__header-total {
    display: none !important;
}

/* Table Rows */
.wc-block-cart-items__row {
    border-bottom: 1px solid var(--cs2-border);
    transition: background-color 0.2s ease;
}

.wc-block-cart-items__row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.wc-block-cart-items__row:last-child {
    border-bottom: none;
}

/* Product Image */
.wc-block-cart-item__image {
    padding: 1.5rem 1rem;
    width: 120px;
}

.wc-block-cart-item__image img {
    width: 100px;
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--cs2-border);
}

/* Product Details */
.wc-block-cart-item__product {
    padding: 1.5rem 1rem;
}

.wc-block-components-product-name {
    font-family: 'Saira Semi Condensed', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.wc-block-components-product-name:hover {
    color: var(--cs2-accent-orange);
}

.wc-block-cart-item__prices {
    margin-top: 0.5rem;
}

.wc-block-cart-item__prices .wc-block-components-product-price__value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cs2-accent-orange);
}

/* Product Total */
.wc-block-cart-item__total {
   display: none !important;
}

/* ===========================================
   QUANTITY SELECTOR
   =========================================== */

/* Quantity Selector Hidden (Items are unique) */
.wc-block-cart-item__quantity,
.wc-block-components-quantity-selector {
   display: none;
}

/* Remove Item Button */
.wc-block-cart-item__remove-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.wc-block-cart-item__remove-link:hover {
    color: #ff4444;
}

/* ===========================================
   CART TOTALS SIDEBAR
   =========================================== */

.wc-block-cart__sidebar {
    background: var(--cs2-bg-primary);
    border: 1px solid var(--cs2-border);
    border-radius: 8px;
    padding: 2rem;
}

.wc-block-cart__totals-title {
    font-family: 'Saira Semi Condensed', sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--cs2-accent-orange);
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--cs2-border);
}

/* Totals Items */
.wc-block-components-totals-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--cs2-border);
}

.wc-block-components-totals-item:last-child {
    border-bottom: none;
}

.wc-block-components-totals-item__label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.wc-block-components-totals-item__value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
}

/* Footer Total */
.wc-block-components-totals-footer-item {
    padding: 1.5rem 0 0 0;
    margin-top: 1rem;
    border-top: 2px solid var(--cs2-accent-orange);
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
    font-family: 'Saira Semi Condensed', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cs2-accent-orange);
}

/* ===========================================
   PROCEED TO CHECKOUT BUTTON
   =========================================== */

.wc-block-cart__submit {
    margin-top: 2rem;
}

.wc-block-cart__submit-button {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--cs2-accent-orange) 0%, var(--cs2-accent-gold) 100%);
    border: none;
    border-radius: 6px;
    font-family: 'Saira Semi Condensed', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #000000;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 145, 0, 0.3);
}

.wc-block-cart__submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 145, 0, 0.5);
}

.wc-block-cart__submit-button:active {
    transform: translateY(0);
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */

@media (max-width: 991px) {
    .wc-block-cart {
        padding: 1rem;
    }
    
    .wc-block-components-sidebar-layout {
        flex-direction: column;
    }
    
    .wc-block-cart__main,
    .wc-block-cart__sidebar {
        width: 100%;
        margin-bottom: 2rem;
    }
    
    .wc-block-cart__sidebar {
        position: static;
    }
}

@media (max-width: 767px) {
    /* Compact Mobile view */
    .wc-block-cart-items__header {
        display: none; /* Hide header on mobile for cleaner look */
    }

    .wc-block-cart-items__row {
        display: grid;
        grid-template-columns: 80px 1fr auto; /* Image | details | remove */
        gap: 1rem;
        padding: 1rem;
        align-items: center;
    }

    /* Force image display & resize */
    .wc-block-cart-items__header-image,
    .wc-block-cart-item__image {
        display: block !important;
        padding: 0 !important;
        width: auto !important;
    }
    
    .wc-block-cart-item__image img {
        width: 60px !important;
        height: auto;
        border-radius: 4px;
    }

    /* Product Details */
    .wc-block-cart-item__product {
        padding: 0 !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .wc-block-components-product-name {
        font-size: 0.95rem;
        line-height: 1.2;
        margin-bottom: 0.25rem;
    }

    /* Remove link */
    .wc-block-cart-item__remove-link {
        font-size: 1.25rem; /* Make X bigger */
        padding: 0.5rem;
        color: #ff4444;
        text-decoration: none;
    }
    
    /* Ensure table cells don't behave like table cells */
    .wc-block-cart-items__row td {
        display: block;
        padding: 0;
    }
    
    /* Make the grid work by resetting these */
    .wc-block-cart-item__image-cell, 
    .wc-block-cart-item__product-cell {
         width: auto;
    }
}
