/* ==========================================================================
   KITAPLA SLIDER CORE STYLES
   Version: 3.1.0
   
   NOT: Bu dosya yalnızca .kitapla-* sınıflarını kullanır.
   Woodmart veya diğer tema sınıflarıyla çakışma yaratmaz.
   ========================================================================== */

/* ==========================================================================
   NOT: Hocalar carousel'ı Woodmart tema stillerini kullanıyor.
   Arrow stilleri Woodmart'tan geliyor, burada override yok.
   ========================================================================== */

/* --- Ana Slider --- */
.kitapla-slider-wrapper {
    width: 100%;
    position: relative;
    /* Yüklenirken zıplamayı önlemek için min-height */
    min-height: 200px; 
}

.kitapla-slider-wrapper .wd-carousel-inner {
    position: relative;
}

.kitapla-swiper {
    width: 100%;
    padding: 20px 0;
    opacity: 0; /* JS yüklenene kadar gizle */
    transition: opacity 0.3s ease;
    overflow: hidden; /* Slide'ların taşmasını engelle */
}

.kitapla-swiper.swiper-initialized {
    opacity: 1;
}

.kitapla-slide {
    position: relative;
    width: 85%; /* Mobil varsayılan */
    max-width: 900px;
    border-radius: var(--wd-brd-radius, 20px);
    overflow: hidden;
    transition: transform 0.4s ease, opacity 0.4s ease;
    flex-shrink: 0;
}

/* Masaüstü Genişlik */
@media (min-width: 1025px) {
    .kitapla-slide { width: 60%; }
}
@media (min-width: 768px) and (max-width: 1024px) {
    .kitapla-slide { width: 75%; }
}

/* Solukluk Efekti (Overlay) */
.kitapla-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    opacity: 1;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 5;
    border-radius: inherit;
}

.kitapla-slide.swiper-slide-active::after {
    opacity: 0;
}

.kitapla-slide.swiper-slide-active {
    z-index: 10;
    transform: scale(1.02); /* Hafif büyüme efekti */
}

/* Görseller */
.kitapla-img-desktop, .kitapla-img-tablet, .kitapla-img-mobile {
    display: none;
    width: 100%;
    height: auto;
    border-radius: inherit;
}

/* Responsive Görsel Gösterimi */
@media (min-width: 1025px) { .kitapla-img-desktop { display: block; } }
@media (min-width: 768px) and (max-width: 1024px) { .kitapla-img-tablet { display: block; } }
@media (max-width: 767px) { .kitapla-img-mobile { display: block; } }

/* Link */
.kitapla-slide-link {
    display: block;
    text-decoration: none;
    line-height: 0;
    border-radius: inherit;
}

/* ==========================================================================
   ANA SLIDER NAVİGASYON - Woodmart Stilleri + Dikey Çubuk
   ========================================================================== */

/* Ana slider — mobil pagination dots (767px ve altı) */
.kitapla-slider-wrapper .kitapla-main-swiper-pagination {
    display: none;
}

@media (max-width: 767px) {
    .kitapla-slider-wrapper .kitapla-main-swiper-pagination {
        display: flex !important;
        justify-content: center;
        align-items: center !important;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        top: auto;
        transform: none;
        width: 100%;
        margin-top: 12px;
        margin-bottom: 24px;
        z-index: 100;
    }

    /* Tam daire: tema min-height / flex stretch oval yapmasın */
    .kitapla-slider-wrapper .kitapla-main-swiper-pagination .kitapla-main-dot {
        display: block;
        box-sizing: border-box;
        flex: 0 0 10px;
        align-self: center;
        width: 10px !important;
        height: 10px !important;
        min-width: 10px !important;
        min-height: 10px !important;
        max-width: 10px !important;
        max-height: 10px !important;
        aspect-ratio: 1 / 1;
        margin: 0 !important;
        padding: 0 !important;
        border: none;
        border-radius: 50%;
        line-height: 0;
        font-size: 0;
        overflow: hidden;
        background: rgba(249, 115, 22, 0.25);
        opacity: 1;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
        transition: background 0.25s ease;
    }

    .kitapla-slider-wrapper .kitapla-main-swiper-pagination .kitapla-main-dot-active {
        width: 10px !important;
        height: 10px !important;
        min-width: 10px !important;
        min-height: 10px !important;
        max-width: 10px !important;
        max-height: 10px !important;
        aspect-ratio: 1 / 1;
        background: #F97316;
    }

    .kitapla-slider-wrapper .wd-nav-arrows.kitapla-main-arrows {
        display: none !important;
    }

    /* Mobilde oklara ayrılan negatif margin yok; swiper padding dengesi */
    .kitapla-swiper {
        padding-bottom: 0;
    }
}

/* Ana slider okları - altta ortalı pozisyon (tablet+) */
.kitapla-slider-wrapper .wd-nav-arrows.kitapla-main-arrows {
    --wd-arrow-color: #3a3a3a;
    position: relative;
    top: auto;
    inset-inline-end: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin-top: -50px;
    margin-bottom: 30px;
    z-index: 100;
}

/* Okları her zaman görünür yap (hover gerekmez) */
.kitapla-slider-wrapper .wd-nav-arrows.kitapla-main-arrows .wd-btn-arrow {
    opacity: 1 !important;
    pointer-events: auto !important;
    position: static;
    transform: none !important;
}

/* Dikey çubuk - okların ortasında */
.kitapla-arrow-divider {
    width: 1px;
    height: 24px;
    background-color: #FFF4F2;
    display: block;
    margin: 0 8px;
}

/* Hocalar'da dikey çubuk - sadece mobilde görünür */
.kitapla-hoca-arrows .kitapla-arrow-divider {
    display: none;
}

@media (max-width: 767px) {
    .kitapla-hoca-arrows .kitapla-arrow-divider {
        display: block;
    }
}

/* --- Hocalar Modülü --- */
.kitapla-hocalar-wrapper {
    width: 100%;
    margin: 40px 0;
}

/* Branş Navigasyon */
.kitapla-brans-nav {
    display: flex;
    justify-content: center; /* Ortaya hizala */
    flex-wrap: wrap; /* Sığmazsa alt satıra geçsin (Masaüstü için) */
    align-items: center;
    gap: 20px;
    padding: 10px 5px 20px 5px;
    margin-bottom: 50px; /* Boşluk 50px yapıldı */
}

/* Mobil için özel ayar: Scroll edilebilir olsun */
@media (max-width: 767px) {
    .kitapla-brans-nav {
        justify-content: flex-start; /* Mobilde soldan başlasın ki scroll çalışsın */
        flex-wrap: nowrap; /* Mobilde tek satır kalsın */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox için scrollbar gizle */
    }
    
    .kitapla-brans-nav::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Edge için scrollbar gizle */
    }
}

.kitapla-brans-item {
    flex: 0 0 auto;
    cursor: pointer;
}

.brans-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.brans-icon img {
    max-width: 24px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.kitapla-brans-item:hover .brans-icon { transform: translateY(-3px); }
.kitapla-brans-item.active .brans-icon {
    background: #F97316;
    box-shadow: 0 8px 20px rgba(255, 43, 0, 0.3);
}
.kitapla-brans-item.active .brans-icon img {
    opacity: 1;
    filter: brightness(0) invert(1);
}

/* Hocalar Slider */
.kitapla-hocalar-container {
    position: relative;
    padding: 0 50px; /* Oklar için yer */
}

@media (max-width: 767px) {
    .kitapla-hocalar-container { 
        padding: 0 15px; /* Mobilde sağdan soldan 15px boşluk */
    }
}

.kitapla-hocalar-slider-wrap {
    position: relative;
}

/* Woodmart carousel-inner için ayar */
.kitapla-hocalar-slider-wrap .wd-carousel-inner {
    position: relative;
}

.kitapla-hocalar-swiper {
    padding: 20px 0;
}

/* --- CLS (Layout Shift) FIX --- */
/* JS Yüklenene Kadar Grid Kullan */
.kitapla-hocalar-swiper:not(.swiper-initialized) .swiper-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Mobil: 2 sütun */
    gap: 15px;
    overflow: hidden;
}

@media (min-width: 768px) {
    .kitapla-hocalar-swiper:not(.swiper-initialized) .swiper-wrapper {
        grid-template-columns: repeat(3, 1fr); /* Tablet: 3 sütun */
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .kitapla-hocalar-swiper:not(.swiper-initialized) .swiper-wrapper {
        grid-template-columns: repeat(4, 1fr); /* Masaüstü: 4 sütun */
        gap: 30px;
    }
}
/* ----------------------------- */

.hoca-slide {
    text-align: center;
    transition: transform 0.3s;
}

.hoca-slide:hover { transform: translateY(-5px); }

.hoca-brans-classic {
    display: block;
    font-size: 12px;
    color: #F97316;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.hoca-name-classic {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px;
}

/* Hoca görseli: varsayılan + üzerine gelince hover görseli */
.hoca-image-inner {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 10px;
}

.hoca-img-default,
.hoca-img-hover {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    transition: opacity 0.35s ease;
}

.hoca-image-inner .hoca-img-hover {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    opacity: 0;
    pointer-events: none;
}

.hoca-slide:hover .hoca-image-inner.hoca-has-hover-img .hoca-img-hover,
.hoca-slide:focus-within .hoca-image-inner.hoca-has-hover-img .hoca-img-hover {
    opacity: 1;
}

.hoca-slide:hover .hoca-image-inner.hoca-has-hover-img .hoca-img-default,
.hoca-slide:focus-within .hoca-image-inner.hoca-has-hover-img .hoca-img-default {
    opacity: 0;
}

/* Seçili hoca: çerçeve yok; hover görseli kalıcı (ikinci görsel aktif) */
.hoca-slide.is-kitapla-selected .hoca-image-inner.hoca-has-hover-img .hoca-img-hover {
    opacity: 1;
}

.hoca-slide.is-kitapla-selected .hoca-image-inner.hoca-has-hover-img .hoca-img-default {
    opacity: 0;
}

.hoca-image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

/* Hoca — ürünü olan kartlar (tıklanabilir); seçimde görsel etrafında çizgi yok */
.hoca-slide--has-products {
    cursor: pointer;
}

.hoca-slide--has-products:focus-visible {
    outline: none;
}

/* Hoca altı ürün paneli (WooCommerce) */
.kitapla-hoca-products-panel {
    margin-top: 24px;
    padding: 8px 0 24px;
    overflow: visible;
}

.kitapla-hoca-products-heading {
    font-style: normal;
    font-weight: 400;
    font-size: 18px;
    line-height: 22px;
    text-align: center;
    color: #3A3A3A;
    margin: 0 0 20px;
    padding: 0 16px;
}

.kitapla-hoca-products-loading,
.kitapla-hoca-products-empty {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin: 0;
    padding: 16px;
}

/* Yatay kart sırası (Kitapla ürün şeridi); Woodmart div.products + div.wd-product */
.kitapla-hoca-products-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 20px;
    width: 100%;
    justify-content: center;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: visible;
    padding: 8px 4px 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-snap-type: x mandatory;
    margin: 0;
    box-sizing: border-box;
}

.kitapla-hoca-products-grid::-webkit-scrollbar {
    height: 6px;
}

.kitapla-hoca-products-grid::-webkit-scrollbar-thumb {
    background: rgba(249, 115, 22, 0.35);
    border-radius: 3px;
}

@media (min-width: 1024px) {
    .kitapla-hoca-products-grid {
        flex-wrap: wrap;
        justify-content: center;
        overflow-x: visible;
        scroll-snap-type: none;
    }
}

/* Tema ürün kartı (content-product) — yatay şerit genişliği. Kabuk: WoodMart .wd-products-with-bg / .products-bordered-grid-ins ile aynı mantık (CSS değişkenleri + .product-wrapper). */
.kitapla-hoca-products-grid > .product {
    display: flex;
    flex-direction: column;
    flex: 0 0 min(78vw, 260px);
    max-width: 280px;
    scroll-snap-align: start;
    margin: 0;
    background: transparent;
    height: 450px;
}

@media (min-width: 1024px) {
    .kitapla-hoca-products-grid > .product {
        display: flex;
        flex-direction: column;
        flex: 1 1 0;
        min-width: 200px;
        max-width: 280px;
        background: transparent;
        height: 460px;
    }
}

/* WoodMart 8.3.8 (hoca ürün şeridi): dış kutu (görseldeki gibi beyaz + ince border) + iç layout */
.kitapla-hoca-products-grid > .product .product-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    background-color: var(--wd-prod-bg, #ffffff);
    /* border: 1px solid var(--wd-bordered-brd, var(--brdcolor-gray-300, #e5e7eb)); */
    /* border-radius: var(--wd-brd-radius, 15px); */
    overflow: hidden;
    --wd-bordered-brd: #FFF4F2;
}

.kitapla-hoca-products-grid > .product .product-element-bottom {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: var(--wd-prod-gap, 10px);
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 15px;
}

.kitapla-hoca-products-grid > .product .product-element-bottom .wd-add-btn.wd-add-btn-replace {
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Uzun ürün adı: 2 satır, taşan metin kısılır */
.kitapla-hoca-products-grid .product-element-bottom h3.wd-entities-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
    margin: 0;
    max-width: 100%;
}

.kitapla-hoca-products-grid .product-element-bottom h3.wd-entities-title a {
    color: inherit;
    display: inline;
}

.kitapla-hoca-product-card {
    flex: 0 0 min(78vw, 260px);
    max-width: 260px;
    text-align: center;
    background: #fff;
    border-radius: 15px;
    padding: 20px 18px 18px;
    border: 1px solid #eee;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
    scroll-snap-align: start;
}

@media (min-width: 1024px) {
    .kitapla-hoca-product-card {
        flex: 1 1 0;
        min-width: 200px;
        max-width: 280px;
    }
}

.kitapla-hoca-product-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.kitapla-hoca-product-card-link:hover {
    opacity: 0.95;
}

/* Kapak + yumuşak yansıma */
.kitapla-hoca-product-card-media {
    position: relative;
    margin: 0 auto;
    max-width: 100%;
}

.kitapla-hoca-product-card-img {
    display: block;
    overflow: visible;
    border-radius: 12px;
    background: transparent;
}

.kitapla-hoca-product-card-img img {
    width: 100%;
    max-width: 200px;
    height: auto;
    margin: 0 auto;
    display: block;
    vertical-align: top;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.kitapla-hoca-img-reflection {
    display: block;
    height: 28px;
    margin: 6px auto 0;
    max-width: 180px;
    border-radius: 50%;
    background: radial-gradient(ellipse 80% 100% at 50% 0%, rgba(0, 0, 0, 0.12) 0%, rgba(249, 115, 22, 0.06) 35%, transparent 72%);
    transform: scaleY(0.45);
    opacity: 0.85;
    pointer-events: none;
}

.kitapla-hoca-product-card-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-top: 14px;
    line-height: 1.35;
    color: #1a1a1a;
}

.kitapla-hoca-product-card-brand {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-top: 6px;
    color: #F97316;
}

.kitapla-hoca-product-card-price {
    display: block;
    font-size: 15px;
    margin-top: 8px;
    color: #1a1a1a;
    font-weight: 700;
}

.kitapla-hoca-product-card-price del {
    color: #888;
    font-weight: 500;
    font-size: 13px;
}

.kitapla-hoca-product-card-price ins {
    text-decoration: none;
    color: #1a1a1a;
}

/* Sepete ekle — hap buton, turuncu + ikon */
.kitapla-hoca-product-card-footer {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.kitapla-hoca-product-card-footer a.button,
.kitapla-hoca-product-card-footer a.add_to_cart_button,
.kitapla-hoca-product-card-footer a.product_type_variable,
.kitapla-hoca-product-card-footer a.product_type_grouped,
.kitapla-hoca-product-card-footer .added_to_cart {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none !important;
    min-height: 44px;
    padding: 10px 22px 10px 14px !important;
    border-radius: 50px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    box-sizing: border-box;
    border: none !important;
    box-shadow: none !important;
    background: rgba(249, 115, 22, 0.1) !important;
    color: #F97316 !important;
}

.kitapla-hoca-product-card-footer a.add_to_cart_button::before,
.kitapla-hoca-product-card-footer a.product_type_variable::before,
.kitapla-hoca-product-card-footer a.product_type_grouped::before,
.kitapla-hoca-product-card-footer a.product_type_external::before {
    content: '+';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #F97316;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

/* Woodmart / tema ekstra ikonlarını tekilleştir */
.kitapla-hoca-product-card-footer a.add_to_cart_button .wd-icon,
.kitapla-hoca-product-card-footer a.add_to_cart_button svg:first-of-type {
    display: none !important;
}

.kitapla-hoca-product-card-footer .added_to_cart {
    background: rgba(249, 115, 22, 0.08) !important;
    font-size: 13px !important;
    padding: 8px 16px !important;
}

.kitapla-hoca-product-card-footer .added_to_cart::before {
    display: none !important;
}

/* ==========================================================================
   HOCALAR NAVİGASYON - Woodmart Stilleri Kullanılıyor
   ========================================================================== */

/* Hocalar ok stilleri */
.kitapla-hocalar-slider-wrap .wd-nav-arrows {
    --wd-arrow-color: #3a3a3a;
}

/* Tablet - Oklar için offset */
@media (max-width: 1024px) {
    .kitapla-hocalar-slider-wrap .wd-nav-arrows.wd-pos-sep {
        --wd-arrow-offset-h: -10px;
    }
}

@media (max-width: 767px) {
    .kitapla-hocalar-slider-wrap .wd-nav-arrows.wd-pos-sep {
        position: relative;
        top: auto;
        transform: none;
        justify-content: center;
        gap: 15px;
        margin-top: 20px;
        display: flex;
    }
    
    .kitapla-hocalar-slider-wrap .wd-nav-arrows.wd-pos-sep .wd-btn-arrow {
        position: static;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    .kitapla-hocalar-slider-wrap .wd-nav-arrows.wd-pos-sep:after {
        display: none;
    }
}
