/* Basis Einstellungen für das Layout */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    scroll-behavior: smooth;
    overflow-x: hidden;
    font-size: 18px; /* Increase base font size */
    line-height: 1.6; /* Improve readability */
    color: #333; /* Set a default text color */
    transition: font-size 0.5s ease, color 0.5s ease; /* Add transition for smooth build-up */
}

/* Keyframes */
@keyframes fadeInDown {
    from {
        opacity: 0;
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomInOut {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes fadeEffect {
    from {opacity: 0.4}
    to {opacity: 1}
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideDownFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes revealFromTop {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 1000px; /* Adjust as needed */
        opacity: 1;
    }
}

/* Top Bar (Header) Styling */
header {
    background: linear-gradient(45deg, #002244, #005096); /* Navbar blue tones */
    color: #ffffff;
    padding: 20px; /* Increase padding */
    position: fixed;
    width: 100%;
    z-index: 1000;
    transition: background 0.5s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: fadeInDown 1s ease-in-out; /* Fade-In Animation */
    top: 0;
    left: 0;
    right: 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 20px; /* Adjust padding */
}

header .logo img {
    max-width: 100%;
    height: 70px; /* Increase logo height */
    animation: fadeInLeft 1.5s ease-in-out; /* Fade-In von links */
    transition: none; /* Prevent size change on burger menu toggle */
}

header .logo .fulllogo {
    width: auto; /* Ensure the logo size remains consistent */
    height: 65px; /* Set a fixed height */
}

header .logo .smalllogo {
    display: none;
}

/* Navigation Styling */
nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
    margin: 0;
    padding-right: 50px; /* Adjust padding */
    padding-top: 10px;
    animation: fadeInRight 1.5s ease-in-out; /* Fade-In von rechts */
}

nav ul.active {
    display: flex;
    flex-direction: column; /* Ensure the menu items stack vertically */
    background: linear-gradient(45deg, #002244, #005096); /* Match the header background */
    position: absolute;
    top: 100%; /* Position directly below the navbar */
    width: 100%;
    left: 0;
    padding: 0;
    margin: 0;
    z-index: 999; /* Ensure the dropdown appears behind the normal nav bar */
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 0;
}

nav ul.active.show {
    transform: translateY(0); /* Slide down from the top */
    opacity: 1;
}

nav ul li {
    display: flex;
    align-items: center;
    width: 100%; /* Ensure full width for each menu item */
}

nav ul li a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 700;
    padding: 10px 20px;
    transition: background 0.3s, color 0.3s;
    border-radius: 5px;
    display: flex;
    align-items: center;
    width: 100%; /* Ensure full width for each link */
    animation: fadeIn 1.8s ease-in-out; /* Allgemeine Fade-In Animation */
    font-size: 1.1em; /* Increase font size */
}

nav ul li a i {
    margin-right: 8px;
}

nav ul li a:hover {
    background: none; /* Remove background change */
    color: #ffffff;
    transform: scale(1.1) translateY(-2px); /* Enlarge and elevate text */
    transition: transform 0.3s ease, color 0.3s ease; /* Smooth transition */
}

/* New hover animation for burger menu */
nav ul.active li a:hover {
    background: rgba(0, 87, 179, 0.24); /* Light blue background */
    color: #ffffff; /* Match navbar blue */
    transform: translateX(10px); /* Slide text to the right */
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease; /* Smooth transition */
}

/* Icons for Navigation Items */
nav ul li a.home i::before {
    font-weight: 900;
}

nav ul li a.about i::before {
    content: "\f0c0"; /* Font Awesome Info Circle Icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

nav ul li a.projects i::before {
    content: "\f52b"; /* Font Awesome Tasks Icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

nav ul li a.funeral i::before {
    content: "\f654"; /* Font Awesome Cross Icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

nav ul li a.contact i::before {
    content: "\f095"; /* Font Awesome Phone Icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

nav ul li a.about {
    position: relative;
}

/* Burger Menu Styling */
.burger-menu {
    display: none; /* Hide by default */
    cursor: pointer;
    z-index: 1001; /* Ensure the burger menu is above other elements */
    transition: transform 0.3s ease-in-out; /* Smooth transition for the burger menu */
}

.hamburger .line {
    width: 30px; /* Further adjust width for smaller screens */
    height: 3px; /* Further adjust height for smaller screens */
    background-color: #ecf0f1;
    display: block;
    margin: 5px auto; /* Further adjust margin for smaller screens */
    transition: all 0.3s ease-in-out;
}

.hamburger:hover {
    cursor: pointer;
}

#hamburger-1.is-active .line:nth-child(2) {
    opacity: 0;
}

#hamburger-1.is-active .line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

#hamburger-1.is-active .line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Prevent burger menu from jumping out of the screen on hover */
.burger-menu:hover {
    transform: none;
}

/* Hero Section */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center; /* Center content */
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #002244, #005096); /* Gradient background */
    text-align: center; /* Center text */
    animation: fadeInUp 1s ease-in-out; /* Fade-In from bottom */
    padding: 0 20px; /* Add padding */
}

.hero-image {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    animation: zoomInOut 15s infinite;
    z-index: 1;
}

/* Hero Content */
.hero-content {
    position: absolute;
    top: 50%;
    left: 50%; /* Zentriert horizontal */
    transform: translate(-50%, -50%); /* Zentriert vertikal und horizontal */
    color: #ffffff;
    max-width: 800px; /* Increase max width */
    text-align: center; /* Text zentriert ausrichten */
    z-index: 10;
    animation: fadeIn 2s ease-in-out;
}

.hero-content h2 {
    font-size: 2rem; /* Increase font size */
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    animation: fadeInLeft 2s ease-in-out;
}

.hero-content h1 {
    font-size: 6rem; /* Increase font size */
    font-family: 'Lato', serif;
    font-weight: 900;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px; /* Leichter Abstand für Text */
    line-height: 1.2;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
    animation: fadeInRight 2.5s ease-in-out;
}

.hero-buttons {
    display: flex;
    justify-content: center; /* Buttons zentriert ausrichten */
    gap: 15px; /* Abstand zwischen den Buttons */
    flex-wrap: wrap;
    margin-top: 50px; /* Abstand nach oben */
    animation: fadeInUp 2.5s ease-in-out;
}

.btn {
    padding: 15px 30px; /* Increase padding */
    border-radius: 25px; /* Weniger runde Ecken */
    font-size: 1.2em; /* Increase font size */
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
    text-align: center;
    animation: fadeInUp 3s ease-in-out;
}

.btn.primary {
    background-color: #005096; /* Match navbar blue */
    color: #ffffff; /* Weißer Text */
    font-weight: 700; /* Fettgedruckter Text */
    text-transform: uppercase; /* Großbuchstaben */
    letter-spacing: 1px; /* Leichter Abstand für Text */
    transition: transform 0.3s ease-in-out; /* Weicher Übergang für Transformation */
}

.btn.primary:hover {
    background-color: #003d80; /* Match navbar blue */
    transform: scale(1.05); /* Leichtes Vergrößern bei Hover */
}

.btn.secondary {
    background-color: transparent; /* Kein Hintergrund */
    color: #005096; /* Match navbar blue */
    border: 2px solid #005096; /* Match navbar blue */
    font-weight: 700; /* Fettgedruckter Text */
    transition: transform 0.3s ease-in-out; /* Weicher Übergang für Transformation */
}

.btn.secondary:hover {
    background-color: rgba(0, 86, 179, 0.1); /* Match navbar blue */
    transform: scale(1.05); /* Leichtes Vergrößern bei Hover */
}

.scroll-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    animation: bounce 2s infinite;
    font-size: 1.5rem; /* Increase the size */
}

.scroll-indicator .scroll-down i {
    color: rgba(255, 255, 255, 0.8);
}

/* Banner Section */
.banner-section {
    padding: 60px 20px; /* Increase padding */
    background: linear-gradient(135deg, #f7f7f7, #ffffff); /* Gradient background */
    text-align: center;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease, transform 1s ease;
    z-index: 10;
}

.banner-section.active {
    opacity: 1;
    transform: translateY(0);
}

.banner-title {
    font-size: 3rem; /* Increase font size */
    font-family: 'Lato', Arial, sans-serif;
    color: #1c1c1e; /* Dunkleres Grau für den Text */
    margin-bottom: 50px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}

.banner-title.active {
    opacity: 1;
    transform: translateY(0);
}

.banner-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 50px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}

.banner-grid.active {
    opacity: 1;
    transform: translateY(0);
}

.banner-item {
    max-width: 350px; /* Increase max width */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    text-align: center;
}

.banner-item.active {
    opacity: 1;
    transform: translateY(0);
}

.banner-icon {
    font-size: 60px; /* Increase icon size */
    color: #005096; /* Match navbar blue */
    margin-bottom: 15px;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 1s ease, transform 1s ease;
}

.banner-item.active .banner-icon {
    opacity: 1;
    transform: scale(1);
}

.banner-item h3 {
    font-size: 1.8em; /* Increase font size */
    color: #1c1c1e; /* Dunkleres Grau für die Titel */
    margin-bottom: 10px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

.banner-item.active h3 {
    opacity: 1;
    transform: translateY(0);
}

.banner-item p {
    font-size: 1.1em; /* Increase font size */
    color: #636366; /* Dunkleres Grau für den Text */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

.banner-item.active p {
    opacity: 1;
    transform: translateY(0);
}

/* Über Uns Section */
.about-us {
    background: #f0f0f0;
    padding: 60px 20px;
    color: #333;
    font-family: 'Arial', sans-serif;
    text-align: center; /* Center text */
    position: relative; /* Ensure relative positioning for animations */
    overflow: hidden; /* Hide overflow for animations */
}

.about-us-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center; /* Center content */
    position: relative; /* Ensure relative positioning for animations */
}

.about-text {
    flex: 1 1 45%;
    text-align: left; /* Align text to the left */
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.about-text.active {
    opacity: 1;
    transform: translateY(0);
}

.about-text h2 {
    font-size: 2.5rem;
    color: #005096;
    margin-bottom: 20px; /* Add margin */
}

.about-text p {
    line-height: 1.8;
    margin-bottom: 20px;
    transition: color 0.8s ease-out;
    display: inline-block;
    opacity: 0;
    animation: fadeInLetter 0.05s forwards;
}

.about-text p span {
    display: inline-block;
    opacity: 0;
    animation: fadeInLetter 0.05s forwards;
}

@keyframes fadeInLetter {
    to {
        opacity: 1;
    }
}

.about-text p.active span {
    animation-delay: calc(0.03s * var(--char-index)); /* Adjust delay to fit within 3 seconds */
}

.button {
    display: inline-block;
    padding: 12px 25px;
    background-color: #005096;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s ease;
    display: flex; /* Use flexbox for centering */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    gap: 10px; /* Add gap between icon and text */
}

.button:hover {
    background-color: #003d80;
}

.about-images {
    flex: 1 1 50%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.about-images.active {
    opacity: 1;
    transform: translateY(0);
}

.image-large {
    grid-column: span 2;
    width: 100%;
    height: auto;
    border-radius: 15px;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.image-small {
    width: 100%;
    height: auto;
    border-radius: 15px;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.about-images img {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.about-images img.active {
    opacity: 1;
    transform: scale(1);
}

.about-images img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.about-us .section-title {
    font-size: 3em;
    margin-bottom: 60px;
    font-family: 'Lato', sans-serif;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    color: #1c1c1e; /* Dunkleres Grau für modernen Kontrast */
    text-align: center;
    position: relative;
    padding-bottom: 20px;
}

.about-us .section-title::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background: #005096; /* Match navbar blue */
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.about-us .section-title.active {
    opacity: 1;
    transform: translateY(0);
}

/* Leistungen Section */
#leistungen {
    padding: 100px 20px;
    background-color: #f0f0f0; /* Helleres Grau passend zum Stil der Seite */
    text-align: center;
    position: relative;
    overflow: hidden;
}

.section-title {
    font-size: 3em;
    margin-bottom: 60px;
    font-family: 'Lato', sans-serif;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    color: #1c1c1e; /* Dunkleres Grau für modernen Kontrast */
    text-align: center;
    position: relative;
    padding-bottom: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background: #005096; /* Match navbar blue */
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.section-title.active {
    opacity: 1;
    transform: translateY(0);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    opacity: 1; /* Initial auf 1 setzen, um sicherzustellen, dass das Grid angezeigt wird */
    transform: scale(1); /* Initial auf 1 setzen */
}

.service-card {
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); /* Dezenter Schatten für einen hochwertigen Look */
    overflow: hidden;
    transform: translateY(30px);
    opacity: 0;
    transition: transform 1.5s ease-out, opacity 1.5s ease-out, box-shadow 1.5s ease; /* Slow down the transition */
    position: relative;
    max-width: 600px; /* Increase the width */
    height: 400px; /* Increase the height */
    max-height: 400px; /* Adjust max height */
}

.service-card.active {
    opacity: 1;
    transform: translateY(0);
}

/* Ensure hover effects are also triggered by touch events on mobile devices */
@media (hover: none) {
    .service-card:active, .service-card:focus {
        transform: translateY(-10px);
        box-shadow: 0 15px 25px rgba(0, 0, 0, 0.3);
    }

    .service-card:active .service-content h3, .service-card:focus .service-content h3 {
        transform: translateY(-20px);
    }

    .service-card:active .service-content p, .service-card:focus .service-content p {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }

    .service-card:active .more-info-button, .service-card:focus .more-info-button {
        display: flex;
    }
}

.service-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.6s ease; /* Verlängerte Übergangszeit für ein weiches Erscheinen */
}

.service-card:hover::before {
    opacity: 0.6;
}

.service-card:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15); /* Stärkerer Schatten bei Hover für einen "Schwebe"-Effekt */
    transform: translateY(-10px);
    transition: transform 1.5s ease-out, box-shadow 1.5s ease; /* Slow down the transition */
}

.service-card img {
    transition: transform 0.6s ease;
    background-repeat: no-repeat; /* Prevent background image from repeating */
    background-position: center; /* Center the background image */
}

.service-card:hover img {
    transform: none; /* Prevent image size change on hover */
}

.service-content {
    position: relative;
    z-index: 2;
    color: #1c1c1e; /* Dunklere Textfarbe passend zur Seite */
    padding: 20px;
    text-align: left;
    transition: transform 0.6s ease, opacity 0.6s ease;
    opacity: 0;
    transform: translateY(20px);
}

.service-card.active .service-content {
    opacity: 1;
    transform: translateY(0);
}

.service-content h3 {
    font-size: 2em;
    margin-bottom: 5px;
    font-family: 'Raleway', sans-serif;
    color: #ff0000; /* Ensure heading color is white */
    transition: color 0.4s ease, border 0.4s ease; /* Add transition for border */
}

.service-content p {
    font-size: 1.2em;
    color: #636366; /* Etwas dunklerer Grauton für den Text */
    transition: color 0.4s ease;
}

.service-card:hover .service-content h3 {
    color: #c2c2c2; /* Dunkleres Blau für einen subtilen Hover-Effekt */
    border: none; /* Ensure border disappears on hover */
}

.service-card:hover .service-content p {
    color: #c2c2c2; /* Helles Blau für den Text bei Hover */
}

.service-card .service-content p {
    display: none; /* Hide the text initially */
}

.service-card:hover .service-content h3 {
    transform: translateY(-20px) scale(1.1); /* Move the title up and enlarge on hover */
    transition: transform 1.5s ease, color 0.4s ease; /* Slow down the transition */
}

.service-card:hover .service-content p {
    display: block; /* Show the text on hover */
    opacity: 0;
    transform: translateY(20px) scale(1.1); /* Move the text up and enlarge on hover */
    transition: opacity 1.5s ease, transform 1.5s ease; /* Slow down the transition */
}

.service-card:hover .service-content p {
    opacity: 1;
    transform: translateY(0) scale(1.1); /* Ensure the text is fully visible and enlarged */
    color: #ffffff !important; /* Ensure text color is white */
    font-family: 'Roboto Slab', serif; /* Use a more professional font */
    font-weight: 300; /* Make the text thinner */
}

.service-card .service-content h3 {
    color: #ff0000; /* Ensure heading color is white */

    transition: transform 1s ease, color 0.4s ease; /* Slow down the transition */
}

.service-card .service-content h3 {
    transition: transform 1s ease; /* Slow down the transition */
}

.service-card .service-content p {
    transition: opacity 1s ease, transform 1s ease; /* Slow down the transition */
}

.service-card:hover .service-content h3,
.service-card:hover .service-content p {
    transition: transform 1s ease, opacity 1s ease; /* Ensure smooth transition on hover away */
}

.service-card {
    position: relative;
    overflow: hidden;
    transition: max-height 1s ease; /* Add transition for height */
    max-height: 200px; /* Set initial max height */
}

.service-card:hover {
    max-height: 300px; /* Expand height on hover */
}

.service-card .more-info {
    display: none;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 3s ease, max-height 3s ease;
}

.service-card .more-info.active {
    display: block;
    opacity: 1;
    max-height: 1000px; /* Adjust as needed */
    animation: revealFromTop 3s ease;
}

.service-card .more-info-button {
    display: none; /* Hide button by default */
    position: absolute;
    background: #005096;
    color: #ffffff;
    border: none;
    border-radius: 50%; /* Ensure the button remains round */
    width: 40px; /* Set fixed size */
    height: 40px; /* Set fixed size */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2em; /* Icon size */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Add shadow */
    transition: background-color 0.3s, transform 0.3s; /* Smooth transitions */
}

.service-card .more-info-button.active {
    display: flex; /* Show button when active */
    transition: opacity 2s ease; /* Add transition for opacity */
    opacity: 1; /* Ensure button is visible initially */
}

.service-card .more-info-button.hidden {
    opacity: 0; /* Hide button with opacity */
}

.service-card .more-info-button:hover {
    background: #003d80;
}

.service-card .more-info-button::before {
    content: '\f078'; /* Font Awesome down arrow */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    transition: transform 0.3s; /* Add transform transition */
}

.service-card .more-info.active .more-info-button::before {
    transform: rotate(180deg); /* Rotate arrow when expanded */
}

.service-card .service-content h3 {
    color: #0088ff; /* Change heading color to blue */
    transition: transform 1s ease, color 0.4s ease; /* Slow down the transition */
}

.service-card:hover .service-content h3 {
    transform: translateY(-20px); /* Move the title up on hover */
    color: #bdbdbd; /* Darker blue on hover */
    transition: transform 1s ease, color 0.4s ease; /* Slow down the transition */
}

.service-card .service-content p.hidden {
    display: none;
}

/* Kontakt Abschnitt */
#kontakt {
    padding: 100px 20px;
    background-color: #f0f0f0; /* Fixed background color */
}

.contact-container {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.contact-info {
    font-size: 1.2em;
}

.contact-info h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

.contact-info p {
    line-height: 1.6;
}

#contact-form {
    background: linear-gradient(to bottom right, #005096, #00274e);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px; /* Restore original margin-bottom */
}

.form-group {
    position: relative;
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: none;
    border-bottom: 2px solid #fff;
    background: transparent;
    color: #fff;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #d4d4d4;
}

.form-group label {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1em;
    color: #fff;
    transition: all 0.3s ease;
}

.form-group input:focus + label,
.form-group textarea:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -10px;
    font-size: 0.9em;
    color: #c0c0c0;
}

button {
    background-color: #005096;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #003d80;
}

@media (max-width: 768px) {
    .contact-container {
        grid-template-columns: 1fr;
    }
}

/* Moderner Footer */
.optimized-footer {
    position: relative; /* Ensure footer is positioned relative */
    background: #002244;
    color: #ffffff;
    padding: 20px 0;
    border-top: 2px solid #ffffff;
    text-align: center;
    font-family: 'Arial', sans-serif;
    overflow: visible; /* Ensure the car is fully visible */
}

/* Container für bessere Struktur */
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center; /* Center the links */
    flex-wrap: wrap;
    padding: 0 20px;
}

/* Kontakt Icons */
.footer-contact {
    display: flex;
    gap: 15px;
    align-items: center;
}

.footer-contact a {
    color: #ffffff;
    font-size: 1em;
    transition: transform 0.3s ease, color 0.3s ease;
}

.footer-contact a:hover {
    color: #005096; /* Match navbar blue */
    transform: scale(1.1);
}

/* Footer Links (Impressum & Datenschutz) */
.footer-links-left, .footer-links-middle, .footer-links-right {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center; /* Center the links */
}

.footer-links-left a, .footer-links-middle a, .footer-links-right a {
    color: #ffffff;
    font-size: 1,5em;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease, background 0.3s ease;
    padding: 0 10px; /* Add padding to move icons inward */
}

.footer-links-left a:hover, .footer-links-middle a:hover, .footer-links-right a:hover {
    color: #005096; /* Match navbar blue */
}

/* Copyright-Zeile */
.footer-bottom {
    text-align: center;
    font-size: 0.9em;
    color: #cccccc;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    margin-top: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .footer-links-left, .footer-links-right {
        display: none; /* Hide individual sections */
    }

    .footer-icons {
        display: flex;
        gap: 10px;
        align-items: center;
        justify-content: center; /* Center the icons */
        flex-wrap: wrap; /* Allow wrapping if necessary */
    }

    .footer-icons a {
        color: #ffffff;
        font-size: 1em;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: color 0.3s ease, background 0.3s ease;
    }

    .footer-icons a:hover {
        color: #005096; /* Match navbar blue */
    }

    .footer-links-middle {
        order: 2; /* Ensure Datenschutz and Impressum are below the icons */
    }

    .footer-icons {
        order: 1; /* Ensure icons are above Datenschutz and Impressum */
    }


    .section-title, .banner-title, .bestattungen-title {
        font-size: 1.5em; /* Adjust font size for mobile view */
    }

    .about-images img {
        display: block; /* Ensure images are displayed */
        width: 100%; /* Ensure images are responsive */
        height: auto;
    }

    .bestattungen-title {
        font-size: 1.5rem; /* Reduce font size on mobile */
    }

    .section-title, .banner-title, .bestattungen-title, .about-text h2, .hero-content h2 {
        font-size: 2em !important; /* Set all headings to 2em on mobile */
    }

    .hero-content h1 {
        font-size: 2.5em !important;
    }

    .bestattungen-item.active {
        transform: scale(1.05); /* Slightly reduce the scale for active item */
    }

    .bestattungen-item h3 {
        font-size: 1.5em; /* Reduce font size */
    }
}

@media (min-width: 769px) {
    .footer-container {
        flex-direction: row; /* Change to row for PC view */
        justify-content: space-between; /* Space out the items */
        align-items: center; /* Center the items vertically */
    }

    .footer-icons {
        display: none; /* Hide combined icons div */
    }

    .footer-links-left, .footer-links-right {
        display: flex; /* Show individual sections */
    }

    .footer-contact {
        justify-content: space-between;
        width: 100%;
    }

    .footer-contact a:nth-child(1),
    .footer-contact a:nth-child(4) {
        order: 1; /* Move Instagram and location to the left */
    }

    .footer-contact a:nth-child(2),
    .footer-contact a:nth-child(3) {
        order: 2; /* Move email and phone to the right */
    }

    .footer-contact a:nth-child(2) {
        margin-left: auto; /* Push email to the right edge */
    }

    .footer-links {
        order: 3; /* Ensure the links are centered */
        margin: 0 auto;
    }
}

/* For larger screens */
@media (max-width: 1900px) {

    nav ul {
        padding-right: 30px; /* Adjust padding */
    }

    nav ul li .uns {
        visibility: visible; /* Ensure "uns" is always visible */
        padding-left: 0px;
    }

    nav ul {
        font-size: 90%;
    }

    .fulllogo {
        max-width: 1%;
    }
}

/* For medium screens */
@media (max-width: 1400px) {

    .fulllogo {
        width: 95%;
    }

    header .container {
        padding-left: 15px; /* Adjust padding */
    }

    nav ul {
        font-size: 90%;
    }
}

/* For smaller screens */
@media (max-width: 1200px) {

    nav {
        width: 100%; /* Navigation nimmt die gesamte Breite ein */
        text-align: center; /* Zentriere die Navigation */
    }

    nav ul {
        padding-right: 5%; /* Adjust padding */
        justify-content: center; /* Zentriere die Navigation */
        font-size: 90%;
    }

    .fulllogo {
        display: none;
    }
    header .logo .smalllogo{
        display: block;
        width: 130px;
    }
}

/* For Tablet (iPad) */
@media (max-width: 1024px) {

    header .logo .smalllogo {
        display: none;
    }

    header .logo .fulllogo {
        display: block;
        width: 1200px; /* Ensure the logo size remains consistent */
        height: auto; /* Set a fixed height */
        transition: none; /* Prevent size change on burger menu toggle */
    }

    nav ul {
        display: none;
    }

    .burger-menu {
        display: block;
        margin-right: 10px;
        padding-right: 10%;
        padding-top: 15px;
    }

    header .container {
        padding-left: 10px; /* Adjust padding */
    }
}

/* For Mobile (Phone) */
@media (max-width: 768px) {

    header .logo .fulllogo {
        display: block;
        width: 1500px;
        height: 65px;
    }

    header .container {
        padding-left: 5px; /* Adjust padding */
    }

    .burger-menu {
        display: block; /* Show burger menu on mobile devices */
        padding-top: 10px;
    }

    .burger-menu.active + nav ul {
        display: flex;
    }

    /* Anpassung des Hero-Bereichs für mobile Endgeräte */
    #hero {
        height: 100vh; /* Ensure the hero section takes up the full viewport height */
    }

    .hero-content h1 {
        font-size: 5.6vw; /* Slightly smaller font size */
    }

    .hero-content p {
        font-size: 3.6vw; /* Vergrößert die Schriftgröße für mobile Endgeräte */
    }

    .hero-content h2 {
        font-size: 4.6vw; /* Slightly smaller font size */
    }

    .hero-buttons {
        flex-direction: column; /* Buttons übereinander anordnen */
        gap: 10px;
    }

    .btn {
        padding: 10px 20px; /* Verkleinert die Buttons */
        font-size: 1em; /* Reduziert die Schriftgröße in den Buttons */
    }

    .hero-buttons .btn {
        padding: 12px 25px; /* Adjust padding */
        font-size: 1.1em; /* Adjust font size */
    }

    .banner-section {
        padding: 30px 5px;
    }

    .banner-title {
        font-size: 1.8rem; /* Adjust font size */
    }

    .banner-grid {
        flex-direction: column;
        gap: 10px;
    }

    .banner-item {
        max-width: 100%;
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }

    .banner-item.active {
        opacity: 1;
        transform: translateY(0);
    }

    .banner-item h3 {
        font-size: 1.2em; /* Adjust font size */
    }

    .banner-item p {
        font-size: 0.9em; /* Adjust font size */
    }

    .service-card {
        max-width: 100%; /* Ensure full width */
        height: auto; /* Adjust height */
        margin-bottom: 20px; /* Add margin */
        padding-bottom: 20px; /* Adjust padding */
    }

    .service-card .service-content h3 {
        font-size: 1.5rem; /* Adjust font size */
        text-align: center; /* Center text */
    }

    .service-card .service-content p {
        font-size: 1rem; /* Adjust font size */
        text-align: center; /* Center text */
    }

    .service-card .more-info p {
        font-size: 0.9rem; /* Adjust font size */
        text-align: center; /* Center text */
    }

    .about-content .main-title {
        font-size: 2em; /* Adjust font size */
    }

    .about-content p {
        font-size: 1em; /* Adjust font size */
    }

    .section-title {
        font-size: 2rem; /* Adjust font size */
    }

    .projekt-info h3 {
        font-size: 1.3rem; /* Adjust font size */
    }

    .projekt-info p {
        font-size: 1rem; /* Adjust font size */
    }

    .contact-info p {
        font-size: 1em; /* Adjust font size */
    }

    #contact-form label {
        font-size: 1em; /* Adjust font size */
    }

    #contact-form input, #contact-form textarea {
        font-size: 1em; /* Adjust font size */
    }

    #contact-form button {
        padding: 15px 30px; /* Adjust padding */
        font-size: 1.1em; /* Adjust font size */
    }

    .footer-contact p {
        font-size: 1em; /* Adjust font size */
    }

    .footer-links a {
        font-size: 1em; /* Adjust font size */
    }

    .projekt-grid {
        display: flex;
        overflow-x: scroll;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .projekt-card {
        flex: 0 0 80%;
        scroll-snap-align: center;
        margin-right: 20px;
    }

    .projekt-card:last-child {
        margin-right: 0;
    }

    .projekt-grid {
        display: flex;
        overflow: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }

    .projekt-card {
        flex: 0 0 100%;
        scroll-snap-align: center;
        transition: transform 0.5s ease, opacity 0.5s ease;
    }

    .projekt-card.active {
        transform: translateX(0);
        opacity: 1;
    }

    .projekt-card.next {
        transform: translateX(100%);
        opacity: 0;
    }

    .projekt-card.prev {
        transform: translateX(-100%);
        opacity: 0;
    }

    .company-car {
        bottom: 72% !important; /* Position the car above the footer */
    }

    .about-images img {
        width: 100%; /* Ensure images are responsive */
        height: auto;
    }

    .hero-content {
        padding: 0 10px; /* Reduce padding */
    }

    .hero-content h1 {
        font-size: 4rem; /* Adjust font size */
    }

    .hero-content h2 {
        font-size: 2rem; /* Adjust font size */
    }

    .hero-content p {
        font-size: 1rem; /* Adjust font size */
    }

    .hero-buttons .btn {
        padding: 10px 20px; /* Adjust padding */
        font-size: 1em; /* Adjust font size */
    }

    .about-us-container {
        position: relative; /* Ensure relative positioning */
    }

    .about-images {
        position: none; /* Position images absolutely */
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 0; /* Place images behind the text */
        opacity: 0; /* Increase opacity for better visibility */
        background-size: cover; /* Ensure background images cover the area */
        background-repeat: no-repeat; /* Prevent background images from repeating */
    }

    .about-text {
        position: relative; /* Ensure text is above images */
        z-index: 1;
        text-align: center; /* Center text on mobile */
    }

    .about-images img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* Ensure images cover the area */
    }

    .section-title, .banner-title, .bestattungen-title {
        font-size: 1.5em; /* Adjust font size for mobile view */
    }

    .about-images img {
        display: block; /* Ensure images are displayed */
        width: 100%; /* Ensure images are responsive */
        height: auto;
    }

    .hero-content h1 {
        font-size: 5.6vw; /* Slightly smaller font size */
    }
    .hero-content h2 {
        font-size: 4.6vw; /* Slightly smaller font size */
    }
    .hero-content p {
        font-size: 3.6vw; /* Slightly smaller font size */
    }
    .section-title, .banner-title, .bestattungen-title {
        font-size: 1.3em; /* Slightly smaller font size */
    }
}

/* For very small screens */
@media (max-width: 480px) {
    header .container {
        padding-left: 5px; /* Adjust padding */
    }

    .burger-menu {
        margin-right: 5px;
    }

    nav ul {
        padding-right: 10px;
    }

    .banner-section {
        padding: 20px 5px;
    }

    .banner-title {
        font-size: 1.5em; /* Adjust font size */
    }

    .banner-grid {
        flex-direction: column;
        gap: 5px;
    }

    .banner-item {
        max-width: 100%;
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }

    .banner-item.active {
        opacity: 1;
        transform: translateY(0);
    }

    .banner-item h3 {
        font-size: 1.1em; /* Adjust font size */
    }

    .banner-item p {
        font-size: 0.8em; /* Adjust font size */
    }

    .hero-content h1 {
        font-size: 6vw; /* Adjust font size */
    }

    .hero-content h2 {
        font-size: 5vw; /* Adjust font size */
    }

    .hero-buttons .btn {
        padding: 10px 20px; /* Adjust padding */
        font-size: 1em; /* Adjust font size */
    }

    .about-content .main-title {
        font-size: 2em; /* Adjust font size */
    }

    .about-content p {
        font-size: 1em; /* Adjust font size */
    }

    .section-title {
        font-size: 2rem; /* Adjust font size */
    }

    .projekt-info h3 {
        font-size: 1.2rem; /* Adjust font size */
    }

    .projekt-info p {
        font-size: 0.9rem; /* Adjust font size */
    }

    .contact-info p {
        font-size: 1em; /* Adjust font size */
    }

    #contact-form label {
        font-size: 0.9em; /* Adjust font size */
    }

    #contact-form input, #contact-form textarea {
        font-size: 0.9em; /* Adjust font size */
    }

    #contact-form button {
        padding: 10px 20px; /* Adjust padding */
        font-size: 1em; /* Adjust font size */
    }

    .footer-contact p {
        font-size: 1em; /* Adjust font size */
    }

    .footer-links a {
        font-size: 0.9em; /* Adjust font size */
    }

    .about-images img {
        width: 100%; /* Ensure images are responsive */
        height: auto;
    }
}

/* Überarbeitung für die Servicekarten */
.leistungen-section {
    padding: 100px 0;
    text-align: center;
}

.leistungen-title {
    font-size: 2.5rem;
    color: #1c1c1e;
    margin-bottom: 50px;
    font-family: 'Lato', Arial, sans-serif;
}

/* Grid Layout */
.leistungen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    justify-content: center;
}

/* Service Karten */
.service-card {
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: transform 1.5s ease-out, opacity 1.5s ease-out, box-shadow 1.5s ease; /* Slow down the transition */
    perspective: 1000px; /* Perspektive für 3D-Effekte */
    width: 100%;
    max-width: 500px; /* Decrease the size */
    height: 300px; /* Adjust height */
    margin: 0 auto;
    cursor: pointer;
    position: relative;
    will-change: transform, box-shadow;
    max-height: 300px; /* Adjust max height */
    padding-bottom: 50px; /* Ensure enough space for the button */
    background-repeat: no-repeat; /* Prevent background image from repeating */
    background-size: cover; /* Ensure the image covers the entire card */
    background-position: center; /* Center the background image */
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.3);
    transition: transform 1.5s ease-out, box-shadow 1.5s ease; /* Slow down the transition */
    max-height: 350px; /* Adjust expanded height on hover */
}

.service-card .service-content p {
    font-size: 1.5em; /* Increase font size */
    color: #1c1c1e; /* Darker text color */
    opacity: 0; /* Initially hidden */
    transform: translateY(20px); /* Start position for animation */
    transition: opacity 1s ease, transform 1s ease, font-size 0.5s ease; /* Smooth transition */
}

.service-card:hover .service-content p {
    opacity: 1; /* Show text on hover */
    transform: translateY(0); /* Move to final position */
}

.service-card .more-info p {
    font-size: 1em; /* Smaller font size for more info text */
    color: #636366; /* Slightly darker text color */
    transition: font-size 0.5s ease; /* Smooth transition */
}

.service-card .service-content {
    padding: 20px; /* Add padding for more space */
}

.service-card:hover .service-content h3 {
    transform: translateY(-20px); /* Move the title up on hover */
    transition: transform 1s ease; /* Slow down the transition */
}

.service-card:hover .service-content p {
    display: block; /* Show the text on hover */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease; /* Slow down the transition */
}

.service-card:hover .service-content p {
    opacity: 1;
    transform: translateY(0);
    color: #005096; /* Change text color to blue */
}

.service-card .service-content h3 {
    transition: transform 1s ease; /* Slow down the transition */
}

.service-card .service-content p {
    transition: opacity 1s ease, transform 1s ease; /* Slow down the transition */
}

.service-card:hover .service-content h3,
.service-card:hover .service-content p {
    transition: transform 1s ease, opacity 1s ease; /* Ensure smooth transition on hover away */
}

.service-card .more-info {
    display: none;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.service-card .more-info.active {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.service-card .more-info-button.active {
    display: flex; /* Show button when active */
    transition: opacity 2s ease; /* Add transition for opacity */
    opacity: 1; /* Ensure button is visible initially */
}

.service-card .more-info-button.hidden {
    opacity: 0; /* Hide button with opacity */
}

/* Ensure the button stays at the bottom right even on hover */
.service-card:hover .more-info-button {
    display: flex; /* Show button on hover */
    bottom: 20px; /* Ensure it stays within the padding area */
    right: 20px;
}

.service-card .more-info-button:hover {
    background: #003d80;
}

.service-card .more-info.active .more-info-button::before {
    transform: rotate(180deg); /* Rotate arrow when expanded */
}

.service-card .service-content h3 {
    color: #ffffff; /* Change heading color to blue */
    transition: transform 1s ease, color 0.4s ease; /* Slow down the transition */

}

.service-card:hover .service-content h3 {
    transform: translateY(-20px); /* Move the title up on hover */
    color: #bdbdbd; /* Darker blue on hover */
    transition: transform 1s ease, color 0.4s ease; /* Slow down the transition */
    border: none;
}

.service-card .service-content p.hidden {
    display: none;
}

.cookie-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7); /* Darker background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    font-family: 'Roboto', sans-serif;
}

.cookie-popup {
    background-color: #ffffff;
    padding: 30px; /* Increase padding */
    border-radius: 5px; /* More rounded corners */
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    max-width: 600px; /* Increase max width */
    width: 70%;
    height: 4    0%;
    animation: fadeIn 0.5s ease-in-out;
}

.cookie-popup p {
    font-size: 1.2em; /* Increase font size */
    color: #333333;
    margin-bottom: 20px;
}

.cookie-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.cookie-buttons button {
    padding: 10px 15px; /* Reduce padding */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s, color 0.3s;
}

.cookie-buttons button#accept-all {
    background-color: #005096;
    color: white;
}

.cookie-buttons button#accept-all:hover {
    background-color: #003d80;
}

.cookie-buttons button#settings {
    background-color: #f0f0f0;
    color: #333;
}

.cookie-buttons button#settings:hover {
    background-color: #d4d4d4;
}

.cookie-settings {
    display: none;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    text-align: left;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    margin-top: 20px;
}

.cookie-settings.active {
    display: block;
}

.cookie-settings h3 {
    margin-top: 0;
    font-size: 1.2em;
    color: #005096;
}

.cookie-settings label {
    display: block;
    margin-bottom: 10px;
    font-size: 1em;
    color: #333333;
}

.cookie-settings input {
    margin-right: 10px;
}

.cookie-buttons button#save-settings {
    background-color: #005096;
    color: white;
}

.cookie-buttons button#save-settings:hover {
    background-color: #003d80;
}

.cookie-buttons button#reject-all {
    background-color: #f0f0f0;
    color: #333;
}

.cookie-buttons button#reject-all:hover {
    background-color: #d4d4d4;
}

.cookie-buttons.hidden {
    display: none;
}

/* Ensure hover effects are also triggered by touch events on mobile devices */
@media (hover: none) {
    .service-card:hover, .service-card:focus {
        transform: translateY(-10px);
        box-shadow: 0 15px 25px rgba(0, 0, 0, 0.3);
    }

    .service-card:hover .service-content h3, .service-card:focus .service-content h3 {
        transform: translateY(-20px);
    }

    .service-card:hover .service-content p, .service-card:focus .service-content p {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }

    .service-card:hover .more-info-button, .service-card:focus .more-info-button {
        display: flex;
    }

    .service-card .service-content p.hidden {
        display: none;
    }
}

/* Company Car Animation */
.company-car {
    position: absolute; /* Change to absolute positioning */
    bottom: 65%; /* Position the car above the footer */
    left: 0; /* Align to the left edge */
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: flex-end; /* Align items to the bottom */
    z-index: 3; /* Ensure it is above the footer and contact div */
    background-color: transparent; /* Make background transparent */
    padding: 0; /* Remove padding */
    transform: translateY(-50%); /* Move the car to the edge of the footer */
}

.company-car img {
    width: 150px;
    height: auto;
    animation: moveCar 15s linear infinite; /* Move only the car image */
}

@keyframes moveCar {
    0% {
        transform: translateX(100vw); /* Start from far right */
    }
    100% {
        transform: translateX(-100vw); /* Move to far left */
    }
}

.footer-icons a:hover {
    color: #00509693; /* Match navbar blue */
}

.section-title, .banner-title, .bestattungen-title {
    font-size: 3em;
    margin-bottom: 60px;
    font-family: 'Lato', sans-serif;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    color: #1c1c1e; /* Dunkleres Grau für modernen Kontrast */
    text-align: center;
    position: relative;
    padding-bottom: 20px;
}

.section-title::after, .banner-title::after, .bestattungen-title::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background: #005096; /* Match navbar blue */
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.section-title.active, .banner-title.active, .bestattungen-title.active {
    opacity: 1;
    transform: translateY(0);
} 

/* Bestattungen Section */
.bestattungen-section {
    padding: 60px 20px;
    background: linear-gradient(135deg, #f7f7f7, #ffffff);
    text-align: center;
    z-index: 10;
    position: relative;
    overflow: hidden; /* Verhindert Überlauf von Elementen */
}

.bestattungen-title {
    font-size: 3rem;
    font-family: 'Lato', Arial, sans-serif;
    color: #1c1c1e;
    margin-bottom: 50px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease; /* Schnellere Transition */
}

.bestattungen-title.active {
    opacity: 1;
    transform: translateY(0);
}

.bestattungen-grid {
    display: flex;
    justify-content: center; /* Ändert von flex-start zu center */
    align-items: center; /* Ändert von flex-start zu center */
    gap: 30px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    position: relative;
    overflow-y: hidden;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
    will-change: scroll-position;
    padding: 20px 0; /* Erhöht von 10px zu 20px für mehr Platz */
    width: 100%; /* Stellt sicher, dass der Grid die volle Breite einnimmt */
    scroll-padding: 0 calc(50% - 150px); /* Wichtig für das zentrierte Snapping */
}

.bestattungen-item {
    max-width: 300px;
    text-align: center;
    flex: 0 0 auto;
    transition: transform 0.3s ease, opacity 0.3s ease; /* Erhöhte Dauer für smoothere Animation */
    scroll-snap-align: center;
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    cursor: pointer;
}

.bestattungen-item.active {
    transform: scale(1.05);
    opacity: 1;
    z-index: 2; /* Stellt sicher, dass das aktive Element über den anderen liegt */
}

.bestattungen-item:not(.active) {
    opacity: 0.6; /* Leicht erhöhte Sichtbarkeit für inaktive Elemente */
}

.bestattungen-icon {
    font-size: 50px; /* Reduzierte Größe */
    color: #005096;
    margin-bottom: 15px;
    transform: translateZ(0); /* Hardware-Beschleunigung aktivieren */
}

.bestattungen-item h3 {
    font-size: 1.6em; /* Leicht reduzierte Größe */
    color: #1c1c1e;
    margin-bottom: 10px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.bestattungen-item p {
    font-size: 1em; /* Reduzierte Größe */
    color: #636366;
}

.scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #005096;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.3s;
    font-size: 1.2em; /* Leicht reduzierte Größe */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Subtiler Schatten */
    opacity: 0.8; /* Leicht transparent */
}

.scroll-button:hover {
    background-color: #003d80;
    opacity: 1; /* Vollständig undurchsichtig bei Hover */
}

.scroll-button.left {
    left: 10px;
}

.scroll-button.right {
    right: 10px;
}

.bestattungen-indicators {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    position: relative;
    z-index: 3; /* Stellen Sie sicher, dass die Indikatoren über dem Slider liegen */
}

.bestattungen-indicators .indicator {
    width: 10px;
    height: 10px;
    background-color: #ccc;
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease; /* Schnellere Transition */
}

.bestattungen-indicators .indicator.active {
    background-color: #005096;
    transform: scale(1.2); /* Kleine Skalierung für visuelles Feedback */
}

.bestattungen-indicators .indicator:hover {
    background-color: #aaa; /* Hover-Effekt für besseres Nutzerfeedback */
}

/* Mobile-Optimierungen */
@media (max-width: 768px) {
    .bestattungen-grid {
        gap: 15px;
        -ms-overflow-style: none;
        scrollbar-width: none;
        padding: 10px 0; /* Erhöht Padding für besseres visuelles Erscheinungsbild */
        scroll-padding: 0 calc(50% - 125px); /* Angepasst für die kleinere Elementbreite */
    }
    
    .bestattungen-grid::-webkit-scrollbar {
        display: none; /* Safari und Chrome */
    }
    
    .bestattungen-item {
        max-width: 250px; /* Kleinere Karten für Mobile */
        transition: transform 0.2s ease, opacity 0.2s ease; /* Schnellere Übergänge */
    }
    
    .bestattungen-item.active {
        transform: scale(1.03); /* Geringere Skalierung auf Mobile */
    }
    
    .bestattungen-icon {
        font-size: 40px; /* Kleinere Icons auf Mobile */
    }
    
    .bestattungen-item h3 {
        font-size: 1.3em; /* Kleinere Schrift auf Mobile */
    }
    
    .bestattungen-item p {
        font-size: 0.9em; /* Kleinere Schrift auf Mobile */
    }
    
    .scroll-button {
        width: 35px; /* Kleinere Buttons */
        height: 35px;
        opacity: 0.7; /* Mehr Transparenz auf Mobile */
    }
    
    .bestattungen-title {
        font-size: 2rem; /* Kleinere Überschrift */
        margin-bottom: 30px; /* Reduzierter Abstand */
    }
}

/* Tablet-Optimierungen */
@media (min-width: 769px) and (max-width: 1024px) {
    .bestattungen-grid {
        gap: 20px; /* Mittlerer Abstand für Tablets */
    }
    
    .bestattungen-item {
        max-width: 280px; /* Mittlere Größe für Tablets */
    }
    
    .bestattungen-icon {
        font-size: 45px; /* Mittlere Icon-Größe */
    }
}

/* Desktop-Optimierungen */
@media (min-width: 1025px) {
    .bestattungen-grid {
        justify-content: center; /* Zentriere Items auf großen Bildschirmen */
        overflow-x: hidden; /* Deaktiviere horizontales Scrollen auf Desktop */
        gap: 40px; /* Großer Abstand auf Desktop */
    }
    
    .scroll-button {
        opacity: 0.6; /* Mehr Transparenz auf Desktop */
        transition: opacity 0.3s ease, background-color 0.3s ease;
    }
    
    .scroll-button:hover {
        opacity: 1; /* Volle Sichtbarkeit bei Hover */
    }
}