/**
 * SUMA Header - Unified Styles
 * Saubere, konsistente Header-Styles ohne Debug-Code
 * Kompatibel mit WordPress-Menüs und Theme-Design
 */

/* ==========================================================================
   Header Base Styles
   ========================================================================== */

.smg-header-modern {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Header OHNE Top-Bar + MIT Admin Bar */
body.admin-bar .smg-header-modern {
    top: 32px !important; /* Admin Bar Höhe */
}

@media screen and (max-width: 782px) {
    body.admin-bar .smg-header-modern {
        top: 46px !important; /* Mobile Admin Bar Höhe */
    }
}

/* Header MIT Top-Bar: Position anpassen */
body:not(.admin-bar) .smg-top-bar ~ .smg-header-modern {
    top: 40px !important; /* Top-Bar Höhe */
}

/* Header MIT Top-Bar + Admin Bar */
body.admin-bar .smg-top-bar ~ .smg-header-modern {
    top: calc(40px + 32px) !important; /* Top-Bar + Admin Bar */
}

@media screen and (max-width: 782px) {
    body.admin-bar .smg-top-bar ~ .smg-header-modern {
        top: calc(40px + 46px) !important; /* Top-Bar + Mobile Admin Bar */
    }
}

.smg-header-modern.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Header Container */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 70px;
    max-width: var(--widget-max-width, 1400px);
    margin: 0 auto;
}

/* ==========================================================================
   Logo Section
   ========================================================================== */

.header-left,
.header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 16px;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.logo-link:hover {
    transform: scale(1.02);
}

.logo-image {
    height: var(--logo-height, 40px);
    width: auto;
    object-fit: contain;
    transition: height 0.3s ease;
}

/* SVG Logo - Special handling for proper scaling */
.logo-image.logo-svg {
    /* SVGs need explicit width constraint to scale properly with height */
    max-width: 200px;
    /* Ensure SVG maintains aspect ratio */
    display: block;
}

/* ==========================================================================
   Center Section - Öffnungszeiten
   ========================================================================== */

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    margin: 0 2rem;
    /* FOUC Prevention für Container */
    min-height: 36px;
}

/* Modern 2025 Opening Hours Pill - FOUC Prevention */
.opening-hours-pill {
    background: var(--smg-500, #e31e24);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 800;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    box-shadow: 0 4px 20px rgba(var(--smg-500-rgb, 227, 30, 36), 0.3),
                0 1px 3px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    height: 36px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    white-space: nowrap !important;
    margin-right: 2rem; /* Abstand zum nächsten Menüpunkt */
    /* FOUC Prevention */
    opacity: 0;
    animation: fadeInPill 0.3s ease-out 0.1s forwards;
}

.opening-hours-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(227, 30, 36, 0.4),
                0 2px 5px rgba(0, 0, 0, 0.15);
}

/* Flip Text Container - Perfekt zentriert */
.opening-hours-pill .opening-text {
    position: relative;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Simple Text Layout (ohne Flip-Animation) */
.opening-hours-pill .opening-text:not(.flip-text) {
    position: static;
    height: auto;
    width: auto;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    white-space: nowrap;
}

/* Flip Animation für zwei Texte - 2025 Style */
.opening-hours-pill .flip-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    animation: modernFlip 4s infinite ease-in-out;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.opening-hours-pill .flip-text:nth-child(2) {
    animation-delay: 2s;
}

@keyframes modernFlip {
    0%, 40% {
        transform: translate(-50%, -50%) rotateX(0deg);
        opacity: 1;
    }
    50%, 90% {
        transform: translate(-50%, -50%) rotateX(-90deg);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) rotateX(0deg);
        opacity: 1;
    }
}

/* Subtle Hover Effect */
.opening-hours-pill:hover {
    background: var(--smg-500, #f63d43);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--smg-500-rgb, 227, 30, 36), 0.4);
}

/* Status-spezifische Styles */
.opening-hours-pill.closed {
    background: var(--smg-gray-600, #757575);
    box-shadow: 0 2px 8px rgba(117, 117, 117, 0.2);
}

.opening-hours-pill.closed:hover {
    background: var(--smg-gray-700, #424242);
    box-shadow: 0 4px 12px rgba(117, 117, 117, 0.3);
}

.opening-hours-pill.closing-soon {
    background: var(--smg-400, #fd6c70);
    animation: subtlePulse 2s infinite;
    box-shadow: 0 2px 8px rgba(var(--smg-400-rgb, 253, 108, 112), 0.2);
}

.opening-hours-pill.closing-soon:hover {
    background: var(--smg-500, #f63d43);
    box-shadow: 0 4px 12px rgba(var(--smg-500-rgb, 246, 61, 67), 0.3);
}

/* Subtle Pulse Animation */
@keyframes subtlePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* FOUC Prevention Animation */
@keyframes fadeInPill {
    from {
        opacity: 0;
        transform: translateY(-2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Compact Icon und Text */
.opening-hours-pill .opening-icon {
    font-size: 10px;
    line-height: 1;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Vereinfachte Text-Struktur ohne Icon - FOUC Prevention */
.opening-hours-pill .opening-text {
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    position: static !important;
    height: auto !important;
    width: auto !important;
    display: inline-block !important;
    /* Sofortige Text-Stabilisierung */
    line-height: 1.2 !important;
    vertical-align: middle !important;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ==========================================================================
   Navigation Section
   ========================================================================== */

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

/* Social Media Icons in Header */
.header-social-icons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.header-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #666;
    background: transparent;
    transition: all 0.2s ease;
    text-decoration: none;
}

.header-social-link svg,
.header-social-link .social-icon-svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    transition: transform 0.2s ease;
}

/* Default Hover */
.header-social-link:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.header-social-link:hover svg {
    transform: scale(1.1);
}

/* Platform-Specific Hover Colors */
.header-social-link.header-social-facebook:hover {
    background: rgba(24, 119, 242, 0.1);
    color: #1877f2;
}

.header-social-link.header-social-instagram:hover {
    background: rgba(225, 48, 108, 0.1);
    color: #e1306c;
}

.header-social-link.header-social-twitter:hover {
    background: rgba(29, 161, 242, 0.1);
    color: #1da1f2;
}

.header-social-link.header-social-youtube:hover {
    background: rgba(255, 0, 0, 0.1);
    color: #ff0000;
}

.header-social-link.header-social-linkedin:hover {
    background: rgba(0, 119, 181, 0.1);
    color: #0077b5;
}

.header-social-link.header-social-tiktok:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #000000;
}

/* Focus State (Accessibility) */
.header-social-link:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Active State */
.header-social-link:active {
    transform: translateY(0);
}

/* ==========================================================================
   Navigation - Moved to /assets/css/layouts/navigation/navigation.css
   ========================================================================== */

/* AI Button - Hidden in Header (using bottom toggle instead) */
.ai-button {
    display: none;
}

/* Hamburger Menu */
.hamburger-menu {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 4px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.hamburger-menu:hover {
    background: rgba(0, 0, 0, 0.05);
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: #333;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ==========================================================================
   Mobile Menu
   ========================================================================== */

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(250, 250, 250, 0.98) 100%);
    backdrop-filter: blur(20px);
    transform: translateX(-100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 998;
    overflow-y: auto;
    opacity: 0;
}

.mobile-menu-overlay.active {
    transform: translateX(0);
    opacity: 1;
}

.mobile-menu-content {
    padding: 2rem 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: rgba(0, 0, 0, 0.9);
}

/* Mobile Menu Header */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.mobile-menu-logo {
    position: relative;
    z-index: 10;
}

.mobile-menu-logo img {
    height: var(--logo-height, 40px);
    filter: none; /* Kein Invert mehr - Logo normal anzeigen */
    max-width: 200px;
    object-fit: contain;
    background: transparent;
    position: relative;
    z-index: 10;
    transition: height 0.3s ease;
}

/* SVG Logo in Mobile Menu - Special handling */
.mobile-menu-logo img.logo-svg {
    /* SVGs need explicit width constraint */
    width: auto;
    display: block;
}

.mobile-menu-logo .site-name-fallback {
    color: rgba(0, 0, 0, 0.9);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    background: transparent;
    position: relative;
    z-index: 10;
}

.mobile-menu-close {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.8);
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.mobile-menu-close svg {
    width: 20px;
    height: 20px;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    padding: 1rem 0;
}

/* Mobile Nav Item Wrapper (für Mega Menu Items) */
.mobile-nav-item {
    position: relative;
}

.mobile-nav-item.has-mega-menu {
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mobile-nav-item.has-mega-menu .mobile-nav-link {
    flex: 1;
    border-bottom: none;
}

.mobile-nav-link,
.mobile-nav-menu a {
    color: rgba(0, 0, 0, 0.9);
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 500;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: block;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-nav-link::before,
.mobile-nav-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #e31e24;
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active,
.mobile-nav-menu a:hover,
.mobile-nav-menu a.active {
    color: #e31e24;
    background: rgba(227, 30, 36, 0.1);
    padding-left: 1rem;
}

.mobile-nav-link:hover::before,
.mobile-nav-link.active::before,
.mobile-nav-menu a:hover::before,
.mobile-nav-menu a.active::before {
    transform: scaleY(1);
}

/* Chevron Icon für Mega Menu Items (wird von JS hinzugefügt) */
.mobile-nav-item.has-mega-menu .mobile-mega-menu-toggle {
    flex-shrink: 0;
    padding: 1.5rem 0;
    margin-left: auto;
}

/* Modern 2025 Opening Hours Card in Mobile Menu */
.mobile-hours-card {
    padding: 2rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 2rem;
}

.hours-card-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg,
        rgba(227, 30, 36, 0.1) 0%,
        rgba(191, 22, 27, 0.05) 100%);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(227, 30, 36, 0.2);
    position: relative;
    overflow: hidden;
}

.hours-card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        #e31e24 50%,
        transparent 100%);
}

.hours-icon {
    background: linear-gradient(135deg, #e31e24, #bf161b);
    border-radius: 16px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(227, 30, 36, 0.3);
}

.hours-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.hours-status {
    flex: 1;
}

.status-text {
    display: block;
    font-size: 1.25rem;
    font-weight: 900;
    color: #e31e24;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 2px rgba(227, 30, 36, 0.2);
}

.status-detail {
    display: block;
    font-size: 0.95rem;
    color: rgba(0, 0, 0, 0.7);
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ==========================================================================
   Admin Bar Handling
   ========================================================================== */

/* Mobile Menu mit Admin Bar - Vollbild Design */
.admin-bar .mobile-menu-overlay {
    top: 32px;
    height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
    .admin-bar .mobile-menu-overlay {
        top: 46px;
        height: calc(100vh - 46px);
    }
}

/* ==========================================================================
   Responsive Design - Mobile Menu ab 1024px
   ========================================================================== */

@media (max-width: 1024px) {
    .header-container {
        padding: 0 0.75rem;
    }

    .header-center {
        margin: 0 0.5rem;
        flex: 0 1 auto;
        min-width: 0;
    }

    /* Mobile Opening Hours Pill - 2025 Kompakt */
    .opening-hours-pill {
        padding: 8px 14px;
        font-size: 11px;
        border-radius: 30px;
        min-width: 120px;
        height: 30px;
        box-shadow: 0 3px 12px rgba(227, 30, 36, 0.25);
    }

    .opening-hours-pill .opening-icon {
        display: none;
    }

    .opening-hours-pill .flip-text {
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.8px;
    }

    .desktop-nav,
    .desktop-only,
    .header-social-icons {
        display: none !important;
    }

    .hamburger-menu {
        display: flex;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 0.5rem;
        height: 60px;
        gap: 0.5rem;
    }

    .header-center {
        margin: 0 0.25rem;
        flex: 0 1 auto;
        min-width: 0;
    }
    
    .mobile-menu-overlay {
        top: 0;
        height: 100vh;
    }
    
    .logo-image {
        height: 32px;
    }
    
    /* Extra Small Mobile Opening Hours Pill - 2025 Ultra Kompakt */
    .opening-hours-pill {
        padding: 6px 12px;
        font-size: 9px;
        border-radius: 25px;
        min-width: 100px;
        height: 26px;
        box-shadow: 0 2px 8px rgba(227, 30, 36, 0.2);
    }

    .opening-hours-pill .opening-icon {
        display: none;
    }

    .opening-hours-pill .flip-text {
        font-size: 8px;
        font-weight: 800;
        letter-spacing: 0.6px;
    }
    
    .mobile-menu-content {
        padding: 1.5rem;
    }
}
