/* STYLESHEET: style.css (Optimierte Version für perfektes Desktop- & Mobile-Layout) */

:root {
    --primary: #1a3a52;
    --primary-dark: #112536;
    --accent: #e8743b;
    --accent-hover: #d25f27;
    --background: #f8f9fa;
    --text-dark: #2c3e50;
    --text-muted: #5a6b7c;
    --text-light: #ffffff;
    --border-color: #dbe1e6;
    --max-width: 1200px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #ffffff;
    overflow-x: hidden;
}

/* TYPOGRAPHY */
h1, h2, h3, h4 {
    font-family: Georgia, serif;
    color: var(--primary);
    font-weight: 700;
}

.hero h3 {
    color: var(--text-light);
}

h1 {
    font-size: 30px;
    line-height: 1.2;
    margin-bottom: 16px;
}

h2 {
    font-size: 24px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 8px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--accent);
}

h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

p {
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin-top: -12px;
    margin-bottom: 32px;
}

/* STRUCTURE & CONTAINERS */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

.section {
    padding: 40px 0;
}

.section-bg {
    background-color: var(--background);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb {
    padding: 12px 0;
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    background-color: var(--background);
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb span {
    margin: 0 8px;
    color: var(--border-color);
}

/* BUTTONS & INTERACTIVE TARGETS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent);
    color: var(--text-light);
    padding: 14px 24px;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 4px;
    min-height: 48px;
    border: none;
    cursor: pointer;
    text-align: center;
    width: 100%;
    max-width: 320px;
    transition: background-color 0.2s ease;
}

.btn:hover, .btn:focus {
    background-color: var(--accent-hover);
    outline: none;
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--text-light);
    color: var(--text-light);
}

.btn-secondary:hover, .btn-secondary:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover, .btn-outline:focus {
    background-color: rgba(26, 58, 82, 0.05);
}

/* NAVIGATION HEADER (MOBILE DEFAULT) */
.header {
    position: sticky;
    top: 0;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(26, 58, 82, 0.08);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    overflow: hidden;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
    position: relative;
}

.logo {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-decoration: none;
    line-height: 1.2;
}

.logo-title {
    font-family: Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.logo-sub {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    text-transform: uppercase;
}

.menu-toggle {
    display: none;
}

.menu-button {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
    z-index: 1010;
}

.menu-button span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--primary);
    transition: transform 0.2s ease, opacity 0.2s ease;
    border-radius: 2px;
}

.nav-menu {
    position: fixed;
    top: 72px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 72px);
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    gap: 8px;
    list-style: none;
    transition: left 0.3s ease-in-out;
    border-top: 1px solid var(--border-color);
    overflow-y: auto;
}

.nav-item {
    width: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    min-height: 48px;
    border-bottom: 1px solid var(--background);
}

/* Mobile Dropdown via Details/Summary */
.nav-dropdown {
    width: 100%;
}

.nav-dropdown-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: var(--primary);
    font-weight: bold;
    font-size: 16px;
    min-height: 48px;
    cursor: pointer;
    list-style: none;
    border-bottom: 1px solid var(--background);
}

.nav-dropdown-summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown-summary::after {
    content: "▼";
    font-size: 10px;
    color: var(--text-muted);
}

.nav-dropdown[open] .nav-dropdown-summary::after {
    content: "▲";
}

.dropdown-list {
    list-style: none;
    background-color: var(--background);
    padding-left: 16px;
}

.dropdown-list .nav-link {
    font-weight: normal;
    font-size: 15px;
    border-bottom: 1px solid var(--border-color);
}

.nav-phone-btn {
    margin-top: 16px;
    background-color: var(--primary);
    width: 100%;
    max-width: 100%;
}

/* Burger Menu Trigger */
.menu-toggle:checked ~ .nav-menu {
    left: 0;
}

.menu-toggle:checked ~ .menu-button span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle:checked ~ .menu-button span:nth-child(2) {
    opacity: 0;
}

.menu-toggle:checked ~ .menu-button span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* HERO */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-light);
    padding: 40px 0;
}

.hero h1 {
    color: var(--text-light);
}

.hero p {
    color: #cbd5e1;
    font-size: 16px;
    margin-bottom: 24px;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* CARDS & GRID STACKS */
.grid-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    background-color: #ffffff;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.card-header-icon {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.icon-vector {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.5;
}

/* PROCESS STEP LIST */
.step-list {
    list-style: none;
}

.step-item {
    position: relative;
    padding-left: 40px;
    margin-bottom: 24px;
}

.step-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background-color: var(--primary);
    color: var(--text-light);
    font-weight: bold;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* STATS & REVIEWS */
.stats-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    text-align: center;
    margin-bottom: 32px;
}

.stat-entry {
    padding: 12px 4px;
    border-right: 1px solid var(--border-color);
}

.stat-entry:last-child {
    border-right: none;
}

.stat-num {
    font-family: Georgia, serif;
    font-size: 26px;
    font-weight: bold;
    color: var(--accent);
}

.stat-txt {
    font-size: 12px;
    color: var(--text-muted);
}

.review-item {
    background-color: #ffffff;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 12px;
}

.review-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.review-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    color: var(--text-light);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.review-stars {
    color: #f59e0b;
    font-size: 12px;
}

/* ACCORDION (FAQ) */
.accordion-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accordion-details {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.accordion-summary {
    padding: 14px 16px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
}

.accordion-summary::-webkit-details-marker {
    display: none;
}

.accordion-summary::after {
    content: "+";
    font-size: 18px;
    font-weight: bold;
    color: var(--accent);
}

.accordion-details[open] .accordion-summary::after {
    content: "-";
}

.accordion-content {
    padding: 16px;
    font-size: 15px;
    border-top: 1px solid var(--border-color);
}

/* FORMULARE */
.split-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.cta-dark-box {
    background-color: var(--primary);
    color: var(--text-light);
    padding: 24px 16px;
    border-radius: 4px;
}

.cta-dark-box h2 {
    color: var(--text-light);
}

.phone-display-link {
    display: block;
    font-size: 26px;
    font-family: Georgia, serif;
    font-weight: bold;
    color: var(--accent);
    text-decoration: none;
    margin: 16px 0;
    min-height: 48px;
}

.bullet-list {
    list-style: none;
    font-size: 14px;
    color: #cbd5e1;
}

.bullet-list li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
}

.bullet-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

.form-box {
    background-color: var(--background);
    padding: 24px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.field-group {
    margin-bottom: 16px;
}

.field-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.input-field {
    width: 100%;
    padding: 12px;
    font-family: inherit;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-dark);
    background-color: #ffffff;
}

textarea.input-field {
    min-height: 120px;
}

.placeholder-map {
    background-color: #e2e8f0;
    border: 1px solid var(--border-color);
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 16px;
    margin-top: 16px;
    border-radius: 4px;
}

/* PRICE TABLE */
.price-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 14px;
}

.price-table th, .price-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.price-table th {
    background-color: var(--primary);
    color: var(--text-light);
}

.price-table tr:nth-child(even) {
    background-color: var(--background);
}

/* FOOTER */
.footer {
    background-color: var(--primary-dark);
    color: #94a3b8;
    padding: 40px 0 16px 0;
    font-size: 14px;
    border-top: 3px solid var(--accent);
}

.footer-section {
    margin-bottom: 32px;
}

.footer-section h4 {
    color: var(--text-light);
    font-size: 15px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.footer-link-list {
    list-style: none;
}

.footer-link-list li {
    margin-bottom: 10px;
}

.footer-link-list a {
    color: #94a3b8;
    text-decoration: none;
}

.footer-link-list a:hover {
    color: var(--text-light);
}

.footer-bottom {
    border-top: 1px solid #1e3a5f;
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
    margin-top: 16px;
}


/* ==========================================================================
   DESKTOP MEDIA QUERY (AB 768PX) - REPARIERT JEGLICHE VERZERRUNGEN
   ========================================================================== */
@media (min-width: 768px) {
    h1 { font-size: 36px; }
    h2 { font-size: 28px; }

    .btn { width: auto; }

    /* ALLOW DROPDOWN MENUS TO OVERFLOW HEADER BOUNDS */
    .header { overflow: visible; }

    /* RESET BURGER MENU FOR DESKTOP */
    .menu-button { display: none; }

    .nav-menu {
        position: static;
        display: inline-flex;
        flex-direction: row;
        align-items: center;
        width: auto;
        height: auto;
        padding: 0;
        gap: 24px;
        border-top: none;
        background-color: transparent;
        overflow-y: visible;
    }

    .nav-link {
        padding: 0;
        font-size: 15px;
        border-bottom: none;
        min-height: auto;
        display: inline-block;
    }

    .nav-link:hover {
        color: var(--accent);
    }

    /* DESKTOP DROPDOWN (FLIEGEND STATT VERZERRT) */
    .nav-dropdown {
        position: relative;
        width: auto;
    }

    .nav-dropdown-summary {
        padding: 0 16px 0 0;
        font-size: 15px;
        border-bottom: none;
        min-height: auto;
        display: inline-flex;
        gap: 6px;
    }

    .nav-dropdown-summary::after {
        position: static;
        content: "▼";
    }

    .dropdown-list {
        position: absolute;
        top: calc(100% + 12px);
        left: -16px;
        width: 320px;
        background-color: #ffffff;
        box-shadow: 0 8px 24px rgba(26, 58, 82, 0.15);
        border: 1px solid var(--border-color);
        border-radius: 4px;
        padding: 8px 0;
        display: none;
    }

    .nav-dropdown[open] .dropdown-list {
        display: block;
    }

    .dropdown-list .nav-link {
        display: block;
        padding: 10px 20px;
        font-weight: normal;
        border-bottom: none;
    }

    .dropdown-list .nav-link:hover {
        background-color: var(--background);
        color: var(--primary);
    }

    .nav-phone-btn {
        margin-top: 0;
        padding: 10px 20px;
        min-height: auto;
        width: auto;
    }

    /* GRID REPAIR */
    .hero { padding: 60px 0; }
    .hero-grid-two-col {
        display: grid;
        grid-template-columns: 1.2fr 0.8fr;
        gap: 40px;
        align-items: center;
    }
    .hero-buttons {
        flex-direction: row;
    }

    .grid-stack {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .grid-three-col {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    .split-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .stats-box { gap: 16px; }
    .stat-entry { padding: 16px; }

    .footer-layout-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }
    .footer-section { margin-bottom: 0; }
}

/* DROPDOWN GROUP LABELS */
.dropdown-group-label {
    padding: 10px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    pointer-events: none;
    user-select: none;
    list-style: none;
    border-bottom: none;
}

@media (min-width: 768px) {
    .dropdown-group-label {
        padding: 10px 20px 4px;
        border-top: 1px solid var(--border-color);
        margin-top: 4px;
    }
    .dropdown-list li:first-child.dropdown-group-label {
        border-top: none;
        margin-top: 0;
    }
}

/* ============================================================
   SCROLL ANIMATIONS
   ============================================================ */

/* Transition lives on sa-init — this class is NEVER removed.
   Removing sa-fade-up / sa-fade-scale from a sa-init element triggers
   the transition, because the property change is observed on sa-init. */
.sa-init {
    transition: opacity 0.28s ease-out, transform 0.28s ease-out;
    will-change: opacity, transform;
}

/* Hidden states — only opacity/transform, no transition here */
.sa-fade-up {
    opacity: 0;
    transform: translateY(14px);
}

.sa-fade-scale {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
}

/* Safety net: no animations if JS is absent (sa-init never added → no hiding) */
/* Reduced motion: override to instant show */
@media (prefers-reduced-motion: reduce) {
    .sa-init { transition: none !important; will-change: auto !important; }
    .sa-fade-up, .sa-fade-scale { opacity: 1 !important; transform: none !important; }
}

/* Hero parallax: promote container to own GPU layer */
.hero .container {
    will-change: transform;
}

/* ============================================================
   CONTINUOUS LOOP ANIMATIONS
   GPU-composited (opacity + transform only) for 60fps.
   Keyframes defined outside media queries so they're always parsed.
   ============================================================ */

@keyframes sa-hero-drift {
    0%, 100% { background-position: 0% 50%; }
    50%       { background-position: 100% 50%; }
}

@keyframes sa-float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-5px); }
}

@keyframes sa-glow-cta {
    0%, 100% { box-shadow: 0 2px 8px rgba(232, 116, 59, 0.10); }
    50%       { box-shadow: 0 4px 22px rgba(232, 116, 59, 0.34); }
}

@keyframes sa-glow-whatsapp {
    0%, 100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22); }
    50%       { box-shadow: 0 4px 22px rgba(37, 211, 102, 0.42); }
}

/* Apply only when user has no reduced-motion preference */
@media (prefers-reduced-motion: no-preference) {

    /* Hero: slow gradient drift — 4-stop gradient makes the shift seamless */
    .hero {
        background: linear-gradient(135deg,
            var(--primary)      0%,
            #162f47             38%,
            var(--primary-dark) 65%,
            var(--primary)      100%
        );
        background-size: 260% 260%;
        animation: sa-hero-drift 14s ease-in-out infinite;
    }

    /* Icons: gentle floating, each card offset so they don't sync */
    .icon-vector {
        animation: sa-float 3.8s ease-in-out infinite;
        will-change: transform;
    }
    .card:nth-child(2) .icon-vector { animation-delay: -1.2s; }
    .card:nth-child(3) .icon-vector { animation-delay: -2.5s; }
    .card:nth-child(4) .icon-vector { animation-delay: -0.6s; }

    /* Primary CTA in hero: soft orange glow pulse */
    .hero-buttons .btn:first-child {
        animation: sa-glow-cta 3.4s ease-in-out infinite;
    }

    /* WhatsApp FAB: green glow pulse */
    .whatsapp-float {
        animation: sa-glow-whatsapp 4.2s ease-in-out infinite;
    }
}

/* Mobile: kill loop animations to save battery */
@media (max-width: 767px) {
    .icon-vector { animation: none !important; will-change: auto !important; }
    .hero {
        animation: none !important;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
        background-size: 100% !important;
    }
    .whatsapp-float     { animation: none !important; }
    .hero-buttons .btn  { animation: none !important; }
}

/* ============================================================ */

/* WhatsApp floating button */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-float:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
}

.whatsapp-float svg {
    width: 30px;
    height: 30px;
}

@media (max-width: 768px) {
    .whatsapp-float {
        width: 48px;
        height: 48px;
        bottom: 16px;
        right: 16px;
    }

    .whatsapp-float svg {
        width: 26px;
        height: 26px;
    }
}

/* ==========================================================================
   MOBILE ALIGNMENT & CENTERING FIXES (≤ 767px)
   ========================================================================== */
@media (max-width: 767px) {

    /* HEADER: no gap below; logo + burger icon on same vertically-centred row */
    .header {
        margin-bottom: 0;
    }

    .nav-container {
        display: flex;
        align-items: center;
        padding-top: 0;
        padding-bottom: 0;
    }

    .logo {
        align-self: center;
        flex: 1 1 auto;
        min-width: 0;
    }

    .menu-button {
        align-self: center;
        flex: 0 0 auto;
    }

    /* BUTTONS: true full-width on mobile — remove 320px cap */
    .btn {
        max-width: 100%;
        width: 100%;
    }

    /* HERO: explicit column stack so trust box sits cleanly below CTA text */
    .hero-grid-two-col {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    /* HERO BUTTONS ("Notruf" / "Termin vereinbaren"): stretch to fill column */
    .hero-buttons {
        width: 100%;
        align-items: stretch;
    }

    /* HERO TRUST / INFO BOX (2nd panel): centred content, consistent padding */
    .hero-grid-two-col > div:last-child {
        text-align: center;
        padding: 20px 16px !important; /* override inline padding for mobile */
    }

    /* Keep bullet-list inside the trust box left-aligned for readability */
    .hero-grid-two-col > div:last-child .bullet-list {
        text-align: left;
        display: inline-block;
        width: 100%;
    }

    /* STATS ROW: consistent cell padding; numbers and labels centred */
    .stats-box {
        gap: 0;
        margin-bottom: 24px;
    }

    .stat-entry {
        padding: 10px 6px;
        text-align: center;
    }

    .stat-num {
        font-size: 20px;
    }

    .stat-txt {
        font-size: 11px;
        line-height: 1.3;
    }

    /* GRID-THREE-COL: stack as single column with gaps (no base style defined) */
    .grid-three-col {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    /* SECTION SUBTITLE: reset negative top margin that can clip on narrow screens */
    .section-subtitle {
        margin-top: -8px;
    }

    /* CTA DARK BOX: centre heading and body text on mobile */
    .cta-dark-box {
        text-align: center;
    }

    .cta-dark-box h2 {
        text-align: center;
    }

    /* Centre the accent underline when the heading is centred */
    .cta-dark-box h2::after {
        left: 50%;
        transform: translateX(-50%);
    }

    /* Bullet list inside CTA box stays left-aligned */
    .cta-dark-box .bullet-list {
        text-align: left;
        display: inline-block;
        width: 100%;
    }

    /* STANDALONE CALL BUTTONS outside hero-buttons wrapper */
    .split-layout > div > a.btn,
    .split-layout > div > button.btn {
        display: flex;
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
}
