/* static/css/pages/cart.css */
/* ====================================================
   CART PAGE SPECIFIC STYLES
   ==================================================== */

/* ====================================================
   PAGE HEADER
   ==================================================== */
.page-header {
    padding: 1.5rem 0 0.5rem;
    background: var(--white);
}

.page-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--dark-charcoal);
    margin: 0;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--dark-charcoal);
    opacity: 0.7;
    margin: 0.25rem 0 0;
}

/* ====================================================
   CART TABLE
   ==================================================== */
.cart-section {
    padding: 1.5rem 0 3rem;
}

.cart-table-wrapper {
    overflow-x: auto;
    margin-bottom: 2rem;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.cart-table thead {
    background: var(--light-blue-bg);
    border-bottom: 2px solid var(--light-gray);
}

.cart-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark-charcoal);
}

.cart-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--light-gray);
    vertical-align: middle;
}

.cart-table tbody tr:last-child td {
    border-bottom: none;
}

/* Product cell */
.product-cell {
    min-width: 200px;
}

.cart-product-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}

.cart-product-link:hover {
    text-decoration: none;
}

.cart-product-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    background: var(--light-blue-bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.25rem;
}

.cart-product-name {
    font-weight: 500;
    color: var(--dark-charcoal);
}

.cart-product-link:hover .cart-product-name {
    color: var(--primary-blue);
}

/* Price & subtotal */
.price-cell,
.subtotal-cell {
    font-weight: 500;
    color: var(--dark-charcoal);
}

.subtotal-cell {
    font-weight: 600;
    color: var(--primary-blue);
}

/* Quantity */
.quantity-cell {
    min-width: 120px;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--light-gray);
    border-radius: var(--radius-sm);
    overflow: hidden;
    width: fit-content;
}

.quantity-control .qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--white);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
    color: var(--dark-charcoal);
}

.quantity-control .qty-btn:hover {
    background: var(--light-blue-bg);
}

.quantity-control .qty-btn:active {
    transform: scale(0.95);
}

.quantity-control .qty-input {
    width: 40px;
    height: 30px;
    border: none;
    border-left: 1px solid var(--light-gray);
    border-right: 1px solid var(--light-gray);
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font-family);
    color: var(--dark-charcoal);
    background: var(--white);
    -moz-appearance: textfield;
    appearance: textfield;
}

.quantity-control .qty-input::-webkit-inner-spin-button,
.quantity-control .qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Action cell */
.action-cell {
    text-align: center;
}

.remove-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
}

/* ====================================================
   CART SUMMARY
   ==================================================== */
.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--light-blue-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--light-gray);
}

.cart-total {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.total-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-charcoal);
}

.total-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.cart-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cart-actions .btn {
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
}

/* ====================================================
   EMPTY CART
   ==================================================== */
.empty-cart {
    text-align: center;
    padding: 4rem 1rem;
}

.empty-cart-icon {
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-cart h2 {
    font-size: 1.8rem;
    color: var(--dark-charcoal);
    margin-bottom: 0.5rem;
}

.empty-cart p {
    font-size: 1.1rem;
    color: var(--dark-charcoal);
    opacity: 0.7;
    margin-bottom: 2rem;
}

.empty-cart .btn {
    padding: 0.8rem 2.5rem;
    font-size: 1.1rem;
}

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-width: 768px) {
    .cart-table thead {
        display: none;
    }
    .cart-table tbody tr {
        display: block;
        border: 1px solid var(--light-gray);
        border-radius: var(--radius-md);
        padding: 0.75rem;
        margin-bottom: 1rem;
        background: var(--white);
    }
    .cart-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--light-gray);
        text-align: right;
    }
    .cart-table td:last-child {
        border-bottom: none;
    }
    .cart-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--dark-charcoal);
        opacity: 0.7;
        font-size: 0.85rem;
    }
    .product-cell {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .cart-product-link {
        width: 100%;
    }
    .cart-product-image {
        width: 50px;
        height: 50px;
    }
    .quantity-cell {
        justify-content: flex-end;
    }
    .quantity-control {
        margin-left: auto;
    }
    .action-cell {
        justify-content: flex-end;
    }
    .cart-summary {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    .cart-total {
        justify-content: center;
    }
    .cart-actions {
        justify-content: center;
    }
    .cart-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.6rem;
    }
    .cart-product-name {
        font-size: 0.9rem;
    }
    .total-price {
        font-size: 1.3rem;
    }
}