/**
 * Navigation Styles
 * Ella Radio Theme
 */

.site-navigation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-navigation);
    background: #e20717;
    border-bottom: none;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(60, 46, 37, 0.1);
}

/* Scrolled State */
.site-navigation.scrolled {
    background: #e20717 !important;
    border-bottom: 1px solid rgba(60, 46, 37, 0.1);
    box-shadow: 0 4px 20px rgba(60, 46, 37, 0.15);
}

.nav-container {
    max-width: 1398px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (min-width: 1440px) {
    .nav-container {
        padding: 0;
    }
}

@media (max-width: 1439px) {
    .nav-container {
        padding: 0 1.5rem;
    }
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 160px;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrolled State - Smaller Header */
.site-navigation.scrolled .nav-wrapper {
    height: 80px;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    z-index: 2;
    padding: 2.5rem 0 2rem 0;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-navigation.scrolled .site-logo {
    padding: 0.75rem 0;
}

/* Logo-Container - wie bei Ella Radio mit transition: all */
.site-logo a {
    display: block;
    position: relative;
    height: 140px;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-navigation.scrolled .site-logo a {
    height: 50px;
}

/* Ein einziges Logo-Element - animiert height + src-Wechsel */
.logo-image {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: height;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .nav-wrapper {
        height: 90px;
    }

    .site-navigation.scrolled .nav-wrapper {
        height: 60px;
    }

    .site-logo {
        padding: 0.75rem 0;
    }

    .site-navigation.scrolled .site-logo {
        padding: 0.25rem 0;
    }

    .site-logo a {
        height: 65px;
    }

    .site-navigation.scrolled .site-logo a {
        height: 34px;
    }

    .mobile-menu-toggle {
        align-items: center;
        justify-content: center;
    }

    .nav-container {
        padding: 0 1rem;
    }
}

/* Desktop Menu (≥1280px) */
.desktop-menu {
    display: none;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 2rem;
}

@media (min-width: 1280px) {
    .desktop-menu {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: none;
    }
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #ffffff;
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.5rem;
    transition: var(--transition-smooth);
    text-decoration: none;
    white-space: nowrap;
    border-radius: 0.5rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Aktiver Menüpunkt */
.current-menu-item > .nav-link,
.current_page_item > .nav-link {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}

/* Hover bei aktivem Menüpunkt */
.current-menu-item > .nav-link:hover,
.current_page_item > .nav-link:hover {
    background: rgba(255, 255, 255, 0.35) !important;
}

.dropdown-arrow {
    transition: var(--transition-smooth);
}

.dropdown-arrow path {
    stroke: #ffffff;
}

.nav-item.has-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: calc(var(--radius) * 0.5);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(60, 46, 37, 0.1);
}

.nav-item.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: #333;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.dropdown-menu a:hover {
    background: #f8f8f8;
    color: hsl(var(--primary));
}

/* Aktive Links im Dropdown - rot statt weiß! */
.dropdown-menu .current-menu-item > a,
.dropdown-menu .current_page_item > a {
    background: #f8f8f8 !important;
    color: hsl(var(--primary)) !important;
    font-weight: 600;
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    transition: var(--transition-smooth);
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-icon:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

/* Cart Badge */
.cart-icon {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: white;
    color: hsl(var(--primary));
    font-size: 0.625rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid hsl(var(--header-bg));
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none; /* Hidden by default, shown only on mobile */
    flex-direction: column;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2;
    padding: 0;
}

@media (max-width: 1279px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
    transition: var(--transition-smooth);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Mobile Menu Drawer */
.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 90%;
    height: 100vh;
    background: hsl(var(--header-bg));
    z-index: var(--z-dropdown);
    overflow-y: auto;
    transition: right 0.3s ease-in-out;
    box-shadow: -5px 0 30px rgba(60, 46, 37, 0.4);
}

.mobile-menu-drawer.open {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: flex-end;
    padding: 1.5rem;
    border-bottom: 1px solid hsl(var(--border) / 0.3);
}

.mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

.mobile-menu-content {
    padding: 2rem 1.5rem;
}

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

.mobile-nav-item {
    margin-bottom: 0.5rem;
}

.mobile-nav-item > a {
    display: block;
    padding: 1rem;
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: calc(var(--radius) * 0.5);
    transition: var(--transition-smooth);
}

.mobile-nav-item > a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Accordion for Mobile Submenu */
.accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-radius: calc(var(--radius) * 0.5);
    transition: var(--transition-smooth);
}

.accordion-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.accordion-arrow {
    transition: var(--transition-smooth);
}

.mobile-nav-item.open .accordion-arrow {
    transform: rotate(180deg);
}

.mobile-submenu {
    list-style: none;
    margin: 0;
    padding: 0 0 0 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.mobile-nav-item.open .mobile-submenu {
    max-height: 300px;
}

.mobile-submenu li {
    margin: 0;
}

.mobile-submenu a {
    display: block;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.mobile-submenu a:hover {
    color: white;
}

.mobile-menu-actions {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid hsl(var(--border) / 0.3);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: calc(var(--z-dropdown) - 1);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

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

/* Search Modal */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.search-modal.active {
    opacity: 1;
    visibility: visible;
}

.search-modal-content {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.search-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

.search-form {
    position: relative;
    display: flex;
    gap: 0;
}

.search-field {
    flex: 1;
    padding: 1rem 1.5rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius);
    color: #333;
    font-size: 1.125rem;
    outline: none;
    transition: var(--transition-smooth);
}

.search-field:focus {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsla(356, 85%, 45%, 0.2);
}

.search-submit {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: hsl(var(--primary));
    border: none;
    border-radius: calc(var(--radius) * 0.5);
    color: hsl(var(--primary-foreground));
    cursor: pointer;
    transition: var(--transition-smooth);
}

.search-submit:hover {
    background: hsl(var(--secondary));
    box-shadow: 0 4px 12px hsla(356, 85%, 45%, 0.3);
}

/* Scrolled State */
.site-navigation.scrolled {
    background: hsl(var(--header-bg));
    box-shadow: 0 4px 20px rgba(60, 46, 37, 0.2);
}

/* ==============================================
   Mobile Navigation Icons (Cart, Search, Burger)
   ============================================== */

/* Default: versteckt auf Desktop */
.mobile-nav-icons {
    display: none;
}

/* Mobile: Icons anzeigen */
@media (max-width: 1279px) {
    .mobile-nav-icons {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .mobile-nav-icons .btn-icon {
        border: 1px solid rgba(255, 255, 255, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        padding: 0;
        background: transparent;
        color: white;
        cursor: pointer;
        border-radius: 8px;
        transition: background-color 0.2s ease;
    }
    
    .mobile-nav-icons .btn-icon:hover {
        background: hsl(var(--muted) / 0.5);
    }
    
    .mobile-nav-icons .btn-icon svg {
        width: 18px;
        height: 18px;
    }
    
    /* Cart Badge */
    .mobile-nav-icons .cart-badge {
        position: absolute;
        top: 2px;
        right: 2px;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        font-size: 10px;
        font-weight: 600;
        line-height: 16px;
        text-align: center;
        color: white;
        background: hsl(var(--primary));
        border-radius: 8px;
    }
    
    .mobile-nav-icons .cart-icon {
        position: relative;
    }
    
    /* Mobile Burger Button - gleicher Style wie Icons */
    .mobile-nav-icons .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        padding: 0;
        border: none;
        background: transparent;
        cursor: pointer;
        border-radius: 8px;
        transition: background-color 0.2s ease;
    }
    
    .mobile-nav-icons .mobile-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .mobile-nav-icons .mobile-menu-toggle .hamburger-line {
        background: white;
    }
}

