/* Cart Page Styles - uses brand CSS custom properties */

.cart-page {
    background: var(--brand-background, #f8f9fa);
    font-family: var(--font-body, 'Segoe UI', system-ui, -apple-system, sans-serif);
    color: var(--brand-text, #1f2937);
    min-height: 100vh;
}

/* Header */
.cart-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
}

.cart-header .store-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.cart-header .store-name {
    font-family: var(--font-heading, inherit);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-text, #1f2937);
    text-decoration: none;
}

.cart-header .store-name:hover {
    color: var(--brand-primary, #3B82F6);
}

/* Cart content area */
.cart-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.cart-title {
    font-family: var(--font-heading, inherit);
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

/* Cart items */
.cart-items {
    background: #fff;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item:hover {
    background: #fafbfc;
}

.cart-item-image {
    width: 72px;
    height: 72px;
    border-radius: 0.375rem;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: #f9fafb;
}

.cart-item-image-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    color: #9ca3af;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    color: var(--brand-text, #1f2937);
    text-decoration: none;
    display: block;
    margin-bottom: 0.125rem;
}

.cart-item-name:hover {
    color: var(--brand-primary, #3B82F6);
}

.cart-item-meta {
    font-size: 0.8125rem;
    color: #6b7280;
}

.cart-item-price {
    font-weight: 600;
    white-space: nowrap;
    min-width: 80px;
    text-align: right;
}

.cart-item-total {
    font-weight: 700;
    white-space: nowrap;
    min-width: 90px;
    text-align: right;
}

/* Quantity selector */
.cart-qty-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    overflow: hidden;
}

.cart-qty-selector .cart-qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f9fafb;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.15s;
}

.cart-qty-selector .cart-qty-btn:hover {
    background: #e5e7eb;
}

.cart-qty-selector .cart-qty-value {
    width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    border-left: 1px solid #d1d5db;
    border-right: 1px solid #d1d5db;
    height: 32px;
    background: #fff;
}

/* Remove button */
.cart-item-remove {
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 0.25rem;
    transition: color 0.15s, background 0.15s;
    font-size: 1rem;
}

.cart-item-remove:hover {
    color: var(--brand-error, #EF4444);
    background: #fef2f2;
}

/* Summary card */
.cart-summary {
    background: #fff;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    position: sticky;
    top: 1rem;
}

.cart-summary h5 {
    font-family: var(--font-heading, inherit);
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    font-size: 0.9375rem;
}

.cart-summary-row.total {
    font-weight: 700;
    font-size: 1.125rem;
    border-top: 2px solid #e5e7eb;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

.cart-summary-row .discount-amount {
    color: var(--brand-success, #10B981);
}

.btn-checkout {
    background-color: var(--brand-primary, #3B82F6);
    border-color: var(--brand-primary, #3B82F6);
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    width: 100%;
    border-radius: 0.375rem;
    transition: opacity 0.15s;
}

.btn-checkout:hover {
    opacity: 0.9;
    color: #fff;
}

.btn-continue-shopping {
    color: var(--brand-primary, #3B82F6);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
}

.btn-continue-shopping:hover {
    text-decoration: underline;
}

/* Discount code */
.discount-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.discount-form input {
    flex: 1;
    font-size: 0.875rem;
}

.discount-form .btn {
    font-size: 0.875rem;
    white-space: nowrap;
}

.discount-applied {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #ecfdf5;
    color: var(--brand-success, #10B981);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 1rem;
    padding-top: 0.75rem;
}

.discount-applied .remove-discount {
    color: #6b7280;
    cursor: pointer;
    margin-left: auto;
    font-size: 1rem;
}

.discount-applied .remove-discount:hover {
    color: var(--brand-error, #EF4444);
}

/* Empty cart */
.cart-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.cart-empty i {
    font-size: 3.5rem;
    color: var(--brand-primary, #3B82F6);
    opacity: 0.4;
}

.cart-empty p {
    color: #6b7280;
    margin: 1rem 0;
    font-size: 1.0625rem;
}

.cart-empty .btn {
    background-color: var(--brand-primary, #3B82F6);
    border-color: var(--brand-primary, #3B82F6);
    color: #fff;
    font-weight: 600;
}

/* Loading */
.cart-loading {
    text-align: center;
    padding: 4rem 2rem;
}

/* Footer */
.cart-footer {
    text-align: center;
    padding: 2rem 0;
    color: #9ca3af;
    font-size: 0.8125rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 3rem;
}

/* Responsive */
@media (max-width: 767.98px) {
    .cart-item {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .cart-item-image,
    .cart-item-image-placeholder {
        width: 56px;
        height: 56px;
    }

    .cart-item-details {
        flex: 1 1 calc(100% - 72px);
    }

    .cart-item-price {
        display: none;
    }

    .cart-item-qty-wrap,
    .cart-item-total,
    .cart-item-remove {
        flex: 0 0 auto;
    }

    .cart-content {
        padding: 1rem 0.75rem;
    }

    .cart-summary {
        position: static;
    }
}
