/* Cart Styles */
.cart-section {
    padding: 4rem 0;
    background: #fff;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 4rem;
}

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

.cart-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 50px;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    color: var(--color-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cart-item {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 50px;
    gap: 1rem;
    align-items: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.cart-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cart-item-product {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8f8f8;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder.tiny {
    min-height: 80px;
    font-size: 0.5rem;
}

.cart-item-details h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin: 0 0 0.25rem;
    font-weight: 600;
}

.cart-item-details h3 a:hover {
    color: var(--color-accent);
}

.cart-item-variant {
    color: var(--color-muted);
    font-size: 0.9rem;
    margin: 0;
}

.cart-item-price,
.cart-item-total {
    font-weight: 600;
    font-size: 1.05rem;
}

.cart-item-total {
    color: var(--color-accent);
}

/* Quantity Input */
.quantity-form {
    display: flex;
    align-items: center;
}

.quantity-controls {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.25rem;
    width: fit-content; /* Ensure it doesn't stretch */
    flex-wrap: nowrap; /* Force single line */
}

.quantity-controls input {
    width: 40px;
    padding: 0.25rem;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    -moz-appearance: textfield;
}

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

.qty-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: var(--color-muted);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.qty-btn:hover:not(:disabled) {
    background: #f0f0f0;
    color: var(--color-dark);
}

.qty-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Remove Button */
.remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.remove-btn:hover {
    color: #ff5f5f;
    background: rgba(255, 95, 95, 0.1);
    transform: none;
}

/* Cart Summary */
.cart-summary {
    background: #f9f9f9;
    padding: 2rem;
    border-radius: 16px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.cart-summary h2 {
    margin-top: 0;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.summary-row.total {
    border-top: 2px solid var(--color-border);
    padding-top: 1rem;
    margin-top: 1rem;
    font-weight: 700;
    font-size: 1.25rem;
}

.shipping-note {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-bottom: 2rem;
}

.no-refund-notice {
    font-size: 0.78rem;
    color: var(--color-muted);
    text-align: center;
    margin-top: 0.75rem;
    line-height: 1.5;
}

.no-refund-notice a {
    color: inherit;
    text-decoration: underline;
}

.continue-shopping {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: var(--color-muted);
    text-decoration: underline;
    font-size: 0.9rem;
}

.continue-shopping:hover {
    color: var(--color-accent);
}

.empty-cart {
    text-align: center;
    padding: 4rem 0;
}

.empty-cart p {
    font-size: 1.25rem;
    color: var(--color-muted);
    margin-bottom: 2rem;
}

/* Responsive Cart */
@media (max-width: 1024px) {
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .cart-summary {
        position: static;
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .cart-header {
        display: none; /* Hide header on mobile */
    }
    
    .cart-item {
        grid-template-columns: 1fr 100px;
        grid-template-areas:
            "product total"
            "details details"
            "quantity remove";
        gap: 0.5rem;
        border-bottom: 1px solid var(--color-border);
        padding: 1.5rem 0;
    }
    
    .cart-item-product {
        grid-area: product;
    }
    
    .cart-item-details {
        grid-area: details;
    }
    
    .cart-item-price {
        display: none; /* Hide unit price on mobile, show total */
    }
    
    .cart-item-quantity {
        grid-area: quantity;
    }
    
    .cart-item-total {
        grid-area: total;
        text-align: right;
    }
    
    .cart-item-remove {
        grid-area: remove;
        text-align: right;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
    }
}

