/* ===================================
   Header Navigation - User Section
   =================================== */

/* Cart Badge (used on cart icon in header) */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25em 0.4em;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 10;
    line-height: 1;
    transition: all 0.2s ease;
}

/* Wishlist Badge (same style as cart, with hover enhancement) */
.wishlist-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.25em 0.4em;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 10;
    line-height: 1;
    transition: all 0.2s ease;
}

.wishlist-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Wishlist Button Specific Styling */
#wishlistBtn,
.nav-icon-btn.wishlist-btn {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
}

/* Orders pending badge (smaller, simpler) */
.nav-badge,
.menu-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc3545;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* ===================================
   Cart Modal Items (reused in dropdown/modals)
   =================================== */
.cart-item-modal,
.wishlist-item {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.cart-item-modal:last-child,
.wishlist-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cart-item-image,
.wishlist-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.wishlist-item-image {
    width: 70px;
    height: 70px;
}

.cart-item-details,
.wishlist-item-details {
    flex: 1;
    margin-right: 1rem;
}

.cart-item-title,
.wishlist-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-author,
.wishlist-item-author {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.cart-item-price,
.wishlist-item-price {
    font-weight: 600;
    color: #198754;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dee2e6;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: #f8f9fa;
    border-color: #0d6efd;
}

.quantity-input {
    width: 40px;
    text-align: center;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.25rem;
}

.quantity-input:focus {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.remove-item-btn,
.remove-wishlist-btn {
    color: #dc3545;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-item-btn:hover {
    color: #c82333;
    transform: scale(1.1);
}

.remove-wishlist-btn {
    background: #f8f9fa;
    border: 1px solid #dc3545;
    padding: 0.5rem;
    border-radius: 6px;
}

.remove-wishlist-btn:hover {
    background: #dc3545;
    color: white;
}

.remove-wishlist-btn.loading,
.move-to-cart-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Move to Cart Button */
.wishlist-actions {
    display: flex;
    gap: 0.5rem;
}

.move-to-cart-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.move-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ===================================
   Custom Wishlist Modal (Full Screen Overlay)
   =================================== */
.custom-wishlist-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.custom-wishlist-modal.show {
    display: flex;
}

.custom-wishlist-modal-content {
    background: white;
    border-radius: 10px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
    margin: 20px;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.custom-wishlist-modal-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    flex-shrink: 0;
}

.custom-wishlist-modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
    flex-grow: 1;
}

.custom-wishlist-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: opacity 0.2s ease;
}

.custom-wishlist-modal-close:hover {
    opacity: 0.8;
}

/* ===================================
   General Modal & UI Fixes
   =================================== */
.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}

.modal-body {
    padding: 1.5rem;
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.btn-close:focus {
    box-shadow: none;
}

.btn.disabled,
.btn:disabled {
    opacity: 0.65;
    pointer-events: none;
}

body.modal-open {
    overflow: hidden;
}

/* Loading Spinner inside buttons */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}


.header-area.scrolled {
    background: rgba(28, 26, 26, 0.98) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    box-shadow: 0 4px 30px rgba(209, 162, 242, 0.15) !important;
    border-bottom: 1px solid rgba(209, 162, 242, 0.2);
}

.user-nav-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: 1rem;
    position: relative;
}

.user-quick-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-icon-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 5px 15px rgba(209, 162, 242, 0.2);
    color: white;
}

.nav-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #d1a2f2, #b873ff);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1.5rem;
}