/**
 * Sidebar Sticky Container Fix
 * Sidebar'ın kendi container'ı içinde sticky kalmasını sağlar
 */

/* Desktop için sticky sidebar düzenlemesi */
@media (min-width: 992px) {
    /* Main container yapısı */
    .service-single {
        position: relative;
    }
    
    /* Row container için flex düzeni */
    .service-single .row {
        display: flex;
        align-items: flex-start;
        position: relative;
    }
    
    /* Content column - ana içerik alanı */
    .service-single .col-lg-8 {
        min-height: 600px;
        position: relative;
    }
    
    /* Sidebar column - sticky container */
    .sidebar-column {
        position: relative;
        align-self: stretch;
    }
    
    /* Sidebar inner - sticky element */
    .sidebar-inner {
        position: -webkit-sticky;
        position: sticky;
        top: 120px; /* Header yüksekliği + boşluk */
        max-height: calc(100vh - 140px);
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 10;
        transition: none; /* Smooth scroll için transition kaldır */
        will-change: transform;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    /* Scroll performansı için optimizasyon */
    .sidebar-inner::-webkit-overflow-scrolling {
        touch: auto;
    }
    
    /* Custom scrollbar styling */
    .sidebar-inner::-webkit-scrollbar {
        width: 5px;
    }
    
    .sidebar-inner::-webkit-scrollbar-track {
        background: rgba(0, 98, 51, 0.05);
        border-radius: 10px;
    }
    
    .sidebar-inner::-webkit-scrollbar-thumb {
        background: rgba(0, 98, 51, 0.3);
        border-radius: 10px;
        transition: background 0.3s;
    }
    
    .sidebar-inner::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 98, 51, 0.5);
    }
    
    /* Firefox scrollbar */
    .sidebar-inner {
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 98, 51, 0.3) rgba(0, 98, 51, 0.05);
    }
}

/* Tablet ve mobilde sticky devre dışı */
@media (max-width: 991px) {
    .sidebar-inner {
        position: static !important;
        top: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .sidebar-column {
        position: static !important;
        margin-top: 30px;
    }
    
    .service-single .row {
        display: block;
    }
}