/* Lokale Inter-Schriften (TTF) */
@font-face {
    font-family: "Inter";
    src: url("../fonts/Inter/Inter-VariableFont_opsz,wght.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
/* =========================================
   DESIGN TOKENS (Custom Properties)
   ========================================= */
:root {
    /* Farben (Brand) */
    --color-primary: #26B3A1; /* Türkis (Außenring) */
    --color-primary-rgb: 38, 179, 161;
    --color-secondary: #0A2540; /* Dunkelblau */
    --color-secondary-rgb: 10, 37, 64;
    --color-accent-1: #3DBDD1; /* Meer */
    --color-accent-2: #F38C2C; /* Orange Sonnenuntergang */
    --color-accent-3: #F4C27A; /* Sand */
    --color-accent-4: #006854; /* Palmengrün */
    --color-accent-5: #5B2C25; /* Palmstamm */
    --color-light: #FFFFFF; /* Weiß */

    /* Neutrals */
    --color-bg: #0f172a;
    --color-bg-2: #1e293b;
    --color-text: #ffffff;
    --color-muted: rgba(255, 255, 255, .7);

    /* Feedback */
    --color-success: var(--color-accent-4);
    --color-warning: var(--color-accent-2);
    --color-danger: #E63946;

    /* Typografie */
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.125rem;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;

    /* Radius & Abstände */
    --radius-sm: .375rem;
    --radius-md: .75rem;
    --radius-lg: 1rem;

    /* Schatten */
    --shadow-sm: 0 4px 10px rgba(0, 0, 0, .08);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, .10);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, .16);

    --nav-height: 64px;

    --bs-modal-zindex: 1100;
    --bs-backdrop-zindex: 1090;
}

@media (min-width: 992px) {
    :root {
        --nav-height: 72px; /* Desktop etwas höher (Logo größer) */
    }
}

/* =========================================
   BOOTSTRAP BRIDGE
   ========================================= */
:root {
    --bs-primary: var(--color-primary);
    --bs-primary-rgb: var(--color-primary-rgb);
    --bs-secondary: var(--color-secondary);
    --bs-secondary-rgb: var(--color-secondary-rgb);

    --bs-body-font-family: var(--font-sans);
    --bs-body-font-size: var(--font-size-base);
    --bs-body-color: #111827;
    --bs-body-bg: #ffffff;

    --bs-border-radius: var(--radius-md);
    --bs-border-radius-sm: var(--radius-sm);
    --bs-border-radius-lg: var(--radius-lg);
}

/* Buttons */
.btn-primary {
    --bs-btn-bg: var(--color-primary);
    --bs-btn-border-color: var(--color-primary);
    --bs-btn-hover-bg: color-mix(in srgb, var(--color-primary) 85%, #000 15%);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--color-primary) 80%, #000 20%);
    --bs-btn-active-bg: color-mix(in srgb, var(--color-primary) 75%, #000 25%);
    --bs-btn-active-border-color: color-mix(in srgb, var(--color-primary) 75%, #000 25%);
}

@supports not (color: color-mix(in srgb, white 50%, black 50%)) {
    .btn-primary {
        --bs-btn-hover-bg: #209889;
        --bs-btn-hover-border-color: #1e8f82;
        --bs-btn-active-bg: #1c8679;
        --bs-btn-active-border-color: #1c8679;
    }
}

.btn-secondary {
    --bs-btn-bg: var(--color-secondary);
    --bs-btn-border-color: var(--color-secondary);
    --bs-btn-hover-bg: color-mix(in srgb, var(--color-secondary) 85%, #000 15%);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--color-secondary) 80%, #000 20%);
    --bs-btn-active-bg: color-mix(in srgb, var(--color-secondary) 75%, #000 25%);
    --bs-btn-active-border-color: color-mix(in srgb, var(--color-secondary) 75%, #000 25%);
}

@supports not (color: color-mix(in srgb, white 50%, black 50%)) {
    .btn-secondary {
        --bs-btn-hover-bg: #091f36;
        --bs-btn-hover-border-color: #091f36;
        --bs-btn-active-bg: #081c30;
        --bs-btn-active-border-color: #081c30;
    }
}

/* ================================
   Root & Sticky Footer
   ================================ */
html, body {
    height: 100%;
}

body {
    min-height: 100vh;
    padding-top: var(--nav-height);
}

/* Weicher Fade für Inhaltswechsel */
#main-content {
    transition: opacity .24s ease;
    will-change: opacity;
}

#main-content.is-loading {
    opacity: .12;
    pointer-events: none;
}

#main-content.is-loading * {
    filter: saturate(.9);
}

@media (prefers-reduced-motion: reduce) {
    #main-content {
        transition: none;
    }
}

/* ================================
   Navbar
   ================================ */
.navbar {
    background: rgba(255, 255, 255, .75) !important;
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    box-shadow: var(--shadow-md);
    transition: background .18s ease, box-shadow .18s ease, padding .25s ease, min-height .25s ease;
    min-height: var(--nav-height);
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    z-index: 1070; /* über Content, unter Progress-Bar */
}

/* Logo in Navbar */
.navbar-brand-logo {
    height: 52px;
    width: auto;
    object-fit: contain;
    transition: height .25s ease;
}

@media (min-width: 992px) {
    .navbar-brand-logo {
        height: 58px;
    }
}

/* Schrumpf-Variante bei Scroll */
.navbar.navbar-solid {
    padding-top: .25rem;
    padding-bottom: .25rem;
    min-height: calc(var(--nav-height) - 12px);
}

.navbar.navbar-solid .navbar-brand-logo {
    height: 40px;
}

@media (min-width: 992px) {
    .navbar.navbar-solid .navbar-brand-logo {
        height: 46px;
    }
}

@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
    .navbar {
        background: rgba(255, 255, 255, .95) !important;
    }
}

.navbar.navbar-solid {
    background: rgba(255, 255, 255, .95) !important;
    box-shadow: var(--shadow-lg);
    border-bottom-color: rgba(0, 0, 0, .08);
}

/* Dropdown-Menü über Content, unter Progress-Bar */
.dropdown-menu {
    z-index: 1075;
}

/* Scroll-Offset für Anker */
[id] {
    scroll-margin-top: var(--nav-height);
}

/* ================================
   Fokus
   ================================ */
:focus-visible {
    outline: 3px solid rgb(var(--color-primary-rgb));
    outline-offset: 2px;
}

/* ================================
   Carousel
   ================================ */
.carousel-item img {
    width: 100%;
    height: 48vh;
    object-fit: cover;
    image-rendering: auto;
}

@media (min-width: 992px) {
    .carousel-item img {
        height: 68vh;
    }
}

.carousel.carousel-fade .carousel-item {
    transition: opacity .6s ease;
}

@media (prefers-reduced-motion: reduce) {
    .carousel.carousel-fade .carousel-item {
        transition: none;
    }
}

/* ================================
   Bewegungen reduzieren
   ================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}

/* ================================
   Footer
   ================================ */
footer {
    background: linear-gradient(to bottom, var(--color-bg-2), var(--color-bg));
    font-size: .95rem;
}

footer a {
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ================================
   Top Progress Bar
   ================================ */
#top-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent-1));
    box-shadow: 0 0 12px rgba(var(--color-primary-rgb), .35);
    z-index: 1080; /* über Navbar & Dropdowns */
    transition: width .18s ease, opacity .18s ease;
    opacity: 0;
}

#top-progress.is-active {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    #top-progress {
        transition: none;
    }
}

/* ================================
   Tabellen / Sections
   ================================ */
.table th, .table td {
    vertical-align: middle;
}

.table tbody tr td:first-child {
    white-space: nowrap;
}

section.container > h1 {
    letter-spacing: .2px;
}

section.container .lead {
    color: rgba(0, 0, 0, .72);
}

/* ================================
   Hilfsklassen
   ================================ */
.shadow-soft {
    box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
}

figure figcaption {
    font-size: .85rem;
    line-height: 1.4;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: "";
    position: absolute;
    left: .5rem;
    top: .25rem;
    bottom: .25rem;
    width: 2px;
    background: rgba(0, 0, 0, .08);
}

.timeline-item {
    position: relative;
    padding-left: 1rem;
    margin: .75rem 0;
}

.timeline-dot {
    position: absolute;
    left: 0;
    top: .2rem;
    width: .75rem;
    height: .75rem;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(38, 179, 161, .15);
}

.timeline-content {
    padding-left: .5rem;
}

/* ================================
   Hero / Slideshow Wrapper
   ================================ */
.hero-under-nav {
    margin-top: calc(var(--nav-height) * -1);
    position: relative;
    z-index: 1;
}

.hero-under-nav .carousel {
    padding-top: .25rem;
}

.hero-under-nav .carousel-indicators {
    margin-bottom: .75rem;
}

.hero-under-nav {
    will-change: transform;
}

.parallax img {
    transform: translateY(0);
    transition: transform .12s linear;
}

@media (prefers-reduced-motion: reduce) {
    .parallax img {
        transform: none !important;
    }
}

/* Ausgangszustand */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .45s ease, transform .45s ease;
}

.reveal.is-inview {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        transition: none;
    }
}

/* Scroll-to-Top FAB */
.scroll-top-btn {
    position: fixed;
    right: 1rem;
    bottom: 1.25rem;
    width: 48px;
    height: 48px;
    z-index: 1060;


    padding: 0;
    line-height: 1;
    font-size: 1.1rem;
}

.scroll-top-btn i {
    pointer-events: none; /* klicks gehen durch */
}

/* ================================
   Abdeckungen-Übersicht: einheitliche Karten-Bildhöhe
   ================================ */
.home-heizungen .card-img-top,
.home-abdeckungen .card-img-top,
.heizungen-grid .card-img-top,
.abdeckungen-grid .card-img-top,
.technik-grid .card-img-top,
.wasseraufbereitung-grid .card-img-top,
.wellness-grid .card-img-top{
    /* moderne Lösung: feste Seitenratio + Zuschnitt */
    aspect-ratio: 16 / 10;
    width: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.wasseraufbereitung-grid .card-img-top,
.wellness-grid .card-img-top {
    object-fit: contain;
}

/* Kleinere Carousels in der Wellness-Rubrik */
.wellness-carousel .carousel-item img {
    height: auto;
    max-height: 360px;
    width: 100%;
    object-fit: contain;
}

/* Fallback für sehr alte Browser ohne aspect-ratio */
@supports not (aspect-ratio: 1) {
    .home-heizungen .card-img-top,
    .home-abdeckungen .card-img-top,
    .heizungen-grid .card-img-top,
    .abdeckungen-grid .card-img-top {
        height: 220px;
    }

    @media (min-width: 768px) {
        .home-heizungen .card-img-top, .heizungen-grid .card-img-top,.home-abdeckungen .card-img-top, .abdeckungen-grid .card-img-top {
            height: 240px;
        }
    }
    @media (min-width: 1200px) {
        .home-heizungen .card-img-top, .heizungen-grid .card-img-top,.home-abdeckungen .card-img-top, .abdeckungen-grid .card-img-top {
            height: 260px;
        }
    }
}


/* =========================================
   Feature-Matrix: bessere Lesbarkeit + Mobile-Stack
   ========================================= */
/* Mobile: Header ausblenden, jede Zeile als Kartenblock */
@media (max-width: 767.98px) {
    .matrix-table thead {
        display: none;
    }

    .matrix-table,
    .matrix-table tbody,
    .matrix-table tr,
    .matrix-table td {
        display: block;
        width: 100%;
    }

    .matrix-table tr {
        margin: 0 0 1rem 0;
        padding: .75rem .75rem .25rem;
        border: 1px solid rgba(0, 0, 0, .075);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
        background: #fff;
    }

    /* Kriterium-Titel (1. Zelle) bleibt Kopf der Karte */
    .matrix-table tr > td:first-child {
        font-weight: 600;
        padding-bottom: .35rem;
        border-bottom: 1px solid rgba(0, 0, 0, .06);
        margin-bottom: .5rem;
    }

    /* Übrige Zellen: 2-spaltiges Grid (Label | Wert) */
    .matrix-table td {
        display: grid;
        grid-template-columns: 12rem 1fr; /* Label-Spalte | Wert */
        gap: .5rem .75rem;
        align-items: start;
        padding: .35rem 0;
        border: 0 !important;
        word-break: break-word;
        overflow-wrap: anywhere;
        hyphens: auto;
    }

    .matrix-table td::before {
        content: attr(data-label);
        grid-column: 1;
        font-size: .92rem;
        color: #6b7280;
        font-weight: 500;
        line-height: 1.35;
    }

    /* Der eigentliche Zelleninhalt (per JS umspannt) */
    .matrix-table td > .cell-value {
        grid-column: 2;
        min-width: 0; /* erlaubt Zeilenumbruch in sehr langen Wörtern */
    }
}

/* Sehr kleine Screens: Label oben, Wert darunter (einspaltig) */
@media (max-width: 420px) {
    .matrix-table td {
        grid-template-columns: 1fr;
    }

    .matrix-table td::before {
        grid-column: 1;
        margin-bottom: .15rem;
    }

    .matrix-table td > .cell-value {
        grid-column: 1;
    }
}

@media (min-width: 768px) {
    .matrix-table td, .matrix-table th {
        padding: .55rem .6rem;
    }
}

/* Portfolio: Kartenbild */
.portfolio-grid .card-img-top{
    aspect-ratio: 16 / 10;
    width: 100%;
    object-fit: cover;
    display: block;
}

/* Fallback falls Variablen nicht greifen */
.modal{ z-index:1100; }
.modal-backdrop{ z-index:1090; }

/* Google Maps Consent Overlay */
.maps-overlay{
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    padding: .75rem;
}

.maps-consent-box{
    width:100%;
    max-width: 520px;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255,255,255,.92);
    box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.08);
    text-align:center;

    /* falls es bei sehr kleinen Viewports doch zu hoch wird */
    max-height: 100%;
    overflow:auto;
}

/* Auf größeren Screens etwas mehr Luft */
@media (min-width: 768px){
    .maps-overlay{ padding: 1.25rem; }
    .maps-consent-box{ padding: 1.25rem; }
}