/* Junie Fix: Layout, Navigation and Images */
html, body { margin: 0; padding: 0; background-color: #FAFAFA !important; }
.cm-template-wrapper { max-width: 1200px !important; margin: 0 auto !important; background: #fff !important; box-shadow: 0 0 10px rgba(0,0,0,0.1) !important; position: relative; }
#cm_navigation #cm_mainnavigation { list-style: none !important; margin: 0; padding: 0; display: block !important; }
#cm_navigation #cm_mainnavigation > li { display: inline-block !important; position: relative !important; margin-right: 15px !important; vertical-align: top !important; }
#cm_navigation #cm_mainnavigation a { text-decoration: none !important; display: block !important; padding: 5px 10px !important; }
#cm_navigation .cm_subnavigation { display: none !important; position: absolute !important; top: 100% !important; left: 0 !important; background: #fff !important; min-width: 200px !important; z-index: 1000 !important; border: 1px solid #ccc !important; padding: 0 !important; list-style: none !important; box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important; }
#cm_navigation #cm_mainnavigation li:hover > .cm_subnavigation { display: block !important; }
#cm_navigation .cm_subnavigation li { position: relative !important; margin: 0 !important; width: 100% !important; display: block !important; border-bottom: 1px solid #eee !important; }
#cm_navigation .cm_subnavigation li:last-child { border-bottom: none !important; }
#cm_navigation .cm_subnavigation a { padding: 10px 15px !important; white-space: nowrap !important; color: #333 !important; font-size: 14px !important; }
#cm_navigation .cm_subnavigation .cm_subnavigation { top: 0 !important; left: 100% !important; margin-left: 1px !important; }
#cm_navigation #cm_mainnavigation a:hover { color: #0094CB !important; }
#cm_navigation .cm_subnavigation a:hover { background-color: #0094CB !important; color: #fff !important; }

/* Desktop-only navigation fixes */
@media (min-width: 769px) {
    .mobile_navigation, .toggle_navigation { display: none !important; }
}

.cm-logo, .cm-logo img, .cm-logo svg { max-width: 300px !important; height: auto !important; background-size: contain !important; display: block !important; }
.cm-logo { min-height: 100px !important; }
.cm4all_com_widgets_UroPhoto img { max-width: 100% !important; height: auto !important; }
/* Content spacing and layout fixes */
.content_wrapper, .cm-template-content { padding: 20px !important; min-height: 600px !important; }
#content_main { padding: 0 15px !important; }
.cm_column img { max-width: 100% !important; height: auto !important; }
/* Ensure the Notarin portrait isn't too small if the container is wide */
#content_main .cm_column img { width: 100% !important; height: auto !important; }
/* Link colors and backgrounds from vars.css */
a.cm_anchor { color: #226589 !important; }
a.cm_anchor:hover { color: #ae876a !important; }
.footer_wrapper { background-color: #0094CB !important; color: #fff !important; padding: 30px !important; }
.footer_wrapper a { color: #fff !important; text-decoration: underline !important; }
.footer_wrapper a:hover { color: #f2f2f2 !important; }
/* Fix for disappearing background on some elements */
#cm_navigation, .header_wrapper, .content_wrapper, .footer_wrapper { position: relative; z-index: 10; }

/* Hide separating lines on homepage if they appear as "Querbalken" */
.page-000000886217 .cm-widget_separatingline {
    display: none !important;
}
/* page-000000886217 is the ID for Startseite based on index.html beng.env */

/* Ensure cookie consent is visible if present */
.cm4all-cookie-consent,
#cookieSettingsDialog {
    z-index: 99999 !important;
    background: #fff !important;
    padding: 20px !important;
    border: 1px solid #ccc !important;
    box-shadow: 0 0 20px rgba(0,0,0,0.5) !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 600px !important;
}
.cm-cookie-header__headline {
    color: #0094CB !important;
    margin-top: 0 !important;
}
.cm-cookie-button {
    background-color: #0094CB !important;
    color: #fff !important;
    padding: 10px 20px !important;
    border: none !important;
    cursor: pointer !important;
    margin-right: 10px !important;
    margin-top: 10px !important;
}
.cm-cookie-button:hover {
    background-color: #ae876a !important;
}
#cookieSettingsDialog.cm-hidden {
    display: none !important;
}

/* Ensure cookie switches are visible and styled */
.cm-cookie-switch-wrapper input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.cm-cookie-switch-wrapper span {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    transition: .4s;
    vertical-align: middle;
    margin-right: 10px;
}
.cm-cookie-switch-wrapper span:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}
.cm-cookie-switch-wrapper input:checked + span {
    background-color: #0094CB;
}
.cm-cookie-switch-wrapper input:checked + span:before {
    transform: translateX(20px);
}

/* Mobile optimizations */
@media (max-width: 1024px) {
    .cm-logo {
        max-width: 200px !important;
        margin: 10px auto !important; /* Etwas Margin oben/unten */
        background-size: contain !important;
        height: 60px !important; /* Force visibility in mobile */
        position: relative !important;
        z-index: 1002 !important;
        display: block !important;
    }
    #cm_navigation #cm_mainnavigation {
        display: none !important; /* Hide desktop nav on mobile/tablet */
    }
    .toggle_navigation {
        display: flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
        text-align: center;
        background: #0094CB !important;
        color: #fff !important;
        margin: 0 !important;
        z-index: 1100 !important;
        position: fixed !important;
        top: 20px !important;
        right: 20px !important;
        width: 50px !important;
        height: 50px !important;
        border-radius: 50% !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
    }
    .toggle_navigation .hamburger {
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .toggle_navigation .hamburger-box {
        width: 30px !important;
        height: 24px !important;
        display: block !important;
    }
    .toggle_navigation .hamburger-inner, 
    .toggle_navigation .hamburger-inner::before, 
    .toggle_navigation .hamburger-inner::after {
        background-color: #fff !important;
        width: 30px !important;
        display: block !important;
    }
    
    /* Falls Hamburger-Inner nicht reicht, erzwinge ein Icon */
    .toggle_navigation .hamburger-inner::before {
        content: "" !important;
    }
    
    .mobile_navigation {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 80% !important;
        height: 100% !important;
        padding: 80px 20px 20px !important;
        background: #fff !important;
        z-index: 1090 !important;
        transition: right 0.3s ease !important;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1) !important;
        overflow-y: auto !important;
        visibility: visible !important;
    }
    body.open_mobile_navigation .mobile_navigation {
        right: 0 !important;
    }
    
    /* Overlay when menu is open */
    body.open_mobile_navigation::after {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1080;
    }

    .mobile_navigation ul {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .mobile_navigation li {
        border-bottom: 1px solid #eee !important;
        position: relative;
    }
    .mobile_navigation a {
        display: block !important;
        padding: 15px 10px !important;
        color: #333 !important;
        text-decoration: none !important;
        font-size: 16px !important;
    }
    
    /* Subnavigation on mobile */
    .mobile_navigation .cm_subnavigation {
        display: none !important;
        padding-left: 20px !important;
        background: #f9f9f9 !important;
        position: static !important;
        border: none !important;
        box-shadow: none !important;
    }
    .mobile_navigation .cm-templates-navigation--open-subnav > .cm_subnavigation {
        display: block !important;
    }
    
    .cm-templates-icon__arrow-mobile {
        position: absolute;
        right: 10px;
        top: 15px;
        font-family: "FontAwesome" !important;
        cursor: pointer;
        padding: 5px;
        z-index: 2;
    }

    /* Center Kontakt button on mobile and override inline styles */
    .cm-widget-button_2 {
        display: block !important;
        margin: 20px auto !important;
        float: none !important;
        text-align: center !important;
        max-width: 230px !important;
        width: 230px !important; /* Force width if needed */
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
    }

    .cm-smart-access-button {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        position: fixed !important;
        bottom: 20px !important;
        right: 20px !important;
        z-index: 10000 !important;
        background: #0094CB !important;
        color: #fff !important;
        width: 50px !important;
        height: 50px !important;
        border-radius: 50% !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
    }
    .cm-smart-access-menu {
        bottom: 80px !important;
        right: 20px !important;
        display: none; /* Hidden by default, toggled by JS or can be forced if needed */
    }
    .cm-smart-access-menu.open {
        display: block !important;
    }
}

/* Fallback for mobile menu toggle if JS fails - CSS only partial support */
@media (max-width: 1024px) {
    .toggle_navigation:active + .mobile_navigation {
        right: 0 !important;
    }
}

/* Ensure the Kontakt button stands out */
.cm-widget-button_2 {
    transition: all 0.3s ease !important;
}
.cm-widget-button_2:hover {
    transform: scale(1.05) !important;
}

/* Hide Contact Form everywhere as requested */
.cm4all_com_widgets_Formular,
.formWidget,
#widgetcontainer_CM_cm4all_com_widgets_Formular_3456566,
[id^="form_"][id$="_introtext"],
[id^="form_"][id$="_answertext"] {
    display: none !important;
}

/* Hide Bing Map and related title */
.com_cm4all_wch_maps,
#widgetcontainer_S4BPRD_com_cm4all_wch_maps_3464175,
h3:has(+ div + #widgetcontainer_S4BPRD_com_cm4all_wch_maps_3464175),
h3:has(+ .clearFloating + .com_cm4all_wch_maps),
h3:has(+ .clearFloating + #widgetcontainer_S4BPRD_com_cm4all_wch_maps_3464175),
/* Added for Impressum and other variants */
iframe[src*="bing.com/maps"],
iframe[src*="google.com/maps"],
.cm-widget-maps-show {
    display: none !important;
}
/* Fallback if :has is not supported or for general safety */
.com_cm4all_wch_maps {
    display: none !important;
}
