* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --header-h: 72px;
}

body {
    font-family: system-ui, sans-serif;
    color: black;
}

/* ======== Header ======== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    z-index: 100;
    /* Optimierter Glaseffekt */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px) saturate(140%);
    -webkit-backdrop-filter: blur(6px) saturate(140%);
}

.container {
    max-width: 1100px;
    margin: auto;
    padding: 0 16px;
    height: 100%;
}

.header-grid {
    display: grid;
    /* Logo | Socials | Navigation | Burger */
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    height: 100%;
}

/* Logo */
.logo-img {
    height: 60px;
}

/* Icons */
.top-links {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 25px;
    justify-self: center;
}

.t-l {
    text-decoration: none;
    color: black;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.t-l svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    display: block;
}

/* Navigation Desktop */
.nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.menu {
    display: flex;
    list-style: none;
    gap: 24px;
}

.menu-link {
    text-decoration: none;
    color: black;
    font-weight: 500;
    padding: 22px 0;
    font-size: 1.2rem;
}

.menu-item {
    position: relative;
}

/* Dropdown Glaseffekt */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 150px;
    list-style: none;
    display: none;
    border-radius: 14px;
    margin-top: 5px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

.menu-item:hover .dropdown {
    display: block;
}

.dropdown a {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: black;
}

.dropdown a:hover {
    color: #d30000;
    background: white;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* PopUp Telefon */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    /* Modal Hintergrund abdunkeln */
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.4s ease-out;
}

@keyframes modalFadeIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* X-Button zum Schließen */
.close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #aaa;
    font-size: 52px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.3s, transform 0.2s;
    z-index: 1000;
}

.close-modal:hover {
    color: #d30000;
    transform: scale(1.2);
}

.phone-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: #d30000;
    margin: 20px 0;
}

.btn-call {
    display: inline-block;
    padding: 12px 25px;
    background: #d30000;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
}

/* ======== Burger Menü ======== */
.nav-toggle {
    display: none;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 10px;
    height: 44px;
    width: 44px;
    position: relative;
}

.hamburger {
    display: block;
    width: 28px;
    height: 2px;
    background: black;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: "";
    position: absolute;
    left: 0;
    width: 28px;
    height: 2px;
    background: #222;
    transition: all 0.3s;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

/* Animation zum X */
.nav-toggle.active .hamburger {
    background: transparent;
}

.nav-toggle.active .hamburger::before {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active .hamburger::after {
    transform: translateY(-8px) rotate(-45deg);
}

/* ======== Hero ======== */
.hero {
    height: 70vh;
    position: relative;
}

.hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    /* Text am unteren Ende ausrichten */
    justify-content: center;
    padding-bottom: 40px;
    /* Abstand zum unteren Rand */
}

.hero-content h1 {
    color: white;
    font-size: 3.5rem;
    font-weight: bold;
    text-shadow: 0 4px 2px rgba(0, 0, 0, 0.3);
    animation: fadeUp 1.8s ease-out forwards;
    opacity: 0;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ======== Hauptcontainer Inhalt ======== */
.page {
    max-width: 1100px;
    margin: 50px auto;
    /* Abstand zum Hero und Zentrierung */
    padding: 0 16px;
    /* Gleiches Padding wie im Header */
}

/* Einzelne Sektionen */
.section {
    margin-bottom: 80px;
    /* Großzügiger Abstand zwischen den Themen */
    line-height: 1.6;
    /* Bessere Lesbarkeit */
    opacity: 0;
    transform: translateY(20px);
    transition: all 1.4s ease-out;
}

/* Überschriften in den Sektionen */
.section h2 {
    font-size: 2rem;
    margin-bottom: 24px;
    padding-bottom: 8px;
    /* Abstand zum Strich */
    display: inline-block;
    border-bottom: 3px solid #d30000;
}

.section h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    display: inline-block;
    border-bottom: 3px solid #d30000;
}

/* Textabsätze */
.section p {
    color: #444;
    /* Etwas weicheres Schwarz für längere Texte */
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    max-width: 850px;
    /* Verhindert zu lange, schwer lesbare Zeilen */
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ------ Öffnungszeiten ------ */
.schedule-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    gap: 30px;
    margin-top: 10px;
}

.time-block {
    padding: 20px;
}

.row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    gap: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.row.accent {
    color: #d30000;
    font-weight: 600;
}

.section .note {
    max-width: 100%;
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
    color: #666;
}

/* ------ IBW Logo ------ */

.logo-section {
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.responsive-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.responsive-img:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

/* ------ Partner Logos ------ */
.partner-grid {
    display: flex;
    justify-content: space-around;
    /* Verteilt die Logos gleichmäßig */
    align-items: center;
    gap: 20px;
    /* Abstand zwischen den Logos */
}

.partner-link {
    flex: 1;
    /* Jedes Logo bekommt gleich viel Platz */
    display: flex;
    justify-content: space-around;
}

.partner-link img {
    max-width: 100%;
    height: auto;
    max-height: 180px;
    /* Hält alle Logos auf einer harmonischen Höhe */
    object-fit: contain;
    /* Verhindert Verzerrungen */
    transition: filter 0.3s ease, transform 0.3s ease;
}

.partner-link img:hover {
    transform: scale(1.1);
}

/* ======== Team ======== */
.team-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.team-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 25px;
    border: 1px solid rgba(211, 0, 0, 0.1);
    border-radius: 14px;
    transition: transform 0.2s ease;
}

.team-item:hover {
    background: rgba(211, 0, 0, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transform: translateX(5px);
}

.member-info h4 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.member-info .role-main {
    font-size: 1.1rem;
    color: #666;
}

.member-details {
    list-style: none;
    margin-top: 12px;
}

.member-details li {
    position: relative;
    padding-left: 15px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #444;
}

.member-details li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #d30000;
    font-weight: bold;
}

/* ======== Impressum ======== */

.imprint-link {
    color: #d30000;
    text-decoration: none;
    font-weight: 500;
}

.info-text {
    color: #666;
    font-size: 0.9rem;
    margin-left: 5px;
}

.footer {
    border-top: 1px solid #d30000;
    color: #888;
    font-size: 0.9rem;
    text-align: center;
    padding-top: 8px;
}

.datensch {
    list-style: disc;
    padding-left: 20px;
    color: #444;
    margin: 6px;
}

/* ======== Standorte ======== */
.locations-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 30px;
    margin-top: 30px;
}

.location-card {
    /* flex-grow: 1 (darf wachsen) | flex-shrink: 1 (darf schrumpfen) | flex-basis: 48% */
    flex: 1 1 310px;
    max-width: 400px;
    /* Damit sie auf riesigen Bildschirmen nicht zu breit werden */
    padding: 30px;
    background: white;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    text-align: center;
}

.location-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    transform: translateY(-5px);
}

.location-icon {
    margin-bottom: 10px;
}

.location-icon svg {
    width: 60px;
    height: 60px;
    fill: #d30000;
}

.location-card address {
    font-style: normal;
    line-height: 1.6;
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #444;
}

.button-route {
    display: inline-block;
    padding: 12px 25px;
    background: #d30000;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: bold;
    transition: background 0.3s ease;
}

.button-route:hover {
    background: red;
}

.location-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* Abstand zwischen Icon und Nummer */
    margin-top: 8px;
    /* Abstand nach oben zur Adresse */
    text-decoration: none;
    color: inherit;
    /* Übernimmt die Textfarbe der Adresse */
    font-weight: 500;
    transition: color 0.3s;
}

.location-phone:hover {
    color: #d30000;
}

.phone-svg,
.email-svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Foto-Galerie unter Standorten */
.gallery,
.gallery2 {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    align-items: flex-start;
    gap: 10px;
}

.gallery img {
    width: 525px;
    max-width: 100%;
    cursor: pointer;
    border-radius: 16px;
    transition: transform 0.3s;
}

/* Foto-Galerie unter Oldtimer */
.gallery2 img {
    /*(100% / Bilderanzahl) - (Abzug für die Lücken) */
    flex: 1 1 calc(33.333% - 10px);
    /* Mindestbreite, ab der umgebrochen wird */
    min-width: 250px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    cursor: pointer;
    border-radius: 16px;
    transition: transform 0.3s;
}

.gallery img:hover,
.gallery2 img:hover {
    transform: scale(1.02);
}

.fullscreen {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.fullscreen.active {
    display: flex;
}

.fullscreen img {
    width: auto;
    height: auto;
    max-width: 98vw;
    max-height: calc(98vh - 20px);
    object-fit: contain;
    border-radius: 24px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
}

@keyframes galleryZoomIn {
    from {
        opacity: 0;
        transform: scale(0.6);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fullscreen.active img {
    animation: galleryZoomIn 0.3s ease-out;
}

.fullscreen.active {
    display: flex;
    animation: fadeInBackground 0.3s ease-out;
}

@keyframes fadeInBackground {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.caption-container {
    margin-top: 6px;
    color: antiquewhite;
    text-align: center;
    word-break: break-word;
    max-width: 90%;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 48px;
    color: lightgray;
    cursor: pointer;
    user-select: none;
    padding: 10px;
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

/* ======== Leistungen ======== */
.leistungen_list {
    list-style: none;
    margin-top: 12px;
}

.leistungen_list li {
    opacity: 0;
    transform: scale(0.5) translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    position: relative;
    padding-left: 20px;
    margin-bottom: 15px;
    line-height: 1.4;
    color: #444;
}

.leistungen_list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #d30000;
    font-weight: bold;
}

.leistungen_list li.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.leistungen_list li:nth-child(1) {
    transition-delay: 0.1s;
}

.leistungen_list li:nth-child(2) {
    transition-delay: 0.2s;
}

.leistungen_list li:nth-child(3) {
    transition-delay: 0.3s;
}

.leistungen_list li:nth-child(4) {
    transition-delay: 0.4s;
}

.leistungen_list li:nth-child(5) {
    transition-delay: 0.5s;
}

.leistungen_list li:nth-child(6) {
    transition-delay: 0.6s;
}

.leistungen_list li:nth-child(7) {
    transition-delay: 0.7s;
}

.leistungen_list li:nth-child(8) {
    transition-delay: 0.8s;
}

.leistungen_list li:nth-child(9) {
    transition-delay: 0.9s;
}

.leistungen_list li:nth-child(10) {
    transition-delay: 1.0s;
}

.leistungen_list li:nth-child(11) {
    transition-delay: 1.1s;
}

.leistungen_list li:nth-child(12) {
    transition-delay: 1.2s;
}

.leistungen_list li:nth-child(13) {
    transition-delay: 1.3s;
}

/* ======== Gutachten ====== */

.accident-container {
    display: flex;
    flex-wrap: wrap;
    max-width: 750px;
    justify-content: space-around;
    gap: 10px 25px;
}

.accident-item {
    display: flex;
    align-items: center;
    font-size: 1.3rem;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    font-weight: 500;
    transition: all 0.4s ease;
}

/* Hover-Effekt nur für Geräte mit Maus */
@media (hover: hover) {

    .t-l:hover {
        color: #d30000;
        transform: translateY(-4px);
        background: rgba(255, 255, 255, 0.4);
        border-color: rgba(211, 0, 0, 0.5);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .accident-item:hover {
        color: #d30000;
        transform: translateY(-3px);
    }
}

/* ======== Mobile Ansicht ======== */
@media (max-width: 950px) {

    html,
    body {
        overflow-x: hidden;
        width: 100%;
    }

    .header-grid {
        display: grid;
        /* Logo links | Icons mitte | Burger rechts */
        grid-template-columns: auto 1fr auto;
        align-items: center;
        justify-items: stretch;
        gap: 0;
    }

    .logo-img {
        height: 50px;
    }

    .top-links {
        margin: 0 auto;
        gap: 8px;
    }

    .t-l {
        width: 36px;
        height: 36px;
    }

    .t-l svg {
        width: 20px;
        height: 20px;
    }

    .nav {
        position: fixed;
        top: var(--header-h);
        right: 0;
        width: 280px;
        max-width: 80vw;
        height: auto;
        max-height: 90vh;
        background: rgba(255, 255, 255, 0.8);
        border-radius: 12px 0 0 12px;
        flex-direction: column;
        justify-content: flex-start;
        padding: 25px;
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.3s ease-in-out, visibility 0.3s ease;
        box-shadow: -10px 0 20px rgba(0, 0, 0, 0.6);
        z-index: 100;
        overflow-y: auto;
    }

    .nav.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .nav-toggle {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .menu {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .menu-link {
        display: block;
        padding: 12px 0;

    }

    .menu-item.has-dropdown .dropdown {
        position: static;
        /* Hebt die absolute Positionierung auf */
        display: none;
        /* Wird per JS 'open' Klasse gesteuert */
        width: 100%;
        min-width: 100%;
        background: transparent;
        border: none;
        box-shadow: none;
        margin-top: 0;
        padding-left: 15px;
    }

    .menu-item.open .dropdown {
        display: block;
    }

    .page {
        margin: 20px auto;
    }

    .section {
        margin-bottom: 40px;
    }

    .hero {
        height: 40vh;
        min-height: 250px;
    }

    .hero-img {
        z-index: -1;
    }

    .hero-content h1 {
        font-size: 1.8rem;
        line-height: 1.2;
        padding: 0 10px;
    }

    .close-modal {
        right: 20px;
        font-size: 36px;
    }

    .schedule-grid {
        gap: 15px;
    }

    .section h2 {
        font-size: 1.4rem;
    }

    .section h3 {
        font-size: 1.2rem;
    }

    .time-block {
        padding: 0px;
    }

    .row {
        font-size: 0.8rem;
        gap: 5px;
    }

    .section .note {
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    .team-list {
        gap: 10px;
        margin-top: 10px;
    }

    .partner-grid {
        flex-wrap: wrap;
        /* Erlaubt das Umbrechen in neue Zeilen */
        justify-content: center;
    }

    .partner-link {
        flex: 1 1 220px;
        /* mindestens 220px breit, bevor Umbruch */
        max-width: 100%;
    }

    .partner-link img {
        max-height: 100px;
    }

    .accident-item {
        font-size: 1.1rem;
    }
}