/* ===== CLEAN PROFESSIONAL HEADER - NO CONFLICTS ===== */

/* Reset and base styles */
.clean-professional-header * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Main header */
.clean-professional-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header container */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 70px;
}

/* Header layout sections */
.header-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.header-center {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}

.header-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

/* Brand section */
.brand-section {
    flex: 0 0 auto;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #1f2937;
    font-weight: 700;
    font-size: 18px;
    transition: opacity 0.2s ease;
}

.brand-link:hover {
    opacity: 0.8;
    text-decoration: none;
    color: #1f2937;
}

.brand-logo {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    font-weight: 800;
    color: #1f2937;
    letter-spacing: 0.5px;
}

/* Desktop navigation */
.desktop-nav {
    display: flex;
    justify-content: center;
}

.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.nav-item {
    display: inline-block;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: #2563eb;
    background: #eff6ff;
    text-decoration: none;
    transform: translateY(-1px);
}

.nav-link i {
    font-size: 16px;
}

/* Header actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Cart button */
.cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    position: relative;
}

.cart-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    color: #374151;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-icon i {
    font-size: 20px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid white;
}

/* Balance display */
.balance-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.balance-display i {
    font-size: 14px;
}

/* User menu */
.user-menu {
    position: relative;
}

.user-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #374151;
}

.user-btn:hover {
    background: #f3f4f6;
}

.user-avatar,
.user-avatar-fallback {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e5e7eb;
}

.user-avatar {
    object-fit: cover;
}

.user-avatar-fallback {
    background: #e5e7eb;
    color: #6b7280;
    font-weight: 600;
    font-size: 16px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

/* User dropdown */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    min-width: 240px;
    padding: 8px 0;
    margin-top: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 99999;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
}

.dropdown-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid #f3f4f6;
}

.user-full-name {
    display: block;
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
    margin-bottom: 2px;
}

.user-email {
    display: block;
    font-size: 12px;
    color: #6b7280;
}

.dropdown-divider {
    height: 1px;
    background: #f3f4f6;
    margin: 8px 0;
    border: none;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dropdown-link:hover {
    background: #f9fafb;
    color: #1f2937;
    text-decoration: none;
}

.dropdown-link i {
    font-size: 16px;
    color: #6b7280;
    width: 16px;
    text-align: center;
}

.dropdown-link:hover i {
    color: #2563eb;
}

.logout-link {
    color: #ef4444;
}

.logout-link:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Auth buttons */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-btn {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}

.login-btn {
    color: #6b7280;
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.login-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    color: #374151;
    text-decoration: none;
}

.register-btn {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.register-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

/* Mobile toggle button */
.mobile-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    gap: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mobile-toggle:hover {
    background: #f3f4f6;
}

.toggle-line {
    width: 20px;
    height: 2px;
    background: #374151;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.mobile-toggle.active .toggle-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-toggle.active .toggle-line:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active .toggle-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile navigation overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-content {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 85vw;
    height: 100%;
    background: white;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 1000000;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.mobile-nav-overlay.active .mobile-nav-content {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.mobile-nav-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.mobile-nav-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #1f2937;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.mobile-nav-close:hover {
    background: #e5e7eb;
    color: #ef4444;
}

.mobile-nav {
    padding: 20px 0;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    color: #374151;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.mobile-nav-link:hover {
    background: #f8fafc;
    color: #1f2937;
    border-left-color: #2563eb;
    text-decoration: none;
}

.mobile-nav-link i {
    font-size: 20px;
    color: #6b7280;
    width: 20px;
    text-align: center;
}

.mobile-nav-link:hover i {
    color: #2563eb;
}

.mobile-nav-link.logout {
    color: #ef4444;
}

.mobile-nav-link.logout:hover {
    background: #fef2f2;
    color: #dc2626;
    border-left-color: #ef4444;
}

.mobile-user-info {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

.mobile-balance {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #374151;
    font-weight: 600;
}

.mobile-balance i {
    font-size: 18px;
    color: #10b981;
}

/* Body padding for fixed header */
body {
    padding-top: 70px;
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* Responsive design */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 20px;
    }
    
    .nav-link {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .balance-display {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .cart-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 16px;
        height: 64px;
    }
    
    body {
        padding-top: 64px;
    }
    
    /* Mobile layout: Logo left, actions right */
    .header-left {
        flex: 1 1 auto;
    }
    
    .header-center {
        display: none; /* Hide center navigation on mobile */
    }
    
    .header-right {
        flex: 0 0 auto;
    }
    
    /* Hide desktop navigation */
    .desktop-nav {
        display: none;
    }
    
    /* Show mobile toggle */
    .mobile-toggle {
        display: flex;
    }
    
    /* Adjust brand section */
    .brand-logo {
        max-height: 32px;
    }
    
    .brand-text {
        font-size: 16px;
    }
    
    /* Hide user name on mobile */
    .user-name {
        display: none;
    }
    
    /* Hide balance display on mobile */
    .balance-display {
        display: none;
    }
    
    /* Hide auth buttons on mobile - they're in the mobile menu */
    .auth-buttons {
        display: none;
    }
    
    /* Adjust header actions */
    .header-actions {
        gap: 8px;
    }
    
    /* Make cart button more compact */
    .cart-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .cart-text {
        display: none;
    }
    
    .cart-icon i {
        font-size: 18px;
    }
    
    .cart-count {
        top: -6px;
        right: -6px;
        font-size: 10px;
        min-width: 16px;
        height: 16px;
        padding: 1px 4px;
    }
    
    /* Adjust user avatar */
    .user-avatar,
    .user-avatar-fallback {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    /* Adjust dropdown positioning */
    .user-dropdown {
        min-width: 200px;
        right: -10px;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 12px;
        height: 56px;
    }
    
    body {
        padding-top: 56px;
    }
    
    /* Make mobile nav content full width on small screens */
    .mobile-nav-content {
        width: 100%;
        max-width: 100vw;
    }
    
    /* Further compact cart button */
    .cart-btn {
        padding: 6px 10px;
    }
    
    /* Adjust dropdown */
    .user-dropdown {
        right: -20px;
        min-width: 180px;
    }
    
    .brand-text {
        font-size: 14px;
    }
}

/* Focus states for accessibility */
.nav-link:focus,
.cart-btn:focus,
.auth-btn:focus,
.user-btn:focus,
.mobile-toggle:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Animation for smooth interactions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown.active {
    animation: fadeInUp 0.2s ease;
}

/* Print styles */
@media print {
    .clean-professional-header {
        display: none;
    }
    
    body {
        padding-top: 0;
    }
}

/* High specificity overrides to prevent conflicts */
html body .clean-professional-header,
html body .clean-professional-header * {
    box-sizing: border-box;
}

html body .clean-professional-header {
    display: flex;
    visibility: visible;
    opacity: 1;
}

/* Ensure no conflicts with other headers */
.clean-professional-header {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Override any conflicting navbar styles */
.clean-professional-header .navbar,
.clean-professional-header .navbar-brand,
.clean-professional-header .navbar-nav,
.clean-professional-header .navbar-toggler {
    all: unset;
}
