:root {
    --cart-bg-color: #0b090a;
}

body.store-page.cart-page {
    background-color: var(--cart-bg-color);
    min-height: 100vh;
}

.cart-container {
    padding: 4rem 2rem;
    max-width: 900px;
    margin: 0 auto;
    color: white;
    font-family: inherit;
}

/* Page Header Row */
.cart-page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-page-header-row h1 {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.25rem;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.back-to-store {
    font-family: 'IBM Plex Mono', monospace;
    text-transform: uppercase;
    font-size: 1rem;
    color: white;
    text-decoration: underline;
    text-underline-offset: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.back-to-store:hover {
    opacity: 1;
}

/* Table Header */
.cart-table-header {
    display: grid;
    grid-template-columns: 3fr 1.5fr 1fr;
    /* Product | Quantity | Total */
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.80rem;
    color: #888;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.th-total {
    text-align: right;
}

/* Cart Items */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 3fr 1.5fr 1fr;
    align-items: center;
    /* Vertically center everything */
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Product Column */
.td-product {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.item-image {
    width: 65px;
    height: 65px;
    object-fit: cover;
    background-color: #0b090a;
    border-radius: 50%;
    /* Circular image as seen in some modern designs, or keep square if screenshot implied */
    /* Screenshot seemed to show a CD image which might be circular or square. Let's stick to square for now based on previous css, 
       but if user wants round like a CD, we can adjust. The screenshot showed the product image. */
    border-radius: 0;
    /* Keeping square based on standard minimal vibe unless specified */
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.item-title {
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    line-height: 1.2;
    word-break: keep-all;
    /* Prevents CJK word breaking */
    overflow-wrap: break-word;
    /* Still allows long English words to break if needed */
}

.item-price {
    font-family: 'IBM Plex Mono', monospace;
    color: #888;
    font-size: 0.85rem;
}

/* Quantity Column */
.td-quantity {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.qty-form {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid #333;
}

.qty-btn {
    font-family: 'IBM Plex Mono', monospace;
    background: none;
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.qty-btn:hover {
    background-color: #222;
}

.qty-display {
    font-family: 'IBM Plex Mono', monospace;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #333;
    border-right: 1px solid #333;
    font-size: 0.9rem;
}

.remove-link {
    font-family: 'IBM Plex Mono', monospace;
    background: none;
    border: none;
    color: #666;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-transform: uppercase;
    font-size: 0.7rem;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: color 0.2s;
    padding: 0;
}

.remove-link:hover {
    color: #999;
}

/* Total Column */
.td-total {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1rem;
    text-align: right;
    font-weight: 400;
    letter-spacing: 0.05em;
}

/* Summary Section */
.cart-summary {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.subtotal-line {
    font-family: 'IBM Plex Mono', monospace;
    /* Ensure consistent font */
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    display: flex;
    gap: 1rem;
    align-items: baseline;
}

.subtotal-label {
    text-transform: uppercase;
    font-weight: 400;
}

.subtotal-value {
    font-weight: 500;
}

.shipping-note {
    font-family: 'IBM Plex Mono', monospace;
    text-transform: uppercase;
    color: #9e9e9e;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
}

.checkout-btn {
    font-family: 'IBM Plex Mono', monospace;
    background-color: #591C1E;
    /* Darker red/brown */
    color: #fff;
    border: none;
    padding: 1rem 3rem;
    font-size: 0.9rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: background-color 0.2s;
    min-width: 200px;
}

.checkout-btn:hover {
    background-color: #6d2225;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 6rem 0;
    font-family: 'IBM Plex Mono', monospace;
}

.empty-cart p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cart-table-header {
        display: grid;
        grid-template-columns: 1fr auto;
    }

    .cart-table-header .th-quantity {
        display: none;
    }

    .cart-item {
        grid-template-columns: 1fr auto;
        gap: 0.5rem;
        position: relative;
    }

    /* Product on left */
    .td-product {
        grid-column: 1;
        grid-row: 1;
        margin-bottom: 0.5rem;
        padding-right: 0;
    }

    .item-title {
        font-size: 1rem;
    }

    /* Total on right, aligned to top */
    .td-total {
        grid-column: 2;
        grid-row: 1;
        text-align: right;
        font-size: 1rem;
        align-self: center;
    }

    /* Quantity spans full width below */
    .td-quantity {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
        width: 100%;
    }

    .item-image {
        width: 65px;
        height: 65px;
    }

    .shipping-note {
        font-size: 0.75rem;
    }
}