/* =========================================
   HEADER / BANNER MODULE V4 – HOTLINE OEM TYPO
   race-styles 2026
   Zweck:
   - OEM Mobile-Header aus mobil_styles_v5.css wiederherstellen
   - Header-Modul darf NICHT mehr den Mobile-Header neu erfinden
   - #scroll_pu bleibt initial AUS und erscheint nur über vorhandene OEM-/JS-Logik
   - Desktop bleibt unberührt
   - keine Produktgrid-Regeln
   - keine Sidebar-Navigationsregeln
   ========================================= */


/* -----------------------------------------
   Mobile OEM Header Restore
   Nur Mobile. Desktop bleibt vollständig unberührt.
   ----------------------------------------- */

@media (max-width: 767px) {
    :root {
        --topbar-height: 56px;
        --topbar-pad-y: 5px;
        --topbar-pad-x: 10px;
        --sidebar-width: 280px;
    }

    /* OEM Topbar */
    #top {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 99999;
        width: 100%;
        box-sizing: border-box;
        height: var(--topbar-height);
        padding: var(--topbar-pad-y) var(--topbar-pad-x);
        display: flex;
        align-items: center;
        justify-content: space-between;
        background-color: #1a1a1a;
        color: #fff;
        clear: both;
        margin: 0;
        transform: none;
        overflow: visible;
    }

    #top img {
        margin: 0;
        padding: 0;
        border: 0;
    }

    #top a {
        color: #fff;
        text-decoration: none;
    }

    /* OEM Scroll-Logo:
       initial aus. Nicht mit !important sichtbar machen.
       Die vorhandene Scroll-/JS-Logik darf es später einschalten. */
    #scroll_pu {
        display: none;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 999;
        transition: opacity 0.25s ease;
        width: auto;
        height: auto;
        margin: 0;
        padding: 0;
        transform: none;
    }

    #scroll_pu img,
    #scroll_pu .scroll-logo-img,
    #scroll_pu img.resize2 {
        width: 100%;
        height: auto;
        max-width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        object-fit: contain;
        transform: none;
    }

    /* OEM Header-Banner-Bild unter der fixen Topbar */
    .header {
        width: 100%;
        display: block;
        position: relative;
        z-index: 1;
        line-height: 0;
        margin: 0;
        padding-top: var(--topbar-height);
    }

    .header img {
        display: block;
        width: 100%;
        height: auto;
        margin: 0;
        padding: 0;
        border: none;
    }

    /* OEM Actions */
    #top-actions {
        display: flex;
        align-items: center;
        gap: 12px;
        transform: translateY(-2px);
        margin-left: auto;
        width: auto;
        max-width: none;
        min-width: 0;
        height: auto;
        min-height: 0;
        padding: 0;
        justify-content: flex-end;
        overflow: visible;
        background: transparent;
        z-index: auto;
    }

    #top-actions > a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }

    .lang-switch {
        position: relative;
        margin-right: 2px;
    }

    .lang-current img {
        width: 24px;
        height: auto;
        cursor: pointer;
    }

    #lang-list {
        position: absolute;
        top: calc(100% - 1px);
        left: 50%;
        transform: translateX(calc(-50% + 0.5px));
        background-color: #1a1a1a;
        border-radius: 6px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.25);
        list-style: none;
        padding: 5px 12px 5px 10px;
        min-width: 30px;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        z-index: 9999;
    }

    #lang-list.open {
        opacity: 1;
        visibility: visible;
    }

    #lang-list li img {
        width: 24px;
        height: auto;
        display: block;
        transform: translateX(-0.5px);
    }

    /* OEM Icongrößen */
    .navicon {
        height: 22px;
        width: auto;
        display: block;
        margin: 0;
    }

    .menu-icon {
        width: 36px;
        height: 24px;
        object-fit: contain;
    }

    .cart-link {
        display: flex;
        align-items: center;
        gap: 6px;
        position: relative;
    }

    .prodincart {
        background: #e60000;
        color: #fff;
        border-radius: 9px;
        font-size: 12px;
        min-width: 18px;
        height: 18px;
        line-height: 18px;
        text-align: center;
        padding: 0 4px;
    }

    /* OEM WhatsApp + Hotline */
    #top-actions a[href*="api.whatsapp.com"] {
        margin-right: 3px;
        display: inline-flex;
        align-items: center;
        line-height: 1;
    }

    #top-actions a[href*="api.whatsapp.com"] img {
        width: 15px;
        height: 15px;
    }

    /* Hotline OEM-Typo:
       Der Link enthält ein <b>. Genau das machte den Text zu fett.
       Deshalb hier bewusst weich zurücknehmen. */
    #top-actions a[href^="tel:"],
    #top-actions .top-hotline-link,
    #top-actions .hotline-link {
        display: inline-flex;
        align-items: center;
        font-family: jost300light, Arial, sans-serif !important;
        font-size: 11px !important;
        line-height: 1 !important;
        letter-spacing: 0 !important;
        font-weight: 400 !important;
        padding-left: 3px;
        border-left: none;
        text-transform: uppercase;
        -webkit-font-smoothing: antialiased;
        text-rendering: geometricPrecision;
    }

    #top-actions a[href^="tel:"] b,
    #top-actions .top-hotline-link b,
    #top-actions .hotline-link b {
        font-family: jost300light, Arial, sans-serif !important;
        font-size: inherit !important;
        line-height: inherit !important;
        letter-spacing: inherit !important;
        font-weight: 400 !important;
    }

    /* OEM Suche */
    #mobile-search-overlay {
        display: none;
        position: absolute;
        top: calc(100% - 2px);
        left: 0;
        width: 100%;
        z-index: 10000;
        margin: 0;
        padding: 0;
        border: none;
        background: transparent;
    }

    .search-input-wrapper {
        display: flex;
        width: 90%;
        margin: 8px auto 10px auto;
        align-items: stretch;
        gap: 0;
        background: transparent;
    }

    #global-search-input {
        -webkit-appearance: none;
        appearance: none;
        flex: 1 1 auto;
        height: 44px;
        margin: 0;
        border: 1px solid #4a4a4a;
        border-right: 0;
        padding: 0 12px;
        font-size: 16px;
        line-height: 44px;
        background: rgba(255,255,255,0.95);
        color: #000;
        box-sizing: border-box;
        border-radius: 0;
        outline: none;
        box-shadow: none;
        background-image: none;
    }

    .search-submit-btn {
        -webkit-appearance: none;
        appearance: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 44px;
        margin: 0;
        padding: 0 20px;
        background: #1a1a1a !important;
        color: #fff;
        border: 1px solid #4a4a4a;
        border-left: 0;
        font-weight: 700;
        line-height: 1;
        cursor: pointer;
        box-sizing: border-box;
        border-radius: 0;
        outline: none;
        box-shadow: none;
        background-image: none !important;
    }
}


/* =========================================
   HEADER MODULE V4.2 - MENU SAFETY 1023
   Korrektur:
   Der vorherige Safety-Block griff nur bis 767px.
   Einige Seiten/Breakpoints laufen aber bis 1023px noch im mobilen Header.
   Deshalb wird der Schutz bis 1023px erweitert.
   Desktop ab 1024px bleibt weiterhin unangetastet.
   ========================================= */
@media (max-width: 1023px) {
    #top {
        overflow: visible !important;
    }

    #top-actions {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        overflow: visible !important;
        position: relative !important;
        z-index: 100001 !important;
    }

    #top-actions .menu,
    #top-actions .cart,
    #top-actions .search-container,
    #top-actions .lang-switch {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        position: relative !important;
        overflow: visible !important;
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        height: auto !important;
        max-height: none !important;
        z-index: 100002 !important;
    }

    #menu-toggle,
    #top-actions .menu > a#menu-toggle {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        position: relative !important;
        overflow: visible !important;
        width: auto !important;
        max-width: none !important;
        min-width: 36px !important;
        height: auto !important;
        max-height: none !important;
        z-index: 100003 !important;
    }

    #menu-toggle img,
    #menu-toggle .menu-icon,
    #top-actions .menu-icon {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        width: 36px !important;
        min-width: 36px !important;
        max-width: 36px !important;
        height: 24px !important;
        min-height: 24px !important;
        max-height: 24px !important;
        object-fit: contain !important;
        flex: 0 0 auto !important;
        position: relative !important;
        z-index: 100004 !important;
    }
}


/* =========================================
   HEADER DESKTOP SEARCH POSITION FIX V7 FONT READABILITY
   Problem:
   - Desktop-Suchfeld klappte unter der Topbar auf und lag im Bannerbild.
   Lösung:
   - Desktop-only Suchfeld in den schwarzen Header-Balken setzen.
   - Mobile/OEM-Suche bleibt unberuehrt.
   ========================================= */
@media (min-width: 1024px) {
    #top {
        overflow: visible !important;
    }

    #mobile-search-overlay {
        position: absolute !important;
        top: 50% !important;
        right: 24px !important;
        left: auto !important;
        width: clamp(420px, 43vw, 540px) !important;
        max-width: calc(100vw - 680px) !important;
        min-width: 360px !important;
        transform: translateY(-50%) !important;
        z-index: 100010 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    #mobile-search-overlay form {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #mobile-search-overlay .search-input-wrapper {
        display: flex !important;
        align-items: stretch !important;
        width: 100% !important;
        height: 38px !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 0 !important;
        background: transparent !important;
        box-sizing: border-box !important;
    }

    #mobile-search-overlay #global-search-input {
        -webkit-appearance: none !important;
        appearance: none !important;
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        height: 38px !important;
        margin: 0 !important;
        padding: 0 12px !important;
        border: 1px solid #4a4a4a !important;
        border-right: 0 !important;
        border-radius: 0 !important;
        background: rgba(255,255,255,0.96) !important;
        color: #111 !important;
        font-size: 14px !important;
        line-height: 38px !important;
        outline: 0 !important;
        box-shadow: none !important;
        box-sizing: border-box !important;
    }

    #mobile-search-overlay .search-submit-btn {
        -webkit-appearance: none !important;
        appearance: none !important;
        flex: 0 0 auto !important;
        height: 38px !important;
        margin: 0 !important;
        padding: 0 18px !important;
        border: 1px solid #4a4a4a !important;
        border-left: 0 !important;
        border-radius: 0 !important;
        background: #050505 !important;
        color: #fff !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
        cursor: pointer !important;
        box-shadow: none !important;
        box-sizing: border-box !important;
    }
}

@media (min-width: 1024px) and (max-width: 1180px) {
    #mobile-search-overlay {
        right: 18px !important;
        width: 390px !important;
        min-width: 390px !important;
        max-width: 390px !important;
    }

    #mobile-search-overlay .search-submit-btn {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
}


/* =========================================
   HEADER DESKTOP SEARCH FONT FIX V7
   Suchfeld-Schriften an Website-Schrift angleichen:
   - keine Browser-Default-Button-Schrift
   - kein abweichender Input-Font
   - Font von Website/Header erben
   ========================================= */
@media (min-width: 1024px) {
    #mobile-search-overlay,
    #mobile-search-overlay form,
    #mobile-search-overlay .search-input-wrapper,
    #mobile-search-overlay #global-search-input,
    #mobile-search-overlay .search-submit-btn {
        font-family: inherit !important;
        letter-spacing: inherit !important;
        -webkit-font-smoothing: antialiased !important;
        text-rendering: geometricPrecision !important;
    }

    #mobile-search-overlay #global-search-input {
        font-family: inherit !important;
        font-weight: 400 !important;
    }

    #mobile-search-overlay #global-search-input::placeholder {
        font-family: inherit !important;
        font-weight: 400 !important;
        letter-spacing: inherit !important;
        color: #555 !important;
        opacity: 1 !important;
    }

    #mobile-search-overlay .search-submit-btn {
        font-family: inherit !important;
        font-weight: 700 !important;
        letter-spacing: inherit !important;
        text-transform: none !important;
    }
}


/* =========================================
   HEADER DESKTOP SEARCH FONT READABILITY V7
   Korrektur nach Sichttest:
   - inherit war zu schwach/unsauber im Header-Kontext
   - Input/Button bekommen lesbare Website-nahe Jost/Arial-Kette
   - leichter Buchstabenabstand
   - besserer Kontrast
   ========================================= */
@media (min-width: 1024px) {
    #mobile-search-overlay #global-search-input {
        font-family: jost300light, Jost, Arial, Helvetica, sans-serif !important;
        font-size: 15px !important;
        font-weight: 400 !important;
        letter-spacing: 0.018em !important;
        color: #111 !important;
        background: rgba(255,255,255,0.98) !important;
        -webkit-font-smoothing: antialiased !important;
        text-rendering: geometricPrecision !important;
    }

    #mobile-search-overlay #global-search-input::placeholder {
        font-family: jost300light, Jost, Arial, Helvetica, sans-serif !important;
        font-size: 15px !important;
        font-weight: 400 !important;
        letter-spacing: 0.018em !important;
        color: #555 !important;
        opacity: 1 !important;
    }

    #mobile-search-overlay .search-submit-btn {
        font-family: jost300light, Jost, Arial, Helvetica, sans-serif !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        letter-spacing: 0.015em !important;
        color: #fff !important;
        background: #050505 !important;
        -webkit-font-smoothing: antialiased !important;
        text-rendering: geometricPrecision !important;
    }
}
