/* ================================================
   CART & WISHLIST - AJAX SYSTEM STYLES
   ================================================ */

/* ================================================
   TOAST NOTIFICATIONS
   ================================================ */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 99999;
    pointer-events: none;
}

.toast-notification {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    max-width: 400px;
    pointer-events: all;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-notification.hide {
    transform: translateX(400px);
    opacity: 0;
}

/* Toast Icons */
.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: #dcfce7;
    color: #0f508d;
}

.toast-error .toast-icon {
    background: #fee2e2;
    color: #dc2626;
}

.toast-warning .toast-icon {
    background: #fef3c7;
    color: #d97706;
}

/* Toast Content */
.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.toast-message {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

/* Toast Close Button */
.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    font-size: 16px;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #374151;
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    border-radius: 0 0 12px 12px;
    transition: width 0.1s linear;
}

.toast-success .toast-progress {
    color: #0f508d;
}

.toast-error .toast-progress {
    color: #dc2626;
}

.toast-warning .toast-progress {
    color: #d97706;
}

/* ================================================
   LOADING STATES
   ================================================ */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.btn-loading .fa-cart-shopping,
.btn-loading span {
    opacity: 0;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ================================================
   BADGE PULSE ANIMATION
   ================================================ */
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.badge-pulse {
    animation: badgePulse 0.4s ease-in-out;
}

/* ================================================
   WISHLIST BUTTON STATES
   ================================================ */
.wishlist-toggle-btn {
    transition: all 0.3s ease;
}

.wishlist-toggle-btn i {
    transition: all 0.3s ease;
}

.wishlist-toggle-btn.active i {
    color: #dc2626 !important;
    font-weight: 900;
}

.wishlist-toggle-btn.active {
    background: #fee2e2 !important;
}

/* For shop page wishlist buttons */
.quick-action-btn.active {
    background: #fee2e2 !important;
}

.quick-action-btn.active i {
    color: #dc2626 !important;
}

/* ================================================
   CART DROPDOWN STYLES
   ================================================ */
.unique-cart-empty {
    padding: 40px 20px;
    text-align: center;
}

.unique-cart-empty i {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.unique-cart-empty p {
    color: #6b7280;
    margin-bottom: 20px;
}

/* Cart Items Container */
.unique-cart-items {
    max-height: 400px;
    overflow-y: auto;
    padding: 12px;
}

.unique-cart-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.unique-cart-item:hover {
    background: #f3f4f6;
}

.unique-cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.unique-cart-item-details {
    flex: 1;
    min-width: 0;
}

.unique-cart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.unique-cart-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.unique-cart-item-quantity {
    font-size: 12px;
    color: #6b7280;
    background: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.unique-cart-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #0f508d;
}

.unique-cart-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
    width: unset;
}

.unique-cart-item-remove:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Cart Footer */
.unique-cart-footer {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
}

.unique-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 16px;
}

.unique-cart-subtotal strong {
    color: #0f508d;
    font-size: 18px;
}

.unique-btn-view-cart,
.unique-btn-checkout {
    display: block;
    width: 100%;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.unique-btn-view-cart {
    background: #f3f4f6;
    color: #374151;
}

.unique-btn-view-cart:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.unique-btn-checkout {
    background: #0f508d;
    color: #fff;
}

.unique-btn-checkout:hover {
    background: #0f508d;
}

/* ================================================
   ADD TO CART BUTTON STATES
   ================================================ */
.product-add-to-cart,
.add-to-cart-btn {
    position: relative;
    transition: all 0.3s ease;
}

.product-add-to-cart:disabled,
.add-to-cart-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-add-to-cart.disabled,
.add-to-cart-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Success State */
.product-add-to-cart.added,
.add-to-cart-btn.added {
    background: #0f508d !important;
    color: #fff !important;
}

/* ================================================
   MOBILE RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
    .toast-container {
        top: 60px;
        right: 12px;
        left: 12px;
    }

    .toast-notification {
        min-width: auto;
        max-width: 100%;
    }

    .toast-title {
        font-size: 13px;
    }

    .toast-message {
        font-size: 12px;
    }

    .unique-cart-items {
        max-height: 300px;
    }

    .unique-cart-item {
        gap: 10px;
        padding: 10px;
    }

    .unique-cart-item-image {
        width: 50px;
        height: 50px;
    }

    .unique-cart-item-name {
        font-size: 13px;
    }

    .unique-cart-item-price {
        font-size: 13px;
    }
}

/* ================================================
   CART QUANTITY CONTROLS (if needed)
   ================================================ */
.cart-quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 4px;
}

.cart-qty-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 14px;
}

.cart-qty-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.cart-qty-value {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    color: #1f2937;
    font-size: 13px;
}

/* ================================================
   SMOOTH TRANSITIONS
   ================================================ */
* {
    -webkit-tap-highlight-color: transparent;
}

button {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* ================================================
   SCROLLBAR STYLING (for cart dropdown)
   ================================================ */
.unique-cart-items::-webkit-scrollbar {
    width: 6px;
}

.unique-cart-items::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
}

.unique-cart-items::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

.unique-cart-items::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ================================================
   ACCESSIBILITY
   ================================================ */
.btn-loading:focus,
.wishlist-toggle-btn:focus,
.add-to-cart-btn:focus,
.toast-close:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .toast-notification {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .toast-notification,
    .btn-loading::before,
    .badge-pulse,
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================================================
   QUANTITY CONTROLS (ADD TO cart-wishlist.css)
   ================================================ */

/* Quantity Controls Container */
.cart-quantity-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 8px;
    width: 100%;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.cart-quantity-controls:hover {
    border-color: #0f508d;
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.1);
}

/* Quantity Buttons */
.cart-qty-btn {
    background: #f3f4f6;
    border: none;
    color: #374151;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.cart-qty-btn:hover {
    background: #0f508d;
    color: #fff;
    transform: scale(1.05);
}

.cart-qty-btn:active {
    transform: scale(0.95);
}

.cart-qty-btn i {
    font-size: 10px;
}

/* Quantity Value Display */
.cart-qty-value {
    min-width: 40px;
    text-align: center;
    font-weight: 700;
    color: #1f2937;
    font-size: 15px;
    padding: 0 4px;
}

/* Animation when updating */
.cart-qty-value.updating {
    animation: quantityUpdate 0.3s ease;
}

@keyframes quantityUpdate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); color: #0f508d; }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .cart-quantity-controls {
        gap: 6px;
        padding: 5px 6px;
    }

    .cart-qty-btn {
        padding: 5px 8px;
        min-width: 28px;
        height: 28px;
    }

    .cart-qty-value {
        min-width: 35px;
        font-size: 14px;
    }
}

/* For shop product cards */
.product-info .cart-quantity-controls {
    margin-top: 12px;
}

/* Disabled state */
.cart-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cart-qty-btn:disabled:hover {
    background: #f3f4f6;
    color: #374151;
    transform: none;
}
