/**
 * Solario24 Mobile Header Styles
 * Version: 1.8.2 - Fix horizontal scroll
 */

/* ===== FIX HORIZONTAL SCROLL ===== */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* Menu verstecken wenn nicht aktiv - verhindert overflow */
#s24MobileMenu:not(.active) {
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ===== VERSTECKTES FIBOSEARCH FÜR HEADER-TRIGGER ===== */
/* Positioniert außerhalb des Viewports, aber vollständig initialisiert */
.s24-hidden-fibosearch {
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
    width: 100px !important;
    height: 100px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

/* Das Icon innerhalb muss klickbar sein via JS */
.s24-hidden-fibosearch .js-dgwt-wcas-search-icon-handler,
.s24-hidden-fibosearch .dgwt-wcas-search-icon {
    pointer-events: auto !important;
}

/* ===== MOBILE HEADER ===== */
.s24-mobile-header {
    display: none;
    background-color: #ffffff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 9999;
}

/* Nur auf Mobile anzeigen (max 991px) */
@media (max-width: 991px) {
    .s24-mobile-header {
        display: block;
    }

    /* Standard Header ausblenden */
    .site-header,
    #masthead,
    header.elementor-location-header,
    .elementor-location-header,
    [data-elementor-type="header"],
    .header-mobile {
        display: none !important;
    }
}

.s24-header-inner {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    min-height: 70px;
}

/* Logo */
.s24-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.s24-logo img {
    height: 55px;
    width: auto;
}

/* Header Actions */
.s24-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ===== ICON BUTTONS - MAXIMALE SPEZIFITÄT ===== */
.s24-mobile-header .s24-icon-btn,
.s24-mobile-header .s24-header-actions .s24-icon-btn,
.s24-mobile-header button.s24-icon-btn,
.s24-mobile-header a.s24-icon-btn,
header.s24-mobile-header .s24-icon-btn,
body .s24-mobile-header .s24-icon-btn,
html body .s24-mobile-header .s24-icon-btn,
.s24-icon-btn,
button.s24-icon-btn,
a.s24-icon-btn {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    cursor: pointer;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    text-decoration: none;
    box-shadow: none !important;
}

.s24-mobile-header .s24-icon-btn:hover,
.s24-mobile-header .s24-icon-btn:active,
.s24-mobile-header .s24-icon-btn:focus,
.s24-icon-btn:hover,
.s24-icon-btn:active,
.s24-icon-btn:focus {
    background-color: rgba(0, 0, 0, 0.05) !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

.s24-icon-btn svg {
    width: 28px;
    height: 28px;
    stroke: #333333;
    fill: none;
}

/* Cart Button */
.s24-cart-btn {
    position: relative;
}

.s24-cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: linear-gradient(135deg, #82bb41 0%, #6fa532 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 2px 6px rgba(130, 187, 65, 0.4);
}

/* ===== HAMBURGER MENU BUTTON - MAXIMALE SPEZIFITÄT ===== */
.s24-mobile-header .s24-menu-btn,
.s24-mobile-header .s24-header-actions .s24-menu-btn,
.s24-mobile-header button.s24-menu-btn,
header.s24-mobile-header .s24-menu-btn,
body .s24-mobile-header .s24-menu-btn,
html body .s24-mobile-header .s24-menu-btn,
.s24-menu-btn,
button.s24-menu-btn,
#s24MenuBtn {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border-radius: 8px;
    padding: 10px;
    border: none !important;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s ease;
    box-shadow: none !important;
}

.s24-mobile-header .s24-menu-btn:hover,
.s24-mobile-header .s24-menu-btn:active,
.s24-mobile-header .s24-menu-btn:focus,
.s24-menu-btn:hover,
.s24-menu-btn:active,
.s24-menu-btn:focus,
#s24MenuBtn:hover,
#s24MenuBtn:active,
#s24MenuBtn:focus {
    background-color: rgba(0, 0, 0, 0.05) !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

.s24-menu-btn span {
    display: block;
    width: 24px;
    height: 2.5px;
    background-color: #333333 !important;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger Animation zu X */
.s24-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.s24-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.s24-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== MOBILE MENU OVERLAY ===== */
.s24-menu-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 99999;
    transition: right 0.3s ease-in-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.s24-menu-overlay.active {
    right: 0;
}

/* Menu Header */
.s24-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.s24-menu-header .s24-logo img {
    height: 40px;
    width: auto;
}

.s24-close-btn {
    background: #f8f8f8 !important;
    border: none !important;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.s24-close-btn:active {
    background-color: #e8e8e8 !important;
}

.s24-close-btn svg {
    width: 24px;
    height: 24px;
    stroke: #333333;
}

/* ===== SEARCH BAR CONTAINER ===== */
/* Fallback Search Wrapper (wenn kein FiboSearch) */
.s24-search-wrapper {
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 10px;
    padding: 12px 16px;
    gap: 10px;
}

.s24-search-wrapper svg {
    width: 20px;
    height: 20px;
    stroke: #888888;
    flex-shrink: 0;
}

.s24-search-wrapper input {
    border: none;
    background: transparent;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    color: #333333;
    width: 100%;
    outline: none;
}

.s24-search-wrapper input::placeholder {
    color: #aaaaaa;
}

/* =============================================================================
   FiboSearch / Ajax Search for WooCommerce - ICON-FLEXIBLE MODUS
   Das Icon wird als vollbreites Suchfeld gestylt, Klick öffnet Vollbild-Overlay
   ============================================================================= */

/* Search Container - feste Breite durch calc() */
.s24-menu-search {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Box-sizing für alle FiboSearch Elemente */
.s24-menu-search *,
.s24-menu-search *::before,
.s24-menu-search *::after {
    box-sizing: border-box !important;
}

/* Haupt-Wrapper - calc für exakte Breite abzüglich Padding */
.s24-menu-overlay .s24-menu-search .dgwt-wcas-search-wrapp,
.s24-menu-search .dgwt-wcas-search-wrapp,
.s24-menu-search > div {
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    min-width: 0 !important;
    display: block !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Das Icon-Element als Suchfeld-Button stylen */
.s24-menu-overlay .s24-menu-search .dgwt-wcas-search-icon,
.s24-menu-overlay .s24-menu-search .js-dgwt-wcas-search-icon-handler,
.s24-menu-search .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon-flexible .dgwt-wcas-search-icon,
.s24-menu-search .dgwt-wcas-search-icon,
.s24-menu-search .js-dgwt-wcas-search-icon-handler {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    background-color: #f5f5f5 !important;
    border-radius: 10px !important;
    padding: 14px 16px !important;
    gap: 12px !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
    box-sizing: border-box !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    overflow: hidden !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
}

.s24-menu-search .dgwt-wcas-search-icon:active,
.s24-menu-search .js-dgwt-wcas-search-icon-handler:active {
    background-color: #eeeeee !important;
}

/* Die Lupe im Icon */
.s24-menu-search .dgwt-wcas-search-icon svg,
.s24-menu-search .dgwt-wcas-search-icon img,
.s24-menu-search .js-dgwt-wcas-search-icon-handler svg,
.s24-menu-search .js-dgwt-wcas-search-icon-handler img {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    flex-shrink: 0 !important;
    opacity: 0.6 !important;
}

/* Lupe-Icon als ::before hinzufügen */
.s24-menu-search .dgwt-wcas-search-icon::before,
.s24-menu-search .js-dgwt-wcas-search-icon-handler::before {
    content: "" !important;
    display: inline-block !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%23888888'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z' /%3E%3C/svg%3E") !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    flex-shrink: 0 !important;
    opacity: 0.6 !important;
    order: -1 !important;
}

/* Vorhandene FiboSearch SVG/Img verstecken (wir nutzen unser eigenes Icon) */
.s24-menu-search .dgwt-wcas-search-icon > svg,
.s24-menu-search .dgwt-wcas-search-icon > img,
.s24-menu-search .js-dgwt-wcas-search-icon-handler > svg,
.s24-menu-search .js-dgwt-wcas-search-icon-handler > img {
    display: none !important;
}

/* Placeholder-Text nach dem Icon hinzufügen */
.s24-menu-search .dgwt-wcas-search-icon::after,
.s24-menu-search .js-dgwt-wcas-search-icon-handler::after {
    content: "Produkte suchen..." !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 15px !important;
    color: #888888 !important;
    margin-left: 4px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Das versteckte Suchformular im icon-flexible Modus bleibt versteckt */
.s24-menu-search .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon-flexible .dgwt-wcas-search-form,
.s24-menu-search .dgwt-wcas-search-form {
    display: none !important;
}

/* Arrow-Icon verstecken */
.s24-menu-search .dgwt-wcas-search-icon-arrow {
    display: none !important;
}

/* ===== FiboSearch Overlay/Vollbild Styling ===== */
/* Der Vollbild-Overlay von FiboSearch - höchste z-index */
.dgwt-wcas-overlay-mobile,
.dgwt-wcas-om-bar {
    z-index: 9999999 !important;
}

/* Autocomplete Dropdown im Overlay */
.dgwt-wcas-suggestions-wrapp {
    z-index: 999999 !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    margin-top: 5px !important;
}

/* ===== MENU NAVIGATION ===== */
.s24-menu-nav {
    padding: 8px 0;
}

/* Menu Notice */
.s24-menu-notice {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Haupt-Menüpunkt */
.s24-menu-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    text-decoration: none;
    color: #333333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.s24-menu-nav-item:active {
    background-color: #f8f8f8;
}

.s24-menu-nav-item .s24-arrow {
    width: 20px;
    height: 20px;
    stroke: #cccccc;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

/* Expanded State - Arrow rotiert */
.s24-menu-nav-item.expanded .s24-arrow {
    transform: rotate(90deg);
}

/* ===== SPECIAL MENU ITEMS (Montage, PV Dach-Simulator) ===== */
.s24-menu-nav-item.s24-special-item {
    color: #82bb41;
    font-weight: 600;
}

.s24-menu-nav-item.s24-special-item .s24-menu-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    stroke: #82bb41;
    fill: none;
    flex-shrink: 0;
}

.s24-menu-nav-item.s24-special-item .s24-item-content {
    display: flex;
    align-items: center;
}

/* ===== NEU BADGE ===== */
.s24-new-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #82bb41 0%, #6fa532 100%);
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 6px;
    border-radius: 4px;
    margin-left: 8px;
    box-shadow: 0 2px 4px rgba(130, 187, 65, 0.4);
    animation: s24-badge-pulse 2s ease-in-out infinite;
}

@keyframes s24-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Badge in Submenu */
.s24-submenu-item.s24-has-badge {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.s24-submenu-item .s24-new-badge {
    margin-left: auto;
    margin-right: 10px;
}

/* Badge in Special Menu Items */
.s24-menu-nav-item.s24-special-item .s24-new-badge {
    margin-left: 8px;
}

/* ===== UNTERMENÜ / SUBMENU ===== */
.s24-submenu {
    max-height: 0;
    overflow: hidden;
    background-color: #fafafa;
    transition: max-height 0.3s ease-out;
}

.s24-submenu.open {
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}

.s24-submenu-item {
    display: block;
    padding: 14px 20px 14px 40px;
    text-decoration: none;
    color: #555555;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.s24-submenu-item:active {
    background-color: #f0f0f0;
}

.s24-submenu-item:last-child {
    border-bottom: none;
}

.s24-submenu-item::before {
    content: '›';
    margin-right: 10px;
    color: #82bb41;
}

/* Menu Divider */
.s24-menu-divider {
    height: 8px;
    background-color: #f5f5f5;
}

/* ===== TRUST EMBLEMS ===== */
.s24-trust-section {
    padding: 20px;
    background-color: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.s24-trust-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    text-align: center;
}

.s24-trust-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.s24-trust-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    color: #555555;
}

.s24-trust-feature svg {
    width: 16px;
    height: 16px;
    stroke: #82bb41;
    flex-shrink: 0;
}

.s24-payment-methods {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.s24-payment-img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== BODY SCROLL LOCK ===== */
body.s24-menu-open {
    overflow: hidden;
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .s24-menu-overlay,
    .s24-submenu,
    .s24-menu-btn span,
    .s24-menu-nav-item .s24-arrow {
        transition: none;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .s24-mobile-header,
    .s24-menu-overlay {
        display: none !important;
    }
}

/* ===== RESET für Theme/Elementor Overrides ===== */
html body .s24-mobile-header .s24-header-actions button,
html body .s24-mobile-header .s24-header-actions a,
html body header.s24-mobile-header button,
html body header.s24-mobile-header a.s24-icon-btn {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}
