/* Header CSS - assets/css/header.css */

/* Header */
.header {
    background: rgb(12 12 12);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
}

.nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    min-height: 4rem;
    transition: height 0.3s ease;
}

.logo-container {
    display: flex;
    align-items: center;
    height: auto;
    max-height: 100px;
}

.logo-image {
    height: auto;
    max-height: 50px;
    width: auto;
    object-fit: contain;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.logo-image:hover {
    opacity: 0.8;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
}

/* Sub-Navigation unter dem Header */
.sub-navigation {
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 64px; /* Höhe des Headers */
    z-index: 999;
}

.sub-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    height: 48px;
}

.sub-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.sub-nav-link:hover {
    color: var(--primary);
}

.sub-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s ease;
}

.sub-nav-link:hover::after {
    width: 100%;
}

.sub-nav-link.active {
    color: var(--primary);
}

.sub-nav-link.active::after {
    width: 100%;
}

/* Search Bar */
.search-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-bar {
    width: 100%;
    padding: 0.875rem 3.5rem 0.875rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-bar:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 4px rgba(255, 71, 87, 0.1);
}

.search-bar::placeholder {
    color: var(--text-secondary);
}

.search-btn {
    position: absolute;
    right: 0.375rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gradient);
    border: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 1px 10px var(--primary);
}

/* Navigation Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.cart-btn {
    position: relative;
    background: var(--gradient);
    border: 1px solid var(--border);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
}

.cart-btn:hover {
    border-color: var(--primary);
    background: var(--gradient);
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary);
    color: white;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

/* User Profile Button */
.user-profile-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    min-width: 3rem;
    height: 3rem;
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.75rem;
}

.user-profile-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* Profile Dropdown */
.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    min-width: 200px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-profile-btn.active .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.dropdown-email {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.dropdown-menu {
    padding: 0.5rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
    cursor: pointer;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

.dropdown-item.danger {
    color: #ff6348;
}

.dropdown-item.danger:hover {
    background: rgba(255, 99, 72, 0.1);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

/* Login/Register Button für nicht eingeloggte Benutzer */
.login-register-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.login-register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 1px 10px var(--primary);
}

/* Mobile Anpassungen */
@media (max-width: 1024px) {
    .user-name {
        display: none;
    }

    .user-profile-btn {
        min-width: 3rem;
        padding: 0;
    }
}

@media (max-width: 768px) {
    .nav {
        padding: 1rem;
        gap: 0.5rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    .search-wrapper {
        display: none;
    }

    .nav-actions {
        gap: 0.5rem;
    }

    .cart-btn,
    .user-profile-btn {
        width: 2.5rem;
        height: 2.5rem;
    }

    .user-avatar {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.75rem;
    }

    .profile-dropdown {
        right: -1rem;
        min-width: 250px;
    }

    .sub-navigation {
        top: 56px; /* Angepasste Header-Höhe */
    }
    
    .sub-nav-inner {
        display: none;
    }
    
    .sub-nav-link {
        font-size: 0.85rem;
    }

    .login-register-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .login-text {
        display: none;
    }
    
    .login-register-btn svg {
        width: 20px;
        height: 20px;
    }
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-menu-btn:hover {
    color: var(--primary);
}

/* Mobile Search Button */
.mobile-search-btn {
    display: none;
    background: transparent;
    border: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
}

.mobile-search-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

/* Desktop only search */
.desktop-only {
    display: flex;
}

/* Mobile Sidebar */
.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.active {
    opacity: 1;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-card);
    z-index: 2001;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
}

.mobile-sidebar.active {
    transform: translateX(0);
}

.mobile-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.mobile-sidebar-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s;
}

.mobile-sidebar-close:hover {
    color: var(--text-primary);
}

.mobile-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.75rem;
    transition: all 0.2s;
    font-weight: 500;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: rgba(255, 71, 87, 0.1);
    color: var(--primary);
}

.mobile-nav-link.danger {
    color: #ff6348;
}

.mobile-nav-link.danger:hover {
    background: rgba(255, 99, 72, 0.1);
}

/* Mobile User Info */
.mobile-sidebar-user {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.mobile-user-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.mobile-user-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.mobile-user-email {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.mobile-user-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Mobile Login Button */
.mobile-sidebar-login {
    margin-top: auto;
    padding: 1rem 0;
}

.mobile-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: var(--gradient);
    color: white;
    padding: 1rem;
    border-radius: 0.75rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.mobile-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}

.mobile-search-modal {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    /* background: var(--bg-dark); */
    z-index: 3;
    flex-direction: column;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-search-modal.active {
    transform: translateY(0);
}

.mobile-search-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

.mobile-search-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 0.875rem 1.25rem;
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 1rem;
}

.mobile-search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.mobile-search-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    cursor: pointer;
}

.mobile-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Hide desktop elements */
    .desktop-only,
    .sub-navigation {
        display: none !important;
    }
    
    /* Show mobile elements */
    .mobile-menu-btn,
    .mobile-search-btn {
        display: flex;
    }
    
    /* Adjust nav layout */
    .nav {
        padding: 1rem;
        gap: 0.5rem;
    }
    
    /* Logo center alignment */
    .logo-container {
        flex: 1;
        display: flex;
        justify-content: center;
    }
    
    /* Nav actions alignment */
    .nav-actions {
        margin-left: 0;
    }
    
    /* Hide search wrapper */
    .search-wrapper {
        display: none;
    }
}

/* Animation for mobile elements */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}