/* ===== CART PAGE STYLES ===== */
/* Cart Preview Card */
.cart-preview-card {
    position: fixed;
    top: 80px;
    right: 24px;
    width: 360px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 500;
    padding: 20px;
    border: 1px solid var(--border);
}

.cart-preview-image {
    width: 80px;
    height: 80px;
    background: var(--bg-page);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cart-preview-image img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.cart-preview-info { flex: 1; min-width: 0; }
.cart-preview-name { font-weight: 600; font-size: 0.95rem; color: var(--text-main); margin-bottom: 4px; }
.cart-preview-price { font-weight: 700; color: #007656; font-size: 1rem; }

.cart-preview-check {
    width: 32px;
    height: 32px;
    background: var(--success-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    font-size: 1rem;
}

/* Cart Page Layout */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1024px) {
    .cart-layout { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    .cart-layout { gap: 16px; padding: 0; }
    .cart-items-section { gap: 12px; }
    .cart-item-card { padding: 12px; }
    .cart-item-img { width: 60px; height: 60px; }
    .cart-qty-btn { width: 44px; height: 44px; }
    .cart-delete-btn { width: 44px; height: 44px; }
    .cart-summary-sidebar {
        position: fixed;
        bottom: 64px;
        left: 0;
        right: 0;
        z-index: 100;
    }
    .cart-summary-card { border-radius: 0; border-left: none; border-right: none; }
    .cart-items-section { padding-bottom: 200px; }
}

.cart-items-section { display: flex; flex-direction: column; gap: 16px; }

.cart-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: all var(--transition-fast);
}

.cart-item-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }

.cart-item-main { display: flex; align-items: center; gap: 16px; }

.cart-item-img {
    width: 70px;
    height: 70px;
    background: var(--bg-page);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.cart-item-img img { max-width: 90%; max-height: 90%; object-fit: contain; }

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title { font-weight: 600; font-size: 0.95rem; color: var(--text-main); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-sku { font-size: 0.8rem; color: var(--text-tertiary); margin-bottom: 4px; }
.cart-item-price-text { font-size: 0.85rem; color: var(--text-secondary); }

.cart-item-controls { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

@media (max-width: 768px) {
    .cart-item-card { flex-direction: column; align-items: stretch; }
    .cart-item-controls { justify-content: space-between; padding-top: 12px; }
}

.cart-qty-wrapper { display: flex; align-items: center; gap: 8px; background: var(--bg-page); border-radius: var(--radius-md); padding: 4px; }

.cart-qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.cart-qty-btn:hover { background: var(--primary); color: white; }
.cart-qty-value { min-width: 30px; text-align: center; font-weight: 600; font-size: 0.95rem; }

.cart-item-total-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
    min-width: 80px;
    text-align: right;
}

@media (max-width: 768px) {
    .cart-item-total-price { min-width: auto; }
}

.cart-delete-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.cart-delete-btn:hover { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }

/* Cart Summary Sidebar */
.cart-summary-sidebar { position: sticky; top: 90px; }

.cart-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.cart-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 0;
    border-top: 2px solid var(--border);
    margin-top: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
}

.cart-checkout-btn {
    width: 100%;
    padding: 14px 20px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.cart-checkout-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.cart-checkout-btn i { font-size: 1.1rem; }


/* Checkout Modal Styles */
.checkout-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.summary-total {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 2px solid var(--border);
    font-size: 1.125rem;
    font-weight: 600;
}

.summary-label {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.summary-total .summary-label {
    color: var(--text-primary);
    font-size: 1.125rem;
}

.summary-value {
    color: var(--text-primary);
    font-weight: 500;
}

.summary-total .summary-value {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--background);
    color: var(--text-primary);
    transition: all 0.2s ease;
    resize: vertical;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 118, 86, 0.1);
}

.form-control::placeholder {
    color: var(--text-light);
}

.form-text {
    display: block;
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .form-control {
        background: var(--surface);
        border-color: var(--border-dark);
    }
    
    .form-control:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(0, 118, 86, 0.2);
    }
}


/* Checkout Modal Styles */
#checkout-modal .modal-content {
    max-width: 500px;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

#checkout-modal .modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, #005a45 100%);
    color: white;
    padding: 24px;
    border-radius: 12px 12px 0 0;
}

#checkout-modal .modal-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    margin: 0;
    font-size: 1.5rem;
}

#checkout-modal .modal-header h2 i {
    font-size: 1.2em;
}

#checkout-modal .modal-close {
    color: white;
    opacity: 0.9;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

#checkout-modal .modal-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

#checkout-modal .modal-body {
    padding: 24px;
    background: var(--bg-card);
    flex: 1;
    overflow-y: auto;
}

.checkout-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 1.05rem;
}

.summary-row:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.summary-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #495057;
    font-weight: 500;
}

.summary-label i {
    color: var(--primary);
    font-size: 1.1em;
}

.summary-value {
    font-weight: 600;
    color: #212529;
}

.summary-total {
    margin-top: 8px;
    padding-top: 16px !important;
    border-top: 2px solid var(--primary) !important;
}

.summary-total .summary-label,
.summary-total .summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

#checkout-modal .form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
}

#checkout-modal .form-group label i {
    color: var(--primary);
}

#checkout-modal .form-control {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    resize: vertical;
    background: var(--bg-card);
    color: #212529;
}

#checkout-modal .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 118, 86, 0.1);
    outline: none;
}

#checkout-modal .form-text {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: #6c757d;
    font-size: 0.875rem;
}

#checkout-modal .form-text i {
    color: var(--primary);
}

#checkout-modal .modal-footer {
    flex-shrink: 0;
    gap: 12px;
    padding: 20px 24px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 12px 12px;
}

#checkout-modal .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
}

#checkout-modal .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #005a45 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 118, 86, 0.3);
    color: white;
}

#checkout-modal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 118, 86, 0.4);
}

#checkout-modal .btn-outline {
    border: 2px solid #dee2e6;
    background: var(--bg-card);
    color: #495057;
}

#checkout-modal .btn-outline:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}
