/**
 * Overlap Fixes - Üst üste binme sorunları için düzeltmeler
 * Canlı sitedeki z-index ve pozisyonlama sorunlarını çözer
 */

/* ============================================
   Z-INDEX HİYERARŞİSİ
   ============================================ */
/* 
 * Z-index değerleri:
 * 1-10: Normal içerik
 * 100-500: Kartlar ve bileşenler
 * 1000-5000: Dropdown ve modal
 * 9000-9999: Header ve sticky elementler
 * 10000+: Critical overlays (admin bar)
 */

/* ============================================
   HEADER OVERLAP FIXES
   ============================================ */

/* Header z-index standardizasyonu */
.header-area,
.vt-header,
.vt-header-main {
    z-index: 9990 !important; /* 99999 yerine makul bir değer */
}

/* Sticky header için */
.sticky-header,
.vt-header-main.sticky {
    z-index: 9991 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
}

/* Admin bar varken header pozisyonu */
.admin-bar .sticky-header,
.admin-bar .vt-header-main.sticky {
    top: 32px !important;
}

@media (max-width: 782px) {
    .admin-bar .sticky-header,
    .admin-bar .vt-header-main.sticky {
        top: 46px !important;
    }
}

/* ============================================
   BREADCRUMB SPACING
   ============================================ */

/* Breadcrumb üst boşluğu düzeltmesi */
.breadcrumb,
.xb-breadcrumb,
.breadcrumb-area {
    margin-top: 0 !important;
    padding-top: 120px !important; /* Header yüksekliği + boşluk */
}

/* Mobile için breadcrumb */
@media (max-width: 991px) {
    .breadcrumb,
    .xb-breadcrumb,
    .breadcrumb-area {
        padding-top: 100px !important;
    }
}

@media (max-width: 767px) {
    .breadcrumb,
    .xb-breadcrumb,
    .breadcrumb-area {
        padding-top: 80px !important;
    }
}

/* ============================================
   CONTENT OVERLAP FIXES
   ============================================ */

/* Ana içerik alanı için margin düzeltmesi */
.main-content,
.site-content,
.content-area {
    position: relative;
    z-index: 1;
}

/* Service detail sayfası için özel düzeltme */
.service-details,
.service-detail,
.hizmet-detay {
    margin-top: 0 !important;
    padding-top: 20px !important;
}

/* Sidebar z-index düzeltmesi */
.sidebar,
.widget-area {
    position: relative;
    z-index: 10 !important; /* Çok yüksek değerlerden kaçın */
}

/* ============================================
   MOBILE MENU FIXES
   ============================================ */

/* Mobile menu overlay */
.mobile-menu,
.vt-modern-mobile-menu {
    z-index: 9995 !important; /* Header'dan yüksek ama admin bar'dan düşük */
}

.mobile-menu-overlay,
.vt-mobile-menu-overlay {
    z-index: 9994 !important;
}

/* ============================================
   DROPDOWN & MODAL Z-INDEX
   ============================================ */

/* Dropdown menüler */
.dropdown-menu,
.submenu,
.sub-menu {
    z-index: 9992 !important;
}

/* Modal ve popup'lar */
.modal,
.popup,
.lightbox {
    z-index: 9996 !important;
}

.modal-backdrop,
.popup-overlay {
    z-index: 9995 !important;
}

/* ============================================
   HERO SECTION FIXES
   ============================================ */

/* Hero section overlap düzeltmesi */
.hero-section,
.xb-hero__area {
    margin-top: 0 !important;
    position: relative;
    z-index: 1;
}

/* Fixed header varken hero padding */
body.has-sticky-header .hero-section,
body.has-sticky-header .xb-hero__area {
    padding-top: 80px !important;
}

/* ============================================
   FLOATING ELEMENTS
   ============================================ */

/* Back to top button */
.back-to-top,
.xb-backtotop,
.scroll-to-top {
    z-index: 9000 !important; /* Yeterli ama aşırı değil */
}

/* WhatsApp button veya diğer floating action buttons */
.whatsapp-button,
.floating-button,
.fab {
    z-index: 9001 !important;
}

/* ============================================
   PRELOADER FIX
   ============================================ */

/* Preloader z-index */
.preloader,
.xb-preloader {
    z-index: 99999 !important; /* En üstte olmalı */
}

/* Preloader kaldırıldıktan sonra */
body.preloader-hidden .preloader,
body.preloader-hidden .xb-preloader {
    display: none !important;
}

/* ============================================
   SPECIFIC PAGE FIXES
   ============================================ */

/* Service pages için özel düzeltmeler */
.page-template-service .breadcrumb,
.single-service .breadcrumb {
    padding-top: 140px !important;
}

/* Team pages */
.page-template-team .main-content,
.single-team .main-content {
    padding-top: 30px !important;
}

/* ============================================
   RESPONSIVE FIXES
   ============================================ */

/* Tablet görünüm */
@media (min-width: 768px) and (max-width: 991px) {
    .header-area {
        position: relative !important;
    }
    
    .breadcrumb {
        padding-top: 20px !important;
    }
}

/* Mobile görünüm */
@media (max-width: 767px) {
    /* Mobile'de sticky header kaldır */
    .sticky-header {
        position: relative !important;
    }
    
    /* Content spacing düzeltmesi */
    .main-content,
    .content-area {
        padding-top: 20px !important;
    }
    
    /* Sidebar mobile'de alta al */
    .sidebar {
        margin-top: 40px !important;
    }
}

/* ============================================
   TRANSITION SMOOTHING
   ============================================ */

/* Geçişleri yumuşat */
.header-area,
.sticky-header,
.vt-header-main {
    transition: all 0.3s ease !important;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Z-index utility classes */
.z-index-1 { z-index: 1 !important; }
.z-index-10 { z-index: 10 !important; }
.z-index-100 { z-index: 100 !important; }
.z-index-1000 { z-index: 1000 !important; }
.z-index-9000 { z-index: 9000 !important; }
.z-index-9999 { z-index: 9999 !important; }

/* Position utility classes */
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed { position: fixed !important; }
.position-sticky { position: sticky !important; }

/* ============================================
   DEBUG HELPERS (Production'da kaldırın)
   ============================================ */
/* Overlap sorunlarını görselleştirmek için */
.debug-overlap {
    outline: 2px solid red !important;
    outline-offset: -2px !important;
}

.debug-z-index::after {
    content: attr(data-z-index);
    position: absolute;
    top: 0;
    right: 0;
    background: red;
    color: white;
    padding: 2px 5px;
    font-size: 10px;
}