/**
 * WooCommerce Ürün Filtresi - Frontend Stilleri
 */

/* Mobil filtre açıkken body scroll'u engelle */
body.wpf-mobile-filter-open {
    overflow: hidden;
}

/* Genel Container */
.wpf-filter-widget {
    background: #fff;
    padding: 20px;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    margin-bottom: 30px;
}

.wpf-filter-widget h3.wpf-widget-title {
    margin: 0 0 20px 0;
    padding: 0 0 10px 0;
    border-bottom: 2px solid #333;
    font-size: 18px;
    font-weight: 600;
}

/* Filtre Bölümleri - Accordion (Tüm ekranlar) */
.wpf-filter-section {
    margin-bottom: 15px;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    overflow: hidden;
}

.wpf-filter-section:last-of-type {
    margin-bottom: 0;
}

.wpf-filter-title {
    margin: 0;
    padding: 12px 15px;
    background: #f5f5f5;
    cursor: pointer;
    position: relative;
    user-select: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    color: #333;
    letter-spacing: 0.5px;
    transition: background 0.2s ease;
}

.wpf-filter-title:hover {
    background: #ececec;
}

.wpf-filter-title:after {
    content: "▼";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
    font-size: 12px;
}

.wpf-filter-section.collapsed .wpf-filter-title:after {
    transform: translateY(-50%) rotate(-90deg);
}

/* Filtre Seçenekleri - Accordion */
.wpf-filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.wpf-filter-section.collapsed .wpf-filter-options {
    max-height: 0;
    padding: 0 15px;
    overflow: hidden;
}

.wpf-filter-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px 0;
    transition: all 0.2s ease;
}

.wpf-filter-option:hover {
    color: #0073aa;
}

.wpf-filter-checkbox {
    margin: 0 10px 0 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.wpf-option-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    line-height: 1.4;
}

.wpf-count {
    color: #999;
    font-size: 12px;
}

.wpf-no-options {
    color: #999;
    font-style: italic;
    font-size: 13px;
}

/* Filtre Butonları */
.wpf-filter-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.wpf-filter-button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wpf-apply-filter {
    background: #333;
    color: #fff;
}

.wpf-apply-filter:hover {
    background: #000;
}

.wpf-reset-filter {
    background: #f5f5f5;
    color: #333;
}

.wpf-reset-filter:hover {
    background: #e1e1e1;
}

.wpf-filter-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Aktif Filtreler */
.wpf-active-filters {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.wpf-active-filters-title {
    margin: 0 0 15px 0;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
}

.wpf-active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wpf-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #e1e1e1;
    border-radius: 20px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wpf-active-filter:hover {
    background: #e1e1e1;
}

.wpf-remove-filter {
    font-size: 18px;
    line-height: 1;
    color: #999;
    font-weight: 600;
}

.wpf-active-filter:hover .wpf-remove-filter {
    color: #333;
}

/* Loading State */
.wpf-filter-widget.wpf-loading {
    opacity: 0.6;
    pointer-events: none;
}

.wpf-filter-widget.wpf-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: wpf-spin 1s linear infinite;
}

@keyframes wpf-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .wpf-filter-widget {
        padding: 15px;
    }
    
    .wpf-filter-buttons {
        flex-direction: column;
    }
    
    .wpf-filter-button {
        width: 100%;
    }
}

/* Shortcode Özel Stilleri */
.wpf-shortcode {
    max-width: 100%;
}

/* Filtre + Ürünler Container */
.wpf-filter-products-container {
    display: flex;
    gap: 30px;
    margin: 20px 0;
}

/* Sidebar Layout (Varsayılan) */
.wpf-filter-products-container.wpf-layout-sidebar {
    flex-direction: row;
    align-items: flex-start;
}

.wpf-filter-products-container.wpf-layout-sidebar .wpf-filter-sidebar {
    flex: 0 0 30%;
    width: 30%;
    max-width: 30%;
}

.wpf-filter-products-container.wpf-layout-sidebar .wpf-products-area {
    flex: 0 0 70%;
    width: 70%;
    max-width: 70%;
}

/* Top Layout */
.wpf-filter-products-container.wpf-layout-top {
    flex-direction: column;
}

.wpf-filter-products-container.wpf-layout-top .wpf-filter-sidebar {
    width: 100%;
}

.wpf-filter-products-container.wpf-layout-top .wpf-products-area {
    width: 100%;
}

/* Ürünler Alanı */
.wpf-products-area {
    position: relative;
}

.wpf-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e1e1;
}

.wpf-results-count {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.wpf-found-products {
    color: #666;
}

.wpf-active-filters-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Ürün Listesi */
.wpf-products-list {
    position: relative;
    min-height: 300px;
}

.wpf-products-list .products {
    display: grid;
    gap: 20px;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.wpf-products-list .products::before {
    display: none !important;
}

.wpf-products-list .products li {
    list-style: none !important;
    list-style-type: none !important;
}

.wpf-products-list .products li::before,
.wpf-products-list .products li::marker {
    display: none !important;
    content: none !important;
}

.wpf-products-list .products.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.wpf-products-list .products.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.wpf-products-list .products.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.wpf-products-list .products.columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.wpf-products-list .products.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Ürün Kartı */
.wpf-products-list .product {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    list-style: none !important;
    display: flex;
    flex-direction: column;
}

.wpf-products-list .product::before {
    display: none !important;
    content: none !important;
}

.wpf-products-list .product:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.wpf-products-list .product a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
    overflow: hidden;
}

.wpf-products-list .product img {
    width: 100%;
    height: auto;
    display: block;
}

.wpf-products-list .product .woocommerce-loop-product__title {
    font-size: 18px;
    font-weight: 600;
    margin: 15px;
    padding-bottom: 15px;
    color: #000;
    line-height: 1.4;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* Fiyat ve sepete ekle gizle */
.wpf-products-list .product .price,
.wpf-products-list .product .button,
.wpf-products-list .product .add_to_cart_button,
.wpf-products-list .product .added_to_cart,
.wpf-products-list .product .product_type_simple,
.wpf-products-list .product .product_type_variable,
.wpf-products-list .product .ajax_add_to_cart {
    display: none !important;
}

/* Loading Overlay */
.wpf-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.wpf-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: wpf-spin 1s linear infinite;
}

/* Boş Sonuç */
.wpf-products-list .woocommerce-info {
    text-align: center;
    padding: 40px 20px;
    background: #f5f5f5;
    border-radius: 4px;
    color: #666;
    font-size: 16px;
}

/* Pagination */
.wpf-products-list .woocommerce-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 40px;
    padding: 20px 0;
}

.wpf-products-list .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    background: #fff;
    border: 2px solid #000;
    color: #000;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.wpf-products-list .page-numbers:hover {
    background: #000;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.wpf-products-list .page-numbers.current {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220,53,69,0.4);
}

.wpf-products-list .prev,
.wpf-products-list .next {
    font-weight: 700;
    padding: 12px 24px;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .wpf-filter-products-container.wpf-layout-sidebar {
        flex-direction: column;
    }
    
    .wpf-filter-products-container.wpf-layout-sidebar .wpf-filter-sidebar {
        flex: 1;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .wpf-filter-products-container.wpf-layout-sidebar .wpf-products-area {
        flex: 1;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .wpf-products-list .products.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .wpf-products-list .product .woocommerce-loop-product__title {
        font-size: 18px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .wpf-filter-products-container {
        gap: 20px;
    }
    
    /* Mobilde filtre sidebar'ı gizle, toggle buton göster */
    .wpf-filter-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100%;
        max-height: 100vh;
        background: #fff;
        z-index: 9999;
        overflow-y: auto !important;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        padding: 0;
    }
    
    .wpf-filter-sidebar > * {
        padding: 60px 20px 30px 20px;
    }
    
    
    .wpf-filter-sidebar.active {
        left: 0;
    }
    
    /* Mobil filtre overlay */
    .wpf-mobile-filter-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
    }
    
    .wpf-mobile-filter-overlay.active {
        display: block;
    }
    
    /* Mobil filtre toggle butonu - Sadece mobilde göster */
    .wpf-mobile-filter-toggle {
        display: block !important;
        width: 100%;
        padding: 12px 20px;
        background: #333;
        color: #fff;
        border: none;
        border-radius: 4px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: 15px;
        text-align: center;
    }
    
    
    /* Mobil filtre kapatma butonu - Sadece mobilde göster */
    .wpf-mobile-filter-close {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        background: #333;
        color: #fff;
        border: none;
        border-radius: 50%;
        font-size: 22px;
        font-weight: 300;
        cursor: pointer;
        z-index: 10001;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        padding: 0;
        line-height: 1;
    }
    
    .wpf-mobile-filter-close:hover {
        background: #e74c3c;
    }
    
    /* Mobilde filtre bölümlerini accordion yap */
    .wpf-filter-section {
        margin-bottom: 10px;
        border: 1px solid #e1e1e1;
        border-radius: 4px;
        overflow: hidden;
    }
    
    .wpf-filter-title {
        margin: 0;
        padding: 12px 15px;
        background: #f5f5f5;
        cursor: pointer;
        position: relative;
        user-select: none;
        font-size: 14px;
    }
    
    .wpf-filter-title:after {
        content: "▼";
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        transition: transform 0.3s ease;
        font-size: 12px;
    }
    
    .wpf-filter-section.collapsed .wpf-filter-title:after {
        transform: translateY(-50%) rotate(-90deg);
    }
    
    .wpf-filter-options {
        display: block;
        padding: 10px 15px;
        opacity: 1;
        transition: opacity 0.3s ease;
    }
    
    .wpf-filter-section.collapsed .wpf-filter-options {
        display: none;
        opacity: 0;
    }
    
    .wpf-filter-option {
        padding: 8px 0;
        margin: 0;
    }
    
    /* Widget title mobilde daha küçük */
    .wpf-filter-sidebar .wpf-widget-title {
        font-size: 16px;
        margin-bottom: 15px;
        padding-right: 40px;
    }
    
    /* Sıfırla butonu mobilde tam genişlik */
    .wpf-filter-buttons {
        margin-top: 15px;
    }
    
    .wpf-reset-filter {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    .wpf-products-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .wpf-products-list .products.columns-2,
    .wpf-products-list .products.columns-3,
    .wpf-products-list .products.columns-4,
    .wpf-products-list .products.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wpf-products-list .product .woocommerce-loop-product__title {
        font-size: 18px;
        margin: 10px;
    }
    
    .wpf-products-list .product .price {
        font-size: 16px;
        margin: 0 10px 10px;
    }
}

@media (max-width: 480px) {
    .wpf-products-list .products {
        grid-template-columns: 1fr !important;
    }
}

/* WooCommerce Uyumluluğu */
.woocommerce .wpf-filter-widget {
    margin-bottom: 30px;
}

/* Sidebar Widget Stilleri */
.widget.wpf_filter_widget {
    padding: 0;
}

.widget.wpf_filter_widget .wpf-filter-widget {
    border: none;
    padding: 0;
}

/* Fiyat Aralığı (Gelecek özellik için hazır) */
.wpf-price-range {
    padding: 10px 0;
}

.wpf-price-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.wpf-price-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    font-size: 14px;
}

.wpf-price-separator {
    color: #999;
}

/* Accordion Stili (Gelecek özellik için hazır) */
.wpf-filter-section.wpf-accordion .wpf-filter-title {
    cursor: pointer;
    position: relative;
    padding-right: 25px;
}

.wpf-filter-section.wpf-accordion .wpf-filter-title::after {
    content: '\25BC';
    position: absolute;
    right: 0;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.wpf-filter-section.wpf-accordion.wpf-collapsed .wpf-filter-title::after {
    transform: rotate(-90deg);
}

.wpf-filter-section.wpf-accordion.wpf-collapsed .wpf-filter-options {
    display: none;
}

/* Renk Swatches (Gelecek özellik için hazır) */
.wpf-color-swatch {
    display: inline-block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #e1e1e1;
    margin-right: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wpf-color-swatch:hover,
.wpf-color-swatch.selected {
    border-color: #333;
    transform: scale(1.1);
}

