/* Header Styles */

.main-header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: var(--spacing-lg);
}

/* Logo Section */
.logo-section {
    flex-shrink: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-image {
    display: inline-block;
    height: 40px;
    width: 40px;
    object-fit: contain;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

/* Search Section */
.search-section {
    flex: 1;
    max-width: 600px;
    margin: 0 var(--spacing-md);
}

.search-form {
    width: 100%;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    background-color: var(--bg-secondary);
}

.search-input:focus {
    background-color: var(--bg-primary);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 21, 56, 0.1);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-submit-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-lg);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.search-submit-button:hover {
    background: #a01842;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(139, 21, 56, 0.3);
}

.search-submit-button:active {
    transform: translateY(0);
}

.search-submit-button i {
    font-size: 16px;
}

/* Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.nav-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    color: currentColor;
}

/* Header Right Section */
.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-shrink: 0;
}

/* Cart Button */
.cart-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-full);
    background-color: var(--bg-secondary);
    color: var(--primary-color);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
}

.cart-button:hover {
    background-color: var(--primary-color);
    color: white;
}

.cart-button svg {
    width: 22px;
    height: 22px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 var(--spacing-xs);
    background-color: var(--danger-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--border-radius-full);
    border: 2px solid var(--bg-primary);
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-menu.authenticated {
    gap: var(--spacing-sm);
}

.welcome-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.user-dropdown {
    position: relative;
}

.profile-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-full);
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.profile-button:hover {
    background-color: var(--primary-color);
    color: white;
}

.profile-button svg {
    width: 22px;
    height: 22px;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    transition: background 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    font-family: inherit;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

.dropdown-item i {
    width: 18px;
    color: #6b7280;
}

.logout-item {
    color: #ef4444;
}

.logout-item:hover {
    background: #fef2f2;
}

.logout-item i {
    color: #ef4444;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

/* Sign In Button */
.signin-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.signin-button:hover {
    background-color: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.signin-button svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.signin-button span {
    color: inherit;
}

/* Mobile Menu Sidebar */
.mobile-menu-sidebar {
    position: fixed;
    right: -100%;
    top: 0;
    width: 85%;
    max-width: 350px;
    height: 100vh;
    background: white;
    z-index: 2000;
    transition: right 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu-sidebar.active {
    right: 0;
}

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

.mobile-menu-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.mobile-menu-logo img {
    height: 28px;
    width: 28px;
    flex-shrink: 0;
}

.mobile-menu-brand {
    font-size: 1.1rem;
    font-weight: 600;
    color: #8B1538;
}

.close-mobile-menu {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.close-mobile-menu:hover {
    color: #111827;
}

.mobile-menu-content {
    padding: 20px;
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 30px;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.mobile-menu-link:hover {
    background: #f3f4f6;
    color: #8B1538;
}

.mobile-menu-link i {
    font-size: 18px;
    width: 20px;
}

.mobile-menu-footer {
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
}

.mobile-menu-section {
    margin-bottom: 24px;
}

.mobile-menu-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-menu-section a {
    display: block;
    padding: 8px 0;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.mobile-menu-section a:hover {
    color: #8B1538;
}

.mobile-menu-section p {
    margin: 4px 0;
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.6;
}

.mobile-menu-social {
    display: flex;
    gap: 12px;
    margin: 20px 0;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 50%;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-icon:hover {
    background: #8B1538;
    color: white;
}

.mobile-menu-legal {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    font-size: 0.8rem;
}

.mobile-menu-legal a {
    color: #6b7280;
    text-decoration: none;
}

.mobile-menu-legal a:hover {
    color: #8B1538;
}

.mobile-menu-legal span {
    color: #d1d5db;
}

.mobile-menu-copyright {
    margin: 16px 0 0 0;
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    border: none;
    cursor: pointer;
    gap: 6px;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 1px;
    transition: all var(--transition-base);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

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

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}


/* Responsive - Tablet */
@media (max-width: 1024px) {
    .header-wrapper {
        gap: var(--spacing-md);
    }

    .search-section {
        max-width: 300px;
        margin: 0 var(--spacing-sm);
    }

    .nav-link span {
        display: none;
    }

    .nav-link {
        padding: var(--spacing-sm);
    }

    .welcome-text {
        display: none;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .main-header {
        padding-top: 8px;
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    .header-container {
        overflow-x: hidden;
        max-width: 100vw;
        width: 100%;
    }

    .header-wrapper {
        height: 56px;
        gap: var(--spacing-sm);
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }

    .mobile-menu-toggle {
        display: flex;
        flex-shrink: 0;
    }

    /* Hide search on mobile - will be in filter modal */
    .search-section {
        display: none;
    }

    .logo-link {
        flex-shrink: 0;
    }

    .logo-link svg,
    .logo-image {
        height: 32px;
        width: 32px;
        object-fit: contain;
    }

    .brand-name {
        font-size: 1.2rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-nav {
        display: none;
    }

    .header-right {
        gap: var(--spacing-sm);
        margin-left: auto;
        flex-shrink: 0;
    }

    .user-menu.authenticated {
        display: none;
    }

    .cart-button {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    .signin-button span {
        display: none;
    }

    .signin-button {
        padding: var(--spacing-sm);
        width: 40px;
        height: 40px;
        border-radius: var(--border-radius-full);
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 var(--spacing-sm);
        overflow-x: hidden;
        max-width: 100vw;
        width: 100%;
    }

    .header-wrapper {
        height: 52px;
        gap: 4px;
        overflow-x: hidden;
        width: 100%;
    }

    .logo-link {
        flex-shrink: 0;
    }

    .logo-link svg,
    .logo-image {
        height: 32px;
        width: 32px;
        object-fit: contain;
    }

    .brand-name {
        font-size: 1rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-menu-toggle {
        flex-shrink: 0;
    }

    .header-right {
        flex-shrink: 0;
    }
}
    .search-input {
        font-size: 0.85rem;
        padding: 8px 36px 8px 10px;
    }

    .search-input::placeholder {
        font-size: 0.85rem;
    }

    .search-clear {
        right: 60px;
        padding: 4px;
    }

    .search-submit-btn {
        padding: 8px 12px;
    }

    .search-submit-btn i {
        font-size: 16px;
    }
}

