﻿/* ================================================================= */
/* SARASVATI v27.2 - FIXED UI (Content Spacing & Z-Index Fix)        */
/* ================================================================= */

:root {
    --primary: #E28A07; /* Turuncu */
    --primary-green: #28a745; /* Yeşil */
    --text-dark: #333;
    --gray-bg: #f5f6f8;
    --border-color: #eee;
}

/* ----------------------------------------------------------- */
/* 0. SAYFA DÜZENİ & BOŞLUKLAR (YENİ EKLENDİ)                  */
/* Header fixed olduğu için içeriğin altta kalmasını engeller  */
/* ----------------------------------------------------------- */
body {
    /* Masaüstü header yüksekliği (70px) + 5px güvenlik payı */
    padding-top: 75px !important;
}

@media (max-width: 991px) {
    body {
        /* Mobil header yüksekliği (60px) + 5px güvenlik payı */
        padding-top: 65px !important;
    }
}

/* ----------------------------------------------------------- */
/* 1. HEADER & GENEL YAPILANDIRMA                              */
/* ----------------------------------------------------------- */
#global-header-wrapper {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: #fff !important;
    /* Z-Index artırıldı: Kategori barlarının üstünde kalsın diye */
    z-index: 9000 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.site-header {
    height: 100%;
    padding: 0 15px;
}

.logo img {
    max-height: 40px;
}

/* Masaüstü Arama */
.modern-search {
    position: relative;
    width: 100%;
    max-width: 600px;
}

    .modern-search input {
        width: 100%;
        padding: 10px 15px 10px 45px;
        border-radius: 25px;
        border: 1px solid #ddd;
        background: #f9f9f9;
        outline: none;
    }

    .modern-search .search-icon {
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: #999;
    }

/* ----------------------------------------------------------- */
/* 2. MOBILE BOTTOM NAV (ALT MENÜ)                             */
/* ----------------------------------------------------------- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: #fff;
    border-top: 1px solid #eee;
    z-index: 9999; /* En üstte ama Action Sheet'in altında */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.03);
    padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 991px) {
    .mobile-bottom-nav {
        display: flex !important;
        justify-content: space-around;
        align-items: center;
    }

    #leftsidebar {
        display: none !important;
    }

    #global-header-wrapper {
        height: 60px;
    }

    .site-header .row {
        height: 60px;
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    text-decoration: none !important;
    flex: 1;
    height: 100%;
    position: relative;
}

    .nav-item i {
        font-size: 22px;
        margin-bottom: 3px;
        position: relative;
    }

    .nav-item span {
        font-size: 10px;
        font-weight: 500;
    }

    .nav-item.active, .nav-item:hover {
        color: var(--primary);
    }

.nav-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #e60000;
    color: #fff;
    font-size: 9px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    font-style: normal;
}

/* ----------------------------------------------------------- */
/* 3. ACTION SHEET (AÇILIR MENÜLER)                            */
/* ----------------------------------------------------------- */
.sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000; /* Her şeyin en üstünde */
    display: none;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s;
}

    .sheet-overlay.active {
        display: flex;
        opacity: 1;
    }

.sheet-container {
    width: 100%;
    background: #fff;
    border-radius: 20px 20px 0 0;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding-bottom: 80px !important;
}

.sheet-overlay.active .sheet-container {
    transform: translateY(0);
}

/* --- Menü Linkleri --- */
.sheet-body {
    padding: 0;
}

.sheet-link {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: #333;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none !important;
}

    .sheet-link i {
        font-size: 18px;
        width: 30px;
        color: #777;
        text-align: center;
        margin-right: 10px;
    }

    .sheet-link .arrow {
        margin-left: auto;
        font-size: 14px;
        color: #ccc;
    }

    .sheet-link:active {
        background-color: #f9f9f9;
    }

.sheet-submenu {
    background: #fcfcfc;
    border-bottom: 1px solid #eee;
}

    .sheet-submenu .sheet-link {
        padding-left: 50px;
        font-size: 14px;
        color: #555;
    }

/* --- Profil Header --- */
.sheet-custom-header {
    padding: 30px 20px;
    text-align: center;
    background: var(--primary);
    border-radius: 20px 20px 0 0;
    border-bottom: none;
}

    .sheet-custom-header.b2b {
        background: var(--primary-green);
    }

.avatar-large {
    width: 80px;
    height: 80px;
    background: #fff;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    color: var(--primary);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.sheet-custom-header.b2b .avatar-large {
    color: var(--primary-green);
}

.sheet-custom-header h4 {
    margin: 0 0 5px 0;
    font-size: 20px;
    font-weight: 700;
    color: #fff !important;
}

.sheet-custom-header span {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
}

/* ----------------------------------------------------------- */
/* 4. ARAMA OVERLAY (MOBİL İÇİN)                               */
/* ----------------------------------------------------------- */
#mobil-arama-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 10001;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

    #mobil-arama-overlay.active {
        display: flex;
    }

    #mobil-arama-overlay .close-btn {
        position: absolute;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        font-size: 30px;
        color: #333;
    }

    #mobil-arama-overlay input {
        width: 100%;
        padding: 15px;
        font-size: 18px;
        border: none;
        border-bottom: 2px solid var(--primary);
        text-align: center;
        outline: none;
    }

/* ================================================================= */
/* 5. HEADER BUTONLARI (MOBİL & DESKTOP DÜZELTİLDİ)                  */
/* ================================================================= */

/* --- A. MOBİL HEADER (Sadece Mobilde Görünsün) --- */
@media (max-width: 991px) {
    #mobile-header-auth {
        display: flex !important; /* Artık sadece mobilde flex */
        justify-content: flex-end;
        align-items: center;
        height: 100%;
    }
}

/* Masaüstünde gizle (Garanti olsun) */
@media (min-width: 992px) {
    #mobile-header-auth {
        display: none !important;
    }
}

/* --- B. ORTAK HAP TASARIMI (Hem Mobil Hem Desktop Kullanacak) --- */
.mobile-header-user,
.desktop-header-user {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    padding: 3px 3px 3px 12px;
    border-radius: 30px;
    background: rgba(0,0,0,0.04); /* Varsayılan gri */
    transition: 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}

    /* Hover Efekti (Masaüstü için) */
    .desktop-header-user:hover {
        background: rgba(0,0,0,0.08);
    }

    /* B2C (Turuncu) Tema */
    .mobile-header-user.b2c,
    .desktop-header-user.b2c {
        background: #fff3e0;
    }

        .mobile-header-user.b2c .name-small,
        .desktop-header-user.b2c .name-small {
            color: var(--primary);
        }

        .mobile-header-user.b2c .avatar-small,
        .desktop-header-user.b2c .avatar-small {
            background: var(--primary);
            color: #fff;
        }

    /* B2B (Yeşil) Tema */
    .mobile-header-user.b2b,
    .desktop-header-user.b2b {
        background: #e8f5e9;
    }

        .mobile-header-user.b2b .name-small,
        .desktop-header-user.b2b .name-small {
            color: var(--primary-green);
        }

        .mobile-header-user.b2b .avatar-small,
        .desktop-header-user.b2b .avatar-small {
            background: var(--primary-green);
            color: #fff;
        }

/* İsim ve Avatar Stilleri */
.name-small {
    font-size: 13px;
    font-weight: 700;
    margin-right: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px !important; /* Uzun isimler için genişletildi */
}

.avatar-small {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* --- C. MASAÜSTÜ SEPET ROZETİ (KESİN ÇÖZÜM) --- */
.header-cart-btn {
    position: relative;
    /* Font-size buradan kaldırıldı, aşağıda i etiketine verildi */
    color: #555;
    margin-left: 20px;
    display: flex;
    align-items: center;
    justify-content: center; /* İkonu ve rozeti hizalar */
    text-decoration: none !important;
    transition: all 0.2s;
    width: 40px; /* Tıklama alanı genişliği */
    height: 40px; /* Tıklama alanı yüksekliği */
}

    /* İKONU BURADA BÜYÜTÜYORUZ */
    .header-cart-btn i {
        font-size: 30px !important; /* Temayı ezip geçer */
        line-height: 1;
        color: #555;
    }

    .header-cart-btn:hover i {
        color: var(--primary);
        transform: scale(1.1);
    }

#sepet-badge-desktop {
    position: absolute;
    top: -2px;
    right: -5px;
    background: #e60000;
    color: #fff;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 2px solid #fff;
    z-index: 10;
}


/* ================================================================= */
/* 7. MOBİL GÖRÜNÜM & FİLTRE BARI DÜZELTMELERİ (GENİŞLETİLMİŞ)       */
/* ================================================================= */

@media (max-width: 991px) {
    /* A. Sayfa Gövdesini Header Altından Kurtarma */
    body, section.content, .main-content {
        padding-top: 65px !important;
    }

    /* B. Filtre Barı */
    .nav-tabs, .nav-pills, .filter-bar, ul.nav {
        position: sticky !important;
        top: 65px !important;
        z-index: 800;
        background-color: #fff !important;
        padding: 10px 5px !important;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        margin-bottom: 0 !important;
    }

    /* C. Ürün Listesi (Filtre barının altına girmesin) */
    .tab-content, .product-grid, .shop-page .row {
        /* GÜNCELLENDİ: 5px çok dardı, 15px ideal olacaktır */
        padding-top: 5px !important;
        background: transparent !important;
    }

    /* Hesabım sayfası bozulmasın diye sıfırlama */
    #dynamic-content-area .tab-content {
        padding-top: 0 !important;
    }
}


/* ================================================================= */
/* 8. FİLTRE BARI SOL HİZALAMA (KESİN KURAL)                         */
/* ================================================================= */

/* Masaüstü Görünümde */
@media (min-width: 992px) {
    /* Filtre barının olduğu alanın sol boşluğunu zorla kaldır */
    .tab-content,
    .nav-tabs,
    .nav-pills,
    .filter-bar {
        padding-left: 0 !important;
        margin-left: 0 !important;
    }

    /* Eğer butonlar bir container içindeyse */
    .container-fluid > .row > .col-12 > .nav {
        padding-left: 0 !important;
    }
}

/* ================================================================= */
/* 10. SİPARİŞ KARTLARI (SABİT & HATASIZ GÖRÜNÜM)                    */
/* ================================================================= */

/* Sipariş Durum Rozeti */
.order-status-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    color: #fff;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

    /* Badge Renkleri */
    .order-status-badge.badge-success {
        background-color: #28a745;
    }

    .order-status-badge.badge-warning {
        background-color: #ffc107;
        color: #333;
    }

    .order-status-badge.badge-danger {
        background-color: #dc3545;
    }

    .order-status-badge.badge-info {
        background-color: #17a2b8;
    }

    .order-status-badge.badge-primary {
        background-color: #007bff;
    }

/* Kartın Genel Yapısı */
.pro-fav-card {
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    /* Kartın kendisi oynamasın, sadece gölgesi değişsin */
    transition: box-shadow 0.2s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

    .pro-fav-card:hover {
        /* Hareket yok, sadece gölge belirginleşsin */
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

/* Resim Alanı */
.pro-fav-img-wrapper {
    width: 100%;
    padding-top: 100%; /* 1:1 Kare */
    position: relative;
    background: #f9f9f9;
    overflow: hidden; /* Resim taşarsa gizle */
}

    /* --- KRİTİK DÜZELTME BURADA --- */
    .pro-fav-img-wrapper img {
        position: absolute;
        top: 50%;
        left: 50%;
        /* Temanın hover efektlerinin bu ayarı bozmasını engelliyoruz (!important) */
        transform: translate(-50%, -50%) !important;
        max-width: 90%;
        max-height: 90%;
        /* Resim üzerinde hiçbir animasyon olmasın (kaymayı engeller) */
        transition: none !important;
    }

/* Hover durumunda bile transform'un değişmediğinden emin olalım */
.pro-fav-card:hover .pro-fav-img-wrapper img {
    transform: translate(-50%, -50%) !important;
}

/* İçerik Alanı */
.pro-fav-body {
    padding: 12px;
}

.pro-fav-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pro-fav-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.btn-fav-action {
    display: block;
    width: 100%;
    text-align: center;
    background: #fff;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 6px;
    font-size: 12px;
    border-radius: 5px;
    text-decoration: none !important;
    font-weight: 600;
    transition: 0.2s;
}

    .btn-fav-action:hover {
        background: var(--primary);
        color: #fff;
    }


/* ================================================================= */
/* 11. ADRES KARTLARI (PRO GÖRÜNÜM)                                  */
/* ================================================================= */

.pro-address-card {
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fff;
    display: flex;
    flex-direction: column;
    /* Hareket yok, sadece gölge */
    transition: box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
}

    .pro-address-card:hover {
        box-shadow: 0 8px 20px rgba(0,0,0,0.08);
        border-color: #e0e0e0;
    }

/* Başlık Alanı */
.pac-header {
    padding: 15px;
    background: #fcfcfc;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pac-title {
    font-weight: 700;
    color: #333;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.pac-badge.default {
    background: #28a745; /* Yeşil */
    color: #fff;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 600;
}

/* İçerik Alanı */
.pac-body {
    padding: 15px;
    flex: 1; /* Kartın ortasını doldurur */
}

.pac-name {
    font-weight: 700;
    font-size: 15px;
    color: #444;
    margin-bottom: 5px;
}

.pac-text {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
    min-height: 40px; /* Hizalama için min yükseklik */
}

.pac-info {
    font-size: 12px;
    color: #555;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
}

    .pac-info i {
        width: 20px;
        text-align: center;
        margin-right: 5px;
        font-size: 14px;
    }

/* Alt Butonlar */
.pac-footer {
    padding: 12px 15px;
    border-top: 1px solid #eee;
    background: #fff;
    display: flex;
    align-items: center;
}

.btn-pac-action {
    border: 1px solid #ddd;
    background: #fff;
    color: #555;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .btn-pac-action i {
        font-size: 14px;
    }

    /* Düzenle Butonu */
    .btn-pac-action.edit:hover {
        border-color: var(--primary);
        color: var(--primary);
        background: #fff8e1;
    }

    /* Varsayılan Yap Butonu */
    .btn-pac-action.default {
        color: #28a745;
        border-color: #28a745;
    }

        .btn-pac-action.default:hover {
            background: #28a745;
            color: #fff;
        }

    /* Sil Butonu */
    .btn-pac-action.delete {
        color: #dc3545;
        border-color: #e9ecef;
    }

        .btn-pac-action.delete:hover {
            background: #dc3545;
            color: #fff;
            border-color: #dc3545;
        }


/* ================================================================= */
/* KURUMSAL (B2B) TEMA - RENK EZME KURALLARI (GÜÇLENDİRİLMİŞ)        */
/* ================================================================= */

/* 1. Ürün Kartı Fiyatları */
body.theme-b2b .product-price {
    color: #28a745 !important; /* Yeşil */
}

/* 2. Avatar Menü (Masaüstü) */
body.theme-b2b .desktop-header-user {
    background-color: #e8f5e9 !important; /* Açık Yeşil Arka Plan */
}

    body.theme-b2b .desktop-header-user .avatar-small {
        background-color: #28a745 !important; /* Yeşil Yuvarlak */
        color: #fff !important;
    }

    body.theme-b2b .desktop-header-user .name-small {
        color: #28a745 !important; /* Yeşil İsim */
    }

/* 3. Sepet İkonu ve Badge */
body.theme-b2b .header-cart-btn:hover i {
    color: #28a745 !important;
}

body.theme-b2b #sepet-badge-desktop {
    background-color: #28a745 !important;
}

/* 4. Butonlar ve Linkler */
body.theme-b2b .btn-primary,
body.theme-b2b .grup-filtre-btn.active {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
}

body.theme-b2b a {
    color: #28a745;
}

    body.theme-b2b a:hover {
        color: #1e7e34;
    }

/* ================================================================= */
/* BİLDİRİM BALONU (NOTIFY) DÜZELTMESİ                               */
/* ================================================================= */

/* Bootstrap Notify Konteyneri */
[data-notify="container"] {
    z-index: 100000 !important; /* Header'dan (9000) çok daha yüksek olmalı */
    position: fixed !important;
    top: 20px !important; /* Biraz aşağıdan başlasın */
}

    /* Alert stillerini biraz güzelleştirelim */
    [data-notify="container"].alert {
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        border-radius: 50px; /* Yuvarlak hatlar */
        padding: 10px 20px;
        border: none;
    }