/* Theme Name: MakerList Anasayfa
   Description: Sadece Banner ve Filamentler (Slider CSS Kaldırıldı)
   Version: 18.0 - BUTON HİZALAMA FIX (Always Bottom)
*/

/* =========================================
   1. GENEL AYARLAR (GLOBAL RESET)
   ========================================= */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    background-color: #f8fafc;
    color: #1f2937;
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; margin: 0; padding: 0; }

/* Genel Konteyner */
.ml-container {
    max-width: 1440px; 
    width: 96%; 
    margin: 0 auto;
    padding: 0; 
}


/* =========================================
   HEADER BÖLÜMÜ STİLLERİ
   ========================================= */

/* --- Top Bar (En Üst İnce Şerit) --- */
.ml-top-bar {
    background: #0f172a;
    color: #ffffff;
    font-size: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 20px;
}

.top-links a { margin-left: 15px; opacity: 0.8; text-decoration: none; color: inherit; }
.top-links a:hover { opacity: 1; }

/* --- Middle Header (Logo & Arama) --- */
.ml-middle-header {
    background: #ffffff;
    padding: 20px 0;
    border-bottom: 1px solid #e5e7eb;
}

.ml-middle-header .ml-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    max-width: 1440px;
    margin: 0 auto;
    width: 96%;
}

.ml-logo img { max-width: 180px; height: auto; display: block; }

.ml-search-box {
    flex: 1;
    margin: 0 60px;
    position: relative;
}

.ml-search-box input {
    width: 100%;
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 14px;
    outline: none;
}

.ml-search-box button {
    position: absolute;
    right: 5px; top: 5px; bottom: 5px;
    width: 40px;
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.ml-header-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.header-action-item {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #1f2937;
}

/* --- Navigation (Menü) --- */
.ml-navigation {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    /* Z-Index Arttırıldı */
    z-index: 99999;
}

.ml-navigation .ml-container {
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1440px;
    margin: 0 auto;
    width: 96%;
}

ul.ml-nav-menu {
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

ul.ml-nav-menu > li > a {
    display: block;
    padding: 18px 25px;
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    white-space: nowrap;
    text-decoration: none;
    transition: 0.3s;
}

ul.ml-nav-menu > li:hover > a {
    color: #4f46e5;
    background: #f9fafb;
}

/* Dropdown (Alt Menü) */
ul.ml-nav-menu li { position: relative; }

ul.ml-nav-menu .sub-menu {
    position: absolute;
    top: 100%; left: 0;
    background: #ffffff;
    min-width: 240px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    display: none;
    border-radius: 0 0 12px 12px;
    /* Alt Menü Z-Index */
    z-index: 100000;
}

ul.ml-nav-menu li:hover .sub-menu { display: block; }

ul.ml-nav-menu .sub-menu li a {
    padding: 12px 20px;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
    display: block;
    text-decoration: none;
    color: inherit;
}

ul.ml-nav-menu .sub-menu li a:hover {
    padding-left: 25px;
    color: #4f46e5;
}

.ml-nav-right { margin-left: auto; }

.vendor-link {
    background: #fef3c7;
    color: #92400e;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

/* --- HEADER MOBİL DÜZENLEMELERİ --- */

/* Mobil Menü İkonu (Masaüstünde Gizli) */
.ml-mobile-menu-toggle {
    display: none;
    font-size: 24px;
    color: #1f2937;
    cursor: pointer;
    padding: 10px;
    margin-right: 15px; /* Logodan biraz uzaklaşsın */
}

/* Mobil Menü Başlığı (Kapatma Butonu Alanı) */
.mobile-nav-header { display: none; }

/* Mobil Overlay */
.ml-mobile-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 9998;
    display: none; opacity: 0; transition: opacity 0.3s ease;
}
.ml-mobile-overlay.active { display: block; opacity: 1; }

@media (max-width: 992px) {
    
    /* --- 1. HEADER DÜZENİ (LOGO VE ARAMA ÇAKIŞMASI FIX) --- */
    .ml-middle-header {
        padding: 10px 0;
        position: relative;
    }

    .ml-middle-header .ml-container {
        display: flex;
        flex-wrap: wrap; /* İçerik taşarsa aşağı geçsin */
        align-items: center;
        justify-content: space-between;
    }

    /* Hamburger İkonu - SOL */
    .ml-mobile-menu-toggle {
        display: block !important;
        font-size: 22px;
        color: #1f2937;
        cursor: pointer;
        order: 1; /* İlk sırada */
        width: 40px;
    }

    /* Logo - ORTADA (Mutlak Konumlandırma ile) */
    .ml-logo {
        order: 2;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        top: 10px;
        z-index: 10;
        text-align: center;
    }
    
    .ml-logo img {
        max-width: 120px !important; /* Logo mobilde küçülsün */
        height: auto;
    }

    /* Sağ Butonlar (Sepet/Hesap) - SAĞ */
    .ml-header-actions {
        order: 3;
        margin-left: auto;
        gap: 15px;
    }
    
    .action-text { display: none; } /* Mobilde yazıları gizle */
    .header-action-item i { font-size: 20px; }

    /* Arama Kutusu - EN ALTTA (Yeni Satır) */
    .ml-search-box {
        order: 4; /* En sonda */
        width: 100%;
        margin: 15px 0 5px 0;
        flex-basis: 100%; /* Tam genişlik */
    }

    /* --- 2. MOBİL MENÜ (YAN PANEL / OFF-CANVAS) --- */
    .ml-navigation {
        position: fixed;
        top: 0;
        left: -320px; /* Ekran dışına it */
        width: 280px;
        height: 100vh;
        background: #ffffff;
        z-index: 99999; /* En üstte */
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        overflow-y: auto;
        display: block !important; /* Her zaman render et */
        padding-bottom: 40px;
    }

    .ml-navigation.active {
        left: 0; /* İçeri kaydır */
    }

    /* Menü Başlığı */
    .mobile-nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        background: #f9fafb;
        border-bottom: 1px solid #e5e7eb;
    }
    .mobile-nav-header span { font-weight: 800; font-size: 16px; color: #111827; }
    #closeMobileMenu { background: none; border: none; font-size: 20px; color: #6b7280; }

    /* Menü Listesi (Kategoriler) - GÖRÜNÜRLÜK FIX */
    .ml-navigation .ml-container {
        padding: 0;
        display: block;
    }

    ul.ml-nav-menu {
        display: flex !important; /* Flex zorla */
        flex-direction: column !important;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    ul.ml-nav-menu > li {
        width: 100%;
        border-bottom: 1px solid #f3f4f6;
        display: block !important;
    }

    ul.ml-nav-menu > li > a {
        padding: 15px 20px;
        font-size: 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
    }

    /* Dropdown Okları */
    .menu-item-has-children > a::after {
        content: "\f078";
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        font-size: 12px;
        color: #9ca3af;
        transition: transform 0.3s;
    }
    
    .menu-item-has-children.open > a::after {
        transform: rotate(180deg);
    }

    /* Alt Menü (Dropdown) */
    ul.ml-nav-menu .sub-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        background: #f9fafb;
        display: none; /* JS ile açılacak */
        opacity: 1; visibility: visible; 
        padding: 0;
        margin: 0;
    }
    
    .menu-item-has-children.open .sub-menu {
        display: block !important; /* JS class ekleyince görünür yap */
    }

    ul.ml-nav-menu .sub-menu li a {
        padding: 12px 20px 12px 40px; /* Girintili */
        font-size: 14px;
        color: #4b5563;
        border-bottom: 1px solid #eee;
    }

    /* Satıcı Butonu */
    .ml-nav-right {
        margin: 20px;
        display: block !important;
    }
    .vendor-link {
        display: block;
        text-align: center;
        width: 100%;
        padding: 12px;
    }

    /* --- DİĞER MOBİL DÜZENLEMELER --- */
    .ml-section-hero { height: 250px !important; margin-top: 10px !important; }
    .sub-slider-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .sub-banner-item { height: 100px !important; }
    
    html body .products-wrapper ul.products { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    html body .products-wrapper ul.products li.product { padding: 10px !important; min-height: auto !important; }
    html body .products-wrapper ul.products li.product a img { height: 160px !important; }
    
    /* Başlık */
    html body .ml-section-header-row { flex-direction: column !important; align-items: flex-start !important; gap: 8px !important; }
    html body .ml-section-header-row h2 { font-size: 20px !important; }
    html body .view-all-btn { font-size: 13px !important; margin-left: 0 !important; }
}


/* =========================================
   3. ANASAYFA İÇERİĞİ (SLIDER & ÜRÜNLER)
   ========================================= */

/* --- Hero Slider (Büyük) --- */
.ml-section-hero {
    width: 96%; 
    max-width: 1440px; 
    margin: 20px auto 30px auto; 
    height: 550px; 
    position: relative;
    overflow: hidden;
    background-color: #0f172a;
    border-radius: 20px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.2);
    z-index: 1;
}

.ml-hero-slider-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
}

.ml-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center center;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

.ml-slide.active { opacity: 1; z-index: 2; }

/* Slider Okları */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px; height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(6px);
}
.slider-btn:hover { background: #ffffff; color: #0f172a; }
.slider-btn.prev { left: 30px; }
.slider-btn.next { right: 30px; }


/* --- Slider Altı Bannerlar (4'lü Kutu) --- */
.ml-sub-slider-section {
    width: 96%;
    max-width: 1440px;
    margin: 24px auto 60px auto; 
    position: relative;
    z-index: 5;
}

.sub-slider-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px;
}

.sub-banner-item {
    display: block;
    height: 140px; 
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background-color: #0f172a; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.sub-banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.sub-banner-item:hover img { transform: scale(1.05); }
.sub-banner-content { display: none !important; }


/* --- Resmi Ürünler & Filamentler Bölümü --- */
html body .ml-official-products-section {
    padding: 0 0 60px 0 !important;
    background: transparent !important;
    border: none !important;
    margin: 0 !important;
    position: relative;
    z-index: 10;
    width: 100% !important;
    display: block !important;
}

/* Başlık Satırı (Yatay Hizalama - Kesin) */
html body .ml-section-header-row {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important; /* Başlık Sola, Link Sağa */
    align-items: center !important;
    width: 100% !important;
    margin: 0 0 25px 0 !important;
    padding-bottom: 0 !important;
    border-bottom: 2px solid #f3f4f6 !important; /* Alt çizgi */
    padding-bottom: 10px !important;
}

html body .ml-section-header-row h2 {
    font-size: 26px !important;
    font-weight: 800 !important;
    color: #111827 !important;
    margin: 0 !important;
    padding: 0 !important;
    letter-spacing: -0.5px !important;
    text-align: left !important;
    line-height: 1.2 !important;
}

html body .view-all-btn {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #4f46e5 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    text-decoration: none !important;
}

/* Ürün Grid */
html body .products-wrapper ul.products,
html body .woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
    justify-content: center !important;
}

html body .products-wrapper ul.products::before,
html body .products-wrapper ul.products::after { display: none !important; }

/* Tekil Ürün Kartı */
html body .products-wrapper ul.products li.product {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    padding: 16px !important;
    width: 100% !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    transition: all 0.3s ease !important;
    min-height: 460px !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    float: none !important;
}

html body .products-wrapper ul.products li.product:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    border-color: #cbd5e1 !important;
}

/* Ürün Görseli */
html body .products-wrapper ul.products li.product a img,
html body .products-wrapper img {
    width: 100% !important;
    height: 260px !important;
    object-fit: contain !important;
    margin: 0 0 16px 0 !important;
    padding: 8px !important;
    background-color: #f8fafc !important;
    border-radius: 8px !important;
    display: block !important;
}

/* Ürün Başlığı */
html body .products-wrapper .woocommerce-loop-product__title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1.4 !important;
    margin-bottom: 8px !important;
    padding: 0 !important;
    height: 44px !important; 
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    text-align: left !important;
}

/* --- MAĞAZA LOGOSU / PROFİL RESMİ GİZLEME (KESİN ÇÖZÜM) --- */
html body .products-wrapper .wcfm-store-name,
html body .products-wrapper .sold-by-meta,
html body .products-wrapper .vendor-name,
html body .products-wrapper .dokan-sold-by,
html body .products-wrapper .store-name,
html body .products-wrapper .wcfmmp_sold_by_logo, 
html body .products-wrapper img.vendor_logo,      
html body .products-wrapper .store-logo,          
html body .products-wrapper .item_vendor {        
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    position: absolute !important;
    z-index: -999 !important;
    pointer-events: none !important;
}

/* Fiyat */
html body .products-wrapper .price {
    color: #111827 !important;
    font-weight: 800 !important;
    font-size: 18px !important;
    margin-top: 5px !important;
    margin-bottom: 10px !important;
    display: block !important;
    text-align: left !important;
}

/* Sepete Ekle Butonu - EN ALTTA HİZALI */
html body .products-wrapper .button.add_to_cart_button,
html body .products-wrapper .button {
    background: #111827 !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 12px 0 !important;
    border-radius: 8px !important;
    width: 100% !important;
    display: block !important;
    text-align: center !important;
    border: none !important;
    text-decoration: none !important;
    transition: background 0.2s !important;
    margin-top: auto !important; /* Butonu her zaman en alta it */
    float: none !important;
}

html body .products-wrapper .button:hover { background: #4f46e5 !important; }


/* --- 4. ALT SABİT BANNER (YENİ - KISA VE SABİT) --- */
.ml-bottom-static-banner {
    width: 96%;
    max-width: 1440px;
    margin: 40px auto 60px auto;
    height: 250px; /* Üst sliderdan (550px) çok daha kısa */
    background-color: #0f172a;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.ml-bottom-static-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* --- 5. MOBİL UYUMLULUK --- */
@media (max-width: 768px) {
    /* Header (Menü İkonu) */
    .ml-mobile-menu-toggle { display: block; }
    
    /* Menü Gizleme & Stil */
    ul.ml-nav-menu {
        display: none; /* JS ile .active eklendiğinde görünür olacak */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #ffffff;
        flex-direction: column;
        padding: 10px 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        border-top: 1px solid #f3f4f6;
    }
    
    /* Aktif Menü (JS ile kontrol edilecek) */
    ul.ml-nav-menu.active {
        display: flex !important;
    }

    /* Slider */
    .ml-section-hero { height: 250px !important; margin-top: 10px !important; }

    /* Bannerlar */
    .sub-slider-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
    .sub-banner-item { height: 100px !important; }

    /* Ürünler - 2 Sütun */
    html body .products-wrapper ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    
    html body .products-wrapper ul.products li.product {
        min-height: 340px !important;
        padding: 10px !important;
    }
    
    html body .products-wrapper ul.products li.product a img {
        height: 160px !important;
    }
    
    /* Başlık */
    html body .ml-section-header-row h2 { font-size: 22px !important; }
    
    /* Alt Banner */
    .ml-bottom-static-banner { height: 150px !important; }
}

