/* Safari-specific fixes for gallery */
@supports (-webkit-appearance: none) and (stroke-color: transparent) {
    /* Safari'de görüntü problemini düzelt */
    .gallery-container {
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    
    .gallery-wrapper {
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-box-align: center;
        -webkit-align-items: center;
        align-items: center;
        height: 100%;
    }
    
    .gallery-slide {
        -webkit-flex-shrink: 0;
        flex-shrink: 0;
        width: auto !important;
        height: 100%;
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-box-pack: center;
        -webkit-justify-content: center;
        justify-content: center;
        -webkit-box-align: center;
        -webkit-align-items: center;
        align-items: center;
    }
    
    .custom-img {
        width: auto;
        max-width: 100%;
        height: 480px;
        min-height: 480px;
        max-height: 480px;
        object-fit: cover;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-perspective: 1000;
        perspective: 1000;
        will-change: transform;
        -webkit-user-select: none;
        user-select: none;
        display: block;
    }
    
    /* Swiper container için Safari optimizasyonu */
    .swiper-container {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
    
    .swiper-wrapper {
        -webkit-transform-style: preserve-3d;
        transform-style: preserve-3d;
    }
    
    /* Mobile Safari için ek düzeltmeler */
    @media (max-width: 767px) {
        .custom-img {
            width: 100%;
            height: auto;
            max-width: 100%;
            min-height: 220px;
            max-height: 320px; /* Increased from 180px */
            object-fit: cover;
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }
        
        /* Splide specific fixes for Safari mobile */
        .splide__slide {
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }
        
        .gallery-container {
            -webkit-overflow-scrolling: touch;
            -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
        }
    }
    
    /* Small mobile Safari için ek düzeltmeler */
    @media (max-width: 570px) {
        .gallery-slide .custom-img {
            width: 100% !important;
            height: 280px !important;
            object-fit: cover !important;
            object-position: center center !important;
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }
        
        .gallery-slide {
            position: relative;
            width: 100%;
            height: 280px !important;
            overflow: hidden;
        }
        
        .gallery-container .splide__slide {
            width: 90vw !important;
            flex-shrink: 0;
        }
    }
}

/* iOS Safari için ek düzeltmeler */
@supports (-webkit-touch-callout: none) {
    .gallery-slide {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
    
    .custom-img {
        -webkit-touch-callout: none;
    }
}

/* Alternatif Safari tespiti */
@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) {
        .custom-img {
            width: auto;
            max-width: 100%;
            height: 480px;
            object-fit: cover;
        }
        
        .gallery-slide {
            flex: 0 0 auto;
        }
    }
}