/* ==========================================================================
   Inline-Components — extrahiert fuer Browser-Caching
   Consent-Banner + Header-Layout + TÜV-Badge + Hyphenation + Sonstiges
   ========================================================================== */

/* --- Consent-Banner --- */
#ra-consent-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    z-index: 999999; display: flex; align-items: center; justify-content: center;
}
#ra-consent-modal {
    background: var(--bg_light, #fcf7f0); border-radius: 8px; padding: 32px;
    max-width: 480px; width: 90%; font-family: 'Noto Sans', Helvetica, sans-serif;
    color: var(--text, #363636); box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
#ra-consent-title {
    font-weight: 900; font-size: 20px; margin: 0 0 12px; line-height: 1.3;
}
#ra-consent-overlay p {
    font-size: 15px; line-height: 1.6; margin: 0 0 20px;
}
#ra-consent-overlay a { color: var(--red, #B42344); }
.ra-consent-buttons { display: flex; gap: 12px; justify-content: center; }
.ra-consent-btn {
    flex: 1; padding: 12px 20px; border-radius: 85px;
    font-size: 16px; font-weight: 700; cursor: pointer;
    font-family: inherit; transition: opacity 0.2s;
}
.ra-consent-btn:hover { opacity: 0.85; }
#ra-consent-reject {
    background: transparent; color: var(--red, #B42344);
    border: 2px solid var(--red, #B42344);
}
#ra-consent-accept {
    background: var(--red, #B42344); color: var(--bg_light, #fcf7f0);
    border: 2px solid var(--red, #B42344);
}
body.ra-scroll-lock { overflow: hidden !important; }

/* --- Header Layout --- */
.et-l--header .et_pb_section_0_tb_header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    transform: none !important;
    animation: none !important;
    transition: box-shadow 0.3s ease !important;
    padding-top: 0px !important;
    padding-bottom: 0px !important;
    margin-top: 0px !important;
    margin-bottom: 0px !important;
}
.et_pb_section_0_tb_header .et_pb_row_0_tb_header {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    margin-top: 0px !important;
    margin-bottom: 0px !important;
    width: 95% !important;
    max-width: 2300px !important;
    transition: padding 0.3s ease;
}
.et_pb_section_0_tb_header .et_pb_menu_0_tb_header {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}
.et_pb_section_0_tb_header .et_pb_menu__wrap,
.et_pb_section_0_tb_header .et_pb_menu__wrap--visible,
.et_pb_section_0_tb_header .et_pb_menu__wrap--hidden {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}
.et_pb_section_0_tb_header .et_pb_menu__logo img {
    transition: transform 0.3s ease;
    transform-origin: left center;
}
.et_pb_section_0_tb_header .et_pb_menu__menu > nav > ul > li > a {
    font-weight: 600 !important;
    transition: padding 0.3s ease;
}
.et_pb_section_0_tb_header.is-scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.13);
}
@media (min-width: 768px) {
    .et_pb_section_0_tb_header.is-scrolled .et_pb_row_0_tb_header {
        padding-top: 0px !important;
        padding-bottom: 0px !important;
    }
    .et_pb_section_0_tb_header.is-scrolled .et_pb_menu__menu > nav > ul > li > a {
        padding-top: 25px !important;
        padding-bottom: 25px !important;
    }
    .et_pb_section_0_tb_header.is-scrolled .et_pb_menu__logo img {
        transform: scale(0.75);
    }
}
@media (max-width: 767px) {
    .et_pb_section_0_tb_header.is-scrolled .et_pb_row_0_tb_header {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }
}

/* --- Mobile Header: Reihenfolge Logo | WhatsApp | Burger ---
   Unter 980px (Burger-Menue sichtbar) werden die Inner-Wrapper der Menu-Module
   via display:contents flach gemacht, sodass Logo, WhatsApp-Button und Burger
   direkte Flex-Children der Column werden und per order angeordnet werden koennen. */
@media (max-width: 980px) {
    .et-l--header .et_pb_row > .et_pb_column {
        display: flex !important;
        align-items: center;
        gap: 10px;
        position: relative;
    }
    .et-l--header .et_pb_menu_0_tb_header,
    .et-l--header .et_pb_menu_0_tb_header .et_pb_menu_inner_container,
    .et-l--header .et_pb_menu_0_tb_header .et_pb_menu__wrap {
        display: contents !important;
    }
    .et-l--header .et_pb_menu_0_tb_header .et_pb_menu__logo-wrap {
        order: 1;
        flex: 0 1 auto;
    }
    .et-l--header .whatsapp {
        order: 2;
        flex: 0 0 auto;
        margin-left: auto !important;
    }
    .et-l--header .rag-burger {
        order: 3;
        flex: 0 0 auto;
    }
    /* Header ueber dem Overlay, damit Logo und Whatsapp sichtbar bleiben.
       Nav liegt spaeter mit noch hoeherem z-index daraufueber (mit eigenem Close-Button). */
    .et-l--header .et_pb_section_0_tb_header {
        z-index: 10000;
    }
}

/* --- ISO 9001 Logo (Startseite) auf Desktop 100px breiter --- */
@media (min-width: 981px) {
    .et_pb_image img[src*="ISO_9001"] {
        width: 700px;
        max-width: 100%;
        height: auto;
    }
}

/* --- Startseite: DOM ist mobile-first (Formular zuerst), Desktop via order umkehren --- */
@media (min-width: 761px) {
    body.home .et_pb_row_0 > .et_pb_column_0 {
        order: 1 !important;
        padding-right: 3%;
    }
    body.home .et_pb_row_0 > .et_pb_column_1 {
        order: 2 !important;
    }
}

/* --- TÜV Badge --- */
:root {
    --tuv-badge-total: 148px;
    --gpr-badge-total: 72px;
}
.tuv-floating-badge {
    position: fixed;
    left: 0px;
    bottom: 35px;
    z-index: 9998;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: #fff;
    border: 1px solid #ddd;
    padding: 8px 10px;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,.10);
    text-decoration: none;
    line-height: 1;
    will-change: transform, opacity;
    transition: opacity .25s ease, transform .25s ease, box-shadow .25s ease;
    overflow: visible;
}
.tuv-floating-badge.badge-enter {
    opacity: 0;
    transform: translateX(-10px);
}
.badge-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}
.tuv-floating-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -15px;
    width: 15px;
    height: 100%;
    background: #fff;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
.tuv-floating-badge img {
    display: block;
    width: 280px;
    height: 130px;
    content: url('/assets/images/ISO_9001_farbe_de.webp');
}
@media (min-width: 769px) {
    .tuv-floating-badge:hover {
        transform: translateX(8px);
        box-shadow: 0 6px 14px rgba(0,0,0,.20);
    }
}
@media (max-width: 768px) {
    :root {
        --tuv-badge-total: 114px;
        --gpr-badge-total: 64px;
    }
    .tuv-floating-badge {
        left: 20px;
        bottom: 20px;
        padding: 6px 8px;
        border-radius: 10px;
    }
    .tuv-floating-badge::before { display: none; }
    .tuv-floating-badge img {
        width: 100px;
        height: auto;
        content: url('/assets/images/small-tuv-logo.webp');
    }
}
@media (min-width: 769px) {
    .gpr-floating-badge {
        position: fixed;
        left: 0px !important;
        bottom: calc(35px + var(--tuv-badge-total) + 12px) !important;
        z-index: 9999 !important;
    }
}
@media (max-width: 768px) {
    .gpr-floating-badge {
        position: fixed;
        left: 20px !important;
        bottom: 20px !important;
        z-index: 9998 !important;
    }
    .tuv-floating-badge {
        display: none;
        z-index: 9999;
        bottom: calc(20px + var(--gpr-badge-total) + 12px);
    }
}

/* --- Logo min-height --- */
.et_pb_menu_0_tb_header .et_pb_menu_inner_container > .et_pb_menu__logo-wrap .et_pb_menu__logo img,
.et_pb_menu_0_tb_header .et_pb_menu__logo-slot .et_pb_menu__logo-wrap img {
    min-height: 50px;
}

/* --- Custom Background --- */
body.custom-background { background-color: #fcf7f0; }

/* --- Hyphenation --- */
body {
    hyphens: auto;
    hyphenate-limit-chars: 6 3 3;
    hyphenate-limit-lines: 2;
    overflow-wrap: break-word;
}
:is(a, button, input, select, textarea, label,
    code, pre, kbd, samp, .et_pb_button),
nav, nav * {
    hyphens: none;
    overflow-wrap: normal;
}

/* ==========================================================================
   Eigenes Mobile-Menue (ersetzt Divis defektes et_mobile_nav_menu)
   ========================================================================== */
.et_mobile_nav_menu { display: none !important; }

.rag-burger { display: none; }
.rag-mobile-nav { display: none; }

@media (max-width: 980px) {
    .et-l--header .et_pb_menu__menu { display: none !important; }

    .rag-burger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 32px;
        height: 24px;
        background: transparent;
        border: 0;
        padding: 0;
        margin: 0;
        cursor: pointer;
        position: relative;
        z-index: 1;
    }
    .rag-burger span {
        display: block;
        width: 100%;
        height: 3px;
        background: var(--text);
        border-radius: 2px;
        transition: transform .3s ease, opacity .2s ease;
        transform-origin: center;
    }
    body.rag-menu-open .rag-burger span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
    body.rag-menu-open .rag-burger span:nth-child(2) { opacity: 0; }
    body.rag-menu-open .rag-burger span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

    @media (max-width: 760px) {
        .rag-burger {
            width: 50px;
            height: 50px;
            padding: 13px;
            box-sizing: border-box;
            background: var(--red);
            border-radius: 100px;
            transition: background-color 300ms ease;
        }
        .rag-burger:hover,
        .rag-burger:focus-visible,
        body.rag-menu-open .rag-burger {
            background: var(--red_dark);
        }
        .rag-burger span {
            background: var(--bg_light);
        }
    }

    .rag-mobile-nav {
        display: block;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(320px, 85vw);
        background: var(--bg_light);
        padding: 70px 20px 30px;
        box-shadow: -4px 0 18px rgba(0,0,0,.18);
        transform: translateX(100%);
        transition: transform .3s ease;
        z-index: 10001;
        overflow-y: auto;
        visibility: hidden;
    }
    .rag-mobile-nav__close {
        position: absolute;
        top: 18px;
        right: 18px;
        width: 32px;
        height: 32px;
        background: transparent;
        border: 0;
        padding: 0;
        cursor: pointer;
    }
    .rag-mobile-nav__close span {
        position: absolute;
        top: 50%;
        left: 0;
        width: 100%;
        height: 3px;
        background: var(--text);
        border-radius: 2px;
    }
    .rag-mobile-nav__close span:nth-child(1) { transform: translateY(-50%) rotate(45deg); }
    .rag-mobile-nav__close span:nth-child(2) { transform: translateY(-50%) rotate(-45deg); }
    .rag-mobile-nav[hidden] { display: block; }
    body.rag-menu-open .rag-mobile-nav {
        transform: translateX(0);
        visibility: visible;
    }
    .rag-mobile-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    .rag-mobile-nav li { border-bottom: 1px solid rgba(0,0,0,.08); }
    .rag-mobile-nav a {
        display: block;
        padding: 18px 8px;
        font-size: 18px;
        font-weight: 600;
        color: var(--text);
        text-decoration: none;
    }
    .rag-mobile-nav a:hover,
    .rag-mobile-nav a:focus { color: var(--red); }
    .rag-mobile-nav li.is-active a { color: var(--red); }

    body.rag-menu-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 9999;
    }
    body.rag-menu-open { overflow: hidden; }
}
