/* Styling für die Leistungsseite */
.leistungen-page-section {
    font-family: 'Open Sans', sans-serif;
    margin-top: 30px;
    margin-bottom: -60px;
}

.leistungen-page-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 36px;
    color: #009a93;
    letter-spacing: 4px;
}

.leistungen-page-introduction {
    margin-bottom: 50px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.leistungen-page-introduction p {
    font-size: 18px;
    line-height: 1.8;
    text-align: justify;
}

/* Einzelne Leistungen */
.leistungen-page-detail {
    margin-bottom: 30px;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.leistungen-page-detail.visible {
    opacity: 1;
    transform: translateY(0);
}

.leistungen-page-content-container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    padding: 30px;
}

.leistungen-page-content-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.leistungen-page-header {
    text-align: center;
}

.leistungen-page-header h2 {
    font-size: 32px;
    color: #009a93;
    margin-bottom: 20px;
    letter-spacing: 2px;
    position: relative;
}

.leistungen-page-header h2::after {
    content: '';
    display: block;
    width: 5%;
    height: 2px;
    background-color: #009a93;
    margin: 30px auto 30px;
    position: relative;
    transition: width 0.3s ease, height 0.3s ease;
}

.leistungen-page-content-container:hover .leistungen-page-header h2::after {
    width: 30%;
    height: 2px;
}

.leistungen-page-slogan {
    font-style: italic;
    font-size: 20px;
    color: #555;
    margin-bottom: 30px;
}

.leistungen-page-content {
    display: flex;
    flex-direction: column;
    padding: 0;
    position: relative;
}

.leistungen-page-image {
    width: 50%;
    height: auto;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin: 0 20px 20px 0;
    order: 2;
}

/* Bildergalerie Styling */
.service-gallery {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
}

.gallery-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.gallery-slide.active {
    opacity: 1;
    z-index: 2;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
    border-radius: 10px;
}

/* Hover-Effekt für Bilder */
.leistungen-page-content-container:hover .gallery-slide.active img {
    transform: scale(1.05);
}

/* Fallback für direkte Bilder */
.leistungen-page-image > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
    border-radius: 10px;
}

.leistungen-page-content-container:hover .leistungen-page-image > img {
    transform: scale(1.05);
}

/* Navigation Buttons */
.gallery-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
    padding: 0 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-gallery:hover .gallery-navigation {
    opacity: 1;
}

.gallery-prev,
.gallery-next {
    background: rgba(0, 0, 0, 0.3) !important;
    border: none !important;
    color: white !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    pointer-events: auto !important;
    z-index: 15 !important;
    position: relative !important;
    backdrop-filter: blur(8px) !important;
}

.gallery-prev {
    padding-left: 6px;
}

.gallery-next {
    padding-right: 6px;
}

.gallery-prev:hover,
.gallery-next:hover {
    background: rgba(0, 0, 0, 0.5) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
}

.gallery-prev:focus,
.gallery-next:focus {
    outline: none !important;
}

.gallery-prev::before,
.gallery-next::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-right: none;
    border-bottom: none;
    display: block;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.gallery-prev::before {
    transform: rotate(-45deg);
    margin-left: 2px;
}

.gallery-next::before {
    transform: rotate(135deg);
    margin-right: 2px;
}

.gallery-prev:hover::before,
.gallery-next:hover::before {
    border-color: rgba(255, 255, 255, 1);
}

/* Alternative für helle Hintergründe */
.gallery-prev.light-bg,
.gallery-next.light-bg {
    background: rgba(255, 255, 255, 0.8) !important;
    color: #333 !important;
}

.gallery-prev.light-bg:hover,
.gallery-next.light-bg:hover {
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

.gallery-prev.light-bg::before,
.gallery-next.light-bg::before {
    border-color: rgba(51, 51, 51, 0.8) !important;
}

.gallery-prev.light-bg:hover::before,
.gallery-next.light-bg:hover::before {
    border-color: rgba(0, 154, 147, 0.9) !important;
}

/* Punkte-Navigation - Verbesserte Responsive Anpassungen mit höherer Spezifität */
.service-gallery .gallery-dots {
    position: absolute !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    z-index: 10 !important;
    padding: 8px 16px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 20px !important;
    backdrop-filter: blur(5px) !important;
    max-width: calc(100% - 40px) !important;
    width: auto !important;
    box-sizing: border-box !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 28px !important;
}

.service-gallery .gallery-dot {
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    background: transparent !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    flex-basis: auto !important;
    box-sizing: border-box !important;
    min-width: 12px !important;
    min-height: 12px !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.service-gallery .gallery-dot.active,
.service-gallery .gallery-dot:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.9) !important;
}

/* Navigation nur bei mehreren Bildern anzeigen */
.service-gallery[data-images="1"] .gallery-navigation,
.service-gallery[data-images="1"] .gallery-dots {
    display: none !important;
}

/* Platzhalter für fehlende Bilder */
.service-gallery-placeholder {
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-image-placeholder {
    color: #666;
    font-size: 16px;
    font-style: italic;
    text-align: center;
}

.leistungen-page-text {
    width: 50%;
    order: 1;
}

.leistungen-page-text p {
    font-size: 18px !important;
    line-height: 1.8 !important;
    text-align: justify !important;
    margin-bottom: 20px !important;
    padding: 25px;
}

.leistungen-page-text p:last-child {
    margin-bottom: 0;
}

/* Anker-Offset für die Navigation */
.leistungen-page-section :target {
    scroll-margin-top: 120px;
}

/* Responsive Design */
@media screen and (min-width: 990px) {
    .leistungen-page-content {
        flex-direction: row;
        align-items: center;
        min-height: 350px;
    }
    
    /* Desktop: Bildcontainer braucht feste Höhe für das Side-by-Side Layout */
    .leistungen-page-image {
        min-height: 400px;
    }
    
    .service-gallery,
    .gallery-container {
        min-height: 400px;
    }
    
    /* Abwechselndes Layout für gerade/ungerade Elemente */
    .leistungen-page-detail:nth-child(odd) .leistungen-page-image {
        order: 1;
        margin-right: 0;
        margin-left: 20px;
    }
    
    .leistungen-page-detail:nth-child(odd) .leistungen-page-text {
        order: 2;
        padding-left: 20px;
    }
    
    .leistungen-page-detail:nth-child(even) .leistungen-page-image {
        order: 2;
        margin-left: 0;
        margin-right: 20px;
    }
    
    .leistungen-page-detail:nth-child(even) .leistungen-page-text {
        order: 1;
        padding-right: 20px;
    }
}

@media screen and (max-width: 989px) {
    .leistungen-page-section {
        margin-bottom: -70px;
        margin-top: 0px;
    }
    
    .leistungen-page-header h2::after {
        width: 30%;
        margin: 20px auto 20px;
    }
    
    .leistungen-page-content {
        flex-direction: column;
    }
    
    .leistungen-page-image {
        width: 100%;
        height: 280px;
        margin: 0px;
    }
    
    .leistungen-page-text {
        width: 100%;
    }
    
    /* Mobile Gallery Navigation */
    .gallery-prev,
    .gallery-next {
        width: 40px !important;
        height: 40px !important;
    }
    
    .gallery-prev {
        margin-left: 10px;
    }
    
    .gallery-next {
        margin-right: 10px;
    }
    
    .service-gallery .gallery-dots {
        bottom: 10px !important;
        gap: 6px !important;
        padding: 6px 12px !important;
        max-width: calc(100% - 20px) !important;
    }
    
    .service-gallery .gallery-dot {
        width: 10px !important;
        height: 10px !important;
        min-width: 10px !important;
        min-height: 10px !important;
        border-width: 2px !important;
    }
}

@media screen and (max-width: 575px) {
    /* Pfeile bei sehr kleinen Bildschirmen ausblenden */
    .gallery-prev,
    .gallery-next,
    .gallery-navigation {
        display: none !important;
    }
}

@media screen and (max-width: 480px) {
    .leistungen-page-header h2 {
        font-size: 26px;
    }
    
    .leistungen-page-slogan {
        font-size: 16px;
    }

    .leistungen-page-text p {
        padding: 0px;
    }
    
    .service-gallery .gallery-dots {
        bottom: 8px !important;
        gap: 5px !important;
        padding: 5px 10px !important;
        max-width: calc(100% - 16px) !important;
        border-radius: 15px !important;
    }
    
    .service-gallery .gallery-dot {
        width: 8px !important;
        height: 8px !important;
        min-width: 8px !important;
        min-height: 8px !important;
        border-width: 1px !important;
    }
    
    .no-image-placeholder {
        font-size: 14px;
    }
}

@media screen and (max-width: 320px) {
    .gallery-prev,
    .gallery-next {
        width: 30px !important;
        height: 30px !important;
    }
    
    .gallery-prev::before,
    .gallery-next::before {
        width: 8px;
        height: 8px;
        border-width: 2px;
    }
    
    .gallery-prev {
        margin-left: 5px;
    }
    
    .gallery-next {
        margin-right: 5px;
    }
    
    .service-gallery .gallery-dots {
        bottom: 6px !important;
        gap: 4px !important;
        padding: 4px 8px !important;
        max-width: calc(100% - 12px) !important;
        border-radius: 12px !important;
    }
    
    .service-gallery .gallery-dot {
        width: 6px !important;
        height: 6px !important;
        min-width: 6px !important;
        min-height: 6px !important;
        border-width: 1px !important;
    }
}

/* Dots bei vielen Bildern (>5) kleiner machen */
.service-gallery[data-images="6"] .gallery-dots,
.service-gallery[data-images="7"] .gallery-dots,
.service-gallery[data-images="8"] .gallery-dots {
    gap: 6px !important;
    padding: 6px 12px !important;
}

.service-gallery[data-images="6"] .gallery-dot,
.service-gallery[data-images="7"] .gallery-dot,
.service-gallery[data-images="8"] .gallery-dot {
    width: 10px !important;
    height: 10px !important;
    min-width: 10px !important;
    min-height: 10px !important;
}

@media screen and (max-width: 480px) {
    .service-gallery[data-images="6"] .gallery-dots,
    .service-gallery[data-images="7"] .gallery-dots,
    .service-gallery[data-images="8"] .gallery-dots {
        gap: 4px !important;
        padding: 4px 8px !important;
    }
    
    .service-gallery[data-images="6"] .gallery-dot,
    .service-gallery[data-images="7"] .gallery-dot,
    .service-gallery[data-images="8"] .gallery-dot {
        width: 6px !important;
        height: 6px !important;
        min-width: 6px !important;
        min-height: 6px !important;
        border-width: 1px !important;
    }
}