/**
 * ============================================
 * ZEROKART CART MODAL - AMAZON STYLE
 * Modern sliding cart with quick checkout
 * ============================================
 */

/* Overlay backdrop */
.cart-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Cart Modal Container */
.cart-modal {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cart-modal.active {
    right: 0;
}

/* Dark mode variant */
.cart-modal.dark-mode {
    background: #0a0a0a;
    color: #ffffff;
}

/* Header */
.cart-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
    background: #ffffff;
}

.cart-modal.dark-mode .cart-modal-header {
    background: #0a0a0a;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.cart-modal-title {
    font-size: 20px;
    font-weight: 400;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-count-bubble {
    background: #2ecc71;
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

.cart-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: end;
    justify-content: flex-end;
    border-radius: 50%;
    transition: all 0.2s;
}

/* .cart-close-btn:hover {
    background: #f5f5f5;
    color: #000;
} */

.cart-modal.dark-mode .cart-close-btn {
    color: #ccc;
}

.cart-modal.dark-mode .cart-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Items Container */
.cart-modal-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.cart-modal-items::-webkit-scrollbar {
    width: 6px;
}

.cart-modal-items::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cart-modal-items::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.cart-modal-items::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Cart Item */
.cart-modal-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.cart-modal.dark-mode .cart-modal-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.cart-modal-item:hover {
    border-color: #2ecc71;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.cart-modal.dark-mode .cart-item-image {
    background: rgba(255, 255, 255, 0.1);
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 15px;
   font-weight: 400;
    margin: 0 0 6px 0;
    color: #000;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cart-modal.dark-mode .cart-item-name {
    color: #fff;
}

.cart-item-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.cart-modal.dark-mode .cart-item-meta {
    color: #999;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 4px 8px;
}

.cart-modal.dark-mode .quantity-selector {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.qty-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.qty-btn:hover {
    background: #f0f0f0;
    color: #000;
}

.cart-modal.dark-mode .qty-btn {
    color: #ccc;
}

.cart-modal.dark-mode .qty-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.qty-value {
    font-size: 14px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #ff4444;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.remove-item-btn:hover {
    background: rgba(255, 68, 68, 0.1);
}

.cart-item-price {
    text-align: right;
}

.item-price-amount {
    font-size: 18px;
    font-weight: 700;
    color: #2ecc71;
}

.item-price-unit {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* Coupon Section */
.cart-coupon-section {
    padding: 16px 24px;
    border-top: 1px solid #e5e5e5;
    background: #fafafa;
}

.cart-modal.dark-mode .cart-coupon-section {
    background: rgba(255, 255, 255, 0.03);
    border-top-color: rgba(255, 255, 255, 0.1);
}

.coupon-input-group {
    display: flex;
    gap: 8px;
}

.coupon-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.cart-modal.dark-mode .coupon-input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.coupon-input::placeholder {
    text-transform: none;
    font-weight: 400;
    letter-spacing: 0;
}

.apply-coupon-btn {
    padding: 12px 24px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    font-size: 13px;
}

.apply-coupon-btn:hover {
    background: #27ae60;
}

.apply-coupon-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.applied-coupon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #e8f5e9;
    border: 1px solid #4caf50;
    border-radius: 8px;
    margin-top: 12px;
}

.cart-modal.dark-mode .applied-coupon {
    background: rgba(46, 204, 113, 0.15);
    border-color: rgba(46, 204, 113, 0.3);
}

.coupon-code-display {
    font-weight: 700;
    color: #2e7d32;
    text-transform: uppercase;
}

.cart-modal.dark-mode .coupon-code-display {
    color: #4caf50;
}

.remove-coupon-btn {
    background: none;
    border: none;
    color: #d32f2f;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
}

/* Summary Section */
.cart-modal-summary {
    padding: 20px 24px;
    border-top: 1px solid #e5e5e5;
    background: #ffffff;
}

.cart-modal.dark-mode .cart-modal-summary {
    background: #0a0a0a;
    border-top-color: rgba(255, 255, 255, 0.1);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
}

.summary-row.discount {
    color: #2ecc71;
}

.summary-row.total {
    font-size: 18px;
    font-weight: 700;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #e5e5e5;
}

.cart-modal.dark-mode .summary-row.total {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Checkout Button */
.cart-checkout-btn {
    width: 100%;
    padding: 16px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 16px;
}

.cart-checkout-btn:hover {
    background: #2ecc71;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.cart-checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.cart-modal.dark-mode .cart-checkout-btn {
    background: #fff;
    color: #000;
}

.cart-modal.dark-mode .cart-checkout-btn:hover {
    background: #2ecc71;
    color: #fff;
}

/* Empty Cart */
.empty-cart-message {
    text-align: center;
    padding: 60px 20px;
}

.empty-cart-icon {
    font-size: 64px;
    opacity: 0.2;
    margin-bottom: 16px;
}

.empty-cart-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.cart-modal.dark-mode .empty-cart-text {
    color: #999;
}

.continue-shopping-btn {
    padding: 12px 24px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.continue-shopping-btn:hover {
    background: #27ae60;
    transform: translateY(-2px);
}

/* Login Notice */
.guest-login-notice {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
}

.guest-login-notice a {
    color: #3498db;
    font-weight: 600;
    text-decoration: none;
}

.guest-login-notice a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 576px) {
    .cart-modal {
        max-width: 100%;
    }
    
    .cart-modal-header {
        padding: 16px 20px;
    }
    
    .cart-modal-items {
        padding: 16px 20px;
    }
    
    .cart-modal-summary {
        padding: 16px 20px;
    }
    
    .cart-coupon-section {
        padding: 16px 20px;
    }
}

/* Loading State */
.cart-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.cart-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2ecc71;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cart-modal.active {
    animation: slideInRight 0.3s ease-out;
}

/* Notification Toast */
.cart-notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2ecc71;
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
}

.cart-notification-toast.error {
    background: #e74c3c;
}

.cart-notification-toast.info {
    background: #3498db;
}


/* ashish */
.cart-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* Logo center me fix */
.cart-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.cart-logo img {
    height: 40px; /* adjust karo */
}

/* Optional spacing */
.cart-modal-title {
    margin: 0;
}

.cart-close-btn {
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
}
/* ashish */