/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Header Styles */
.header-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    max-width: 1280px;
    margin: 0 auto;
    height: 64px;
}

/* Logo */
.header-logo {
    flex: 0 0 auto;
    margin-right: 24px;
    display: flex;
    align-items: center;
}

.header-logo img {
    height: 48px;
    width: auto;
    vertical-align: middle;
    transition: transform 0.3s ease;
}

.header-logo img:hover {
    transform: scale(1.05);
}

/* Search Bar */
.header-search {
    flex: 1 1 auto;
    max-width: 400px;
    margin: 0 24px;
}

.search-form {
    width: 100%;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #eee;
    border-radius: 8px;
    height: 40px;
}

.search-input {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    flex: 1;
    border: 0 !important;
    background: transparent !important;
    padding: 0;
    margin-left: 20px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    width: 100%;
    height: 100%;
    outline: none !important;
    box-shadow: none !important;
}

.search-input:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.search-input::-ms-clear,
.search-input::-ms-reveal {
    display: none;
}

.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
    -webkit-appearance: none !important;
    display: none !important;
}

.search-input::placeholder {
    color: #888;
    font-weight: 400;
}

.search-submit {
    background: #ff6000;
    border: none;
    color: #fff;
    min-width: 40px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}

.search-submit:hover {
    background: #ff7a1f;
}

.search-submit i {
    font-size: 14px;
}

/* Right Navigation */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.create-deal-btn,
.auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    height: 40px;
}

.create-deal-btn {
    background: #ff6000;
    color: #fff;
    border: none;
}

.create-deal-btn:hover {
    background: #ff7a1f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 96, 0, 0.2);
}

.auth-btn {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
}

.auth-btn:hover {
    background: #fff;
    border-color: #ccc;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 40px;
}

.user-menu-btn:hover {
    background: #fff;
    border-color: #ccc;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 220px;
    display: none;
    border: 1px solid #e0e0e0;
}

.user-menu:hover .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.user-dropdown a:hover {
    background: #f5f5f5;
    color: #ff6000;
}

.user-dropdown i {
    font-size: 16px;
    color: #666;
}

/* Category Navigation */
.category-nav {
    border-top: 1px solid #e0e0e0;
    background: #fff;
}

.category-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.category-list {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 48px;
}

.category-list a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 4px 0;
    position: relative;
}

.category-list a:hover {
    color: #ff6000;
}

.category-list a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ff6000;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.category-list a:hover::after {
    transform: scaleX(1);
}

.more-categories {
    position: relative;
}

.more-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 0;
}

.more-btn:hover {
    color: #ff6000;
}

.more-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 200px;
    display: none;
    border: 1px solid #e0e0e0;
}

.more-categories:hover .more-dropdown {
    display: block;
}

.more-dropdown a {
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
}

.more-dropdown a:hover {
    background: #f5f5f5;
    color: #ff6000;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 16px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1001;
}

.mobile-menu-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.menu-icon {
    width: 24px;
    height: 2px;
    background: #333;
    position: relative;
    transition: all 0.3s ease;
}

.menu-icon::before,
.menu-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: #333;
    left: 0;
    transition: all 0.3s ease;
}

.menu-icon::before {
    top: -8px;
}

.menu-icon::after {
    bottom: -8px;
}

.mobile-menu-btn.active .menu-icon {
    background: transparent;
}

.mobile-menu-btn.active .menu-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.mobile-menu-btn.active .menu-icon::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* Header Spacing */
.header-spacing {
    height: 112px; /* 64px main header + 48px category nav */
}

/* Mobile Styles */
@media (max-width: 1024px) {
    .main-header {
        padding: 12px 16px;
    }
    
    .header-search {
        margin: 0 16px;
    }
    
    .category-list {
        gap: 24px;
    }
    
    .category-wrapper {
        padding: 0 16px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    .header-search {
        display: none;
    }
    
    .category-nav {
        display: none;
    }
    
    .header-spacing {
        height: 64px;
    }
    
    .create-deal-btn span,
    .auth-btn span {
        display: none;
    }
    
    .create-deal-btn,
    .auth-btn {
        width: 44px;
        padding: 0;
        justify-content: center;
    }
    
    .create-deal-btn i,
    .auth-btn i {
        margin: 0;
    }

    .bottom-menu-content nav {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: #fff;
        padding: 20px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        display: none;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        z-index: 1000;
    }

    .bottom-menu-content nav.active {
        display: block;
        animation: slideDown 0.3s ease;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Bottom Menu Content */
.bottom-menu-content nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    padding: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
}

.bottom-menu-content nav.active {
    display: block;
    animation: slideDown 0.3s ease;
}

.bottom-menu-content .menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bottom-menu-content .menu li {
    border-bottom: 1px solid #eee;
}

.bottom-menu-content .menu li:last-child {
    border-bottom: none;
}

.bottom-menu-content .link-nav {
    display: block;
    padding: 1rem;
    color: #333;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.bottom-menu-content .link-nav:hover {
    background: #f8f9fa;
    color: #ff6000;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 