/**
 * Navigation Styles
 * Napul'è Restaurant Theme
 *
 * @package Napule_Restaurant
 */

/* Site Header */
.site-header {
    position: fixed;
    top: calc(0.4rem + 0.875rem + 0.4rem); /* Top-Bar: padding-top + font-size (line-height 1) + padding-bottom */
    left: 0;
    right: 0;
    z-index: var(--z-fixed);
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-top: 0;
}

/* Header ohne Top Bar (wenn versteckt) */
body.top-bar-hidden .site-header {
    top: 0;
}

/* Header transparent nur auf Startseite */
.home .site-header {
    background-color: transparent;
    backdrop-filter: none;
    box-shadow: none;
}

/* Header beim Scrollen */
.site-header.scrolled,
.home .site-header.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Logo Farbe */
.site-logo a {
    color: var(--color-primary);
    transition: color 0.3s ease;
}

/* Logo weiß nur auf Startseite (nicht gescrollt) */
.home .site-header:not(.scrolled) .site-logo a {
    color: var(--color-white);
}

.site-header .site-logo a:hover,
.site-header.scrolled .site-logo a:hover {
    color: var(--color-secondary);
}

.home .site-header:not(.scrolled) .site-logo a:hover {
    color: var(--color-accent);
}

/* Header Container */
.header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md) 0;
    gap: var(--spacing-3xl);
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
    transition: padding 0.3s ease;
}

/* Header auf Startseite größeres Padding (wenn nicht gescrollt) - nur Desktop */
@media (min-width: 769px) {
    .home .site-header:not(.scrolled) .header-container {
        padding-top: var(--spacing-2xl);
        padding-bottom: var(--spacing-2xl);
    }
}

/* Mobile: Mehr Padding nur auf Startseite (wenn nicht gescrollt) */
@media (max-width: 768px) {
    .home .site-header:not(.scrolled) .header-container {
        padding-top: var(--spacing-2xl);
        padding-bottom: var(--spacing-2xl);
    }
    
    /* Reduziertes Padding beim Scrollen oder auf anderen Seiten */
    .site-header.scrolled .header-container,
    body:not(.home) .site-header .header-container {
        padding-top: var(--spacing-md);
        padding-bottom: var(--spacing-md);
    }
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    z-index: var(--z-fixed);
    flex-shrink: 0;
}

.site-logo a {
    display: flex;
    align-items: center;
    color: var(--color-primary);
    font-size: var(--font-size-xl);
    font-weight: 700;
    font-family: var(--font-heading);
    transition: color 0.3s ease;
    white-space: nowrap;
    line-height: 1.2;
}

/* Logo weiß nur auf Startseite (nicht gescrollt) */
.home .site-header:not(.scrolled) .site-logo a {
    color: var(--color-white);
}

.site-logo a:hover {
    color: var(--color-secondary);
}

.home .site-header:not(.scrolled) .site-logo a:hover {
    color: var(--color-accent);
}

.custom-logo {
    max-height: 60px;
    width: auto;
}

/* Main Navigation */
.main-navigation {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.primary-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
}

.primary-menu li {
    position: relative;
}

.primary-menu a {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--color-primary);
    font-size: var(--font-size-base);
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
}

/* Navigation Links weiß nur auf Startseite (nicht gescrollt) */
.home .site-header:not(.scrolled) .primary-menu a {
    color: var(--color-white);
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a {
    color: var(--color-secondary);
}

/* Hover auf Startseite (nicht gescrollt) */
.home .site-header:not(.scrolled) .primary-menu a:hover,
.home .site-header:not(.scrolled) .primary-menu .current-menu-item > a {
    color: var(--color-accent);
}

/* Header Action Buttons */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-shrink: 0;
}

/* Button-Farbe im Header - verwendet den Gradient vom btn-primary */
.header-actions .btn-primary {
    color: var(--color-white);
    box-shadow: 0 2px 8px rgba(41, 59, 97, 0.15);
}

.header-actions .btn-primary:hover {
    box-shadow: 0 4px 12px rgba(41, 59, 97, 0.2);
}

/* Button auf Startseite (nicht gescrollt) */
.home .site-header:not(.scrolled) .header-actions .btn-primary {
    background: var(--color-white);
    border: 2px solid var(--color-white);
    color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

.home .site-header:not(.scrolled) .header-actions .btn-primary:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: var(--z-fixed);
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--color-primary);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

/* Mobile Toggle weiß nur auf Startseite (nicht gescrollt) */
.home .site-header:not(.scrolled) .menu-toggle span {
    background-color: var(--color-white);
}

/* Mobile Toggle immer dunkel wenn Menü geöffnet ist */
.menu-toggle.active span {
    background-color: var(--color-primary) !important;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Responsive Navigation */
@media (max-width: 1024px) {
    .site-header {
        top: 32px; /* Passt zur Top Bar */
    }
    
    body.top-bar-hidden .site-header {
        top: 0;
    }
    
    .menu-toggle {
        display: flex;
        position: relative;
        z-index: calc(var(--z-fixed) + 3); /* Über allem */
    }
    
    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--color-white);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: var(--spacing-4xl) var(--spacing-xl);
        gap: var(--spacing-md);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
        z-index: calc(var(--z-fixed) + 2);
    }
    
    .main-navigation.active {
        right: 0;
    }
    
    .primary-menu {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 0;
        max-width: 400px;
    }
    
    .primary-menu a {
        width: 100%;
        padding: var(--spacing-lg) var(--spacing-xl);
        text-align: center;
        color: var(--color-primary) !important;
        font-size: var(--font-size-xl);
        font-weight: 600;
        border-bottom: 1px solid rgba(41, 59, 97, 0.1);
    }
    
    .primary-menu a:hover,
    .primary-menu .current-menu-item > a {
        color: var(--color-secondary) !important;
        background-color: rgba(88, 140, 190, 0.05);
    }
    
    /* Überschreibe Startseiten-Regel für mobile Navigation */
    .home .site-header .main-navigation .primary-menu a {
        color: var(--color-primary) !important;
    }
    
    .home .site-header .main-navigation .primary-menu a:hover,
    .home .site-header .main-navigation .primary-menu .current-menu-item > a {
        color: var(--color-secondary) !important;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
        max-width: 400px;
        margin-top: var(--spacing-xl);
    }
    
    .header-actions .btn {
        width: 100%;
        font-size: var(--font-size-lg);
        padding: var(--spacing-md) var(--spacing-xl);
    }
    
    /* Button in mobiler Navigation immer korrekt hervorheben */
    .main-navigation .header-actions .btn-primary {
        background-color: var(--color-primary) !important;
        border-color: var(--color-primary) !important;
        color: var(--color-white) !important;
    }
    
    .main-navigation .header-actions .btn-primary:hover {
        background-color: var(--color-secondary) !important;
        border-color: var(--color-secondary) !important;
        color: var(--color-white) !important;
    }
    
    /* Hamburger Icon bleibt sichtbar */
    .menu-toggle span {
        background-color: var(--color-primary);
    }
    
    .menu-toggle.active span {
        background-color: var(--color-primary);
    }
}

@media (max-width: 768px) {
    .site-header {
        top: 30px; /* Kompaktere Top Bar auf mobil */
    }
    
    body.top-bar-hidden .site-header {
        top: 0;
    }
    
    .custom-logo {
        max-height: 50px;
    }
    
    .site-logo a {
        font-size: var(--font-size-xl);
    }
}
