/**
 * Kolay Varyant – Frontend CSS v2.0.5
 *
 * TÜM stiller .iueklenti-wrapper altında scope'lanmıştır.
 * Tema CSS'i ile çakışma riski sıfıra yakındır.
 *
 * Prefix: iueklenti-
 *
 * @author Serkan AKDENİZ <bilgi@serkanakdeniz.com>
 * @link   https://serkanakdeniz.com
 */

/* ─── v2.0.1: İkame ürünlerde Değerlendirmeler & İlgili Ürünler güvenlik ağı ─── */
.single-product.ikame-urun-aktif .related.products,
.single-product.ikame-urun-aktif .up-sells.upsells.products,
.single-product.ikame-urun-aktif section.related,
.single-product.ikame-urun-aktif section.upsells,
.single-product.ikame-urun-aktif #comments,
.single-product.ikame-urun-aktif #reviews,
.single-product.ikame-urun-aktif .woocommerce-Reviews,
.single-product.ikame-urun-aktif .woocommerce-tabs,
.single-product.ikame-urun-aktif .wc-tabs-wrapper,
.single-product.ikame-urun-aktif .wp-block-woocommerce-product-reviews,
.single-product.ikame-urun-aktif .comment-respond,
.single-product.ikame-urun-aktif .comments-area {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ─── İzole Wrapper ─── */
.iueklenti-wrapper {
    clear: both;
    width: 100%;
    max-width: 1200px;
    margin: 30px auto 0;
    padding: 0;
    box-sizing: border-box;
    /* Tema stillerinin wrapper'a sızmasını engelle */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.5;
    color: #1a1a1a;
}

/* Tema container override'ları */
.woocommerce .iueklenti-wrapper,
.single-product .iueklenti-wrapper {
    float: none;
    margin-left: auto;
    margin-right: auto;
}

/* ─── Bölüm Kapsayıcı ─── */
.iueklenti-wrapper .iueklenti-color-section {
    padding: 30px 20px 40px;
    border-top: 2px solid #e0e0e0;
}

.iueklenti-wrapper .iueklenti-section-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 20px 0;
    padding: 0;
    color: #1a1a1a;
}

/* ─── v2.0.3: Dinamik Öznitelik Filtreleri ─── */
.iueklenti-wrapper .iueklenti-filters {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}
.iueklenti-wrapper .iueklenti-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
    flex: 0 1 220px;
    max-width: 280px;
}
.iueklenti-wrapper .iueklenti-filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}
.iueklenti-wrapper .iueklenti-filter-select {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #1a1a1a;
    cursor: pointer;
    transition: border-color .2s;
}
.iueklenti-wrapper .iueklenti-filter-select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}
/* ─── v2.0.6: Filtre sonuç sayacı ─── */
.iueklenti-wrapper .iueklenti-filter-count {
    display: inline-block;
    font-size: 13px;
    color: #666;
    padding: 6px 0;
    align-self: flex-end;
    white-space: nowrap;
}

/* ─── v2.0.3: "Serinin Tüm Renklerini Gör" Butonu ─── */
.iueklenti-series-btn-wrap {
    margin: 16px 0 8px;
}
.iueklenti-series-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 28px !important;
    background: #1a1a1a !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: .3px;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .2s, transform .15s;
    box-shadow: none !important;
    text-transform: none;
    line-height: 1.4 !important;
}
.iueklenti-series-btn:hover {
    background: #333 !important;
    color: #fff !important;
    transform: translateY(-1px);
}

/* ─── v2.0.3: Dinamik "Başlayan Fiyat" ─── */
.iueklenti-starting-price {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 8px 0 12px;
    padding: 0;
    line-height: 1.4;
}
.iueklenti-starting-price .woocommerce-Price-amount {
    font-size: 22px;
    color: #d63638;
}
.iueklenti-starting-price--archive {
    font-size: 14px;
    font-weight: 600;
    display: block;
}
.iueklenti-starting-price--archive .woocommerce-Price-amount {
    font-size: 16px;
    color: #d63638;
}

/* Eski ton filtresi – geriye uyumluluk */
.iueklenti-wrapper .iueklenti-tone-filter {
    margin-bottom: 20px;
}
.iueklenti-wrapper .iueklenti-tone-filter label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}
.iueklenti-wrapper .iueklenti-tone-filter select {
    min-width: 260px;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}

/* ─── Renk Kutuları (Flexbox Layout) ─── */
.iueklenti-wrapper .iueklenti-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 24px;
}

.iueklenti-wrapper .iueklenti-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    width: 130px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    background: none;
    cursor: pointer;
    transition: border-color .2s, transform .15s;
    position: relative;
    /* Reset – tema buton stillerini ezmeye karşı */
    box-shadow: none;
    text-transform: none;
    letter-spacing: normal;
}
.iueklenti-wrapper .iueklenti-swatch:hover {
    transform: translateY(-2px);
}
.iueklenti-wrapper .iueklenti-swatch:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}
.iueklenti-wrapper .iueklenti-swatch--active {
    border-color: #1a1a1a;
}
.iueklenti-wrapper .iueklenti-swatch--active::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #1a1a1a;
}

.iueklenti-wrapper .iueklenti-swatch__color {
    display: block;
    width: 100%;
    height: 90px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,.08);
}

/* v2.0.4: Görsel Swatch */
.iueklenti-wrapper .iueklenti-swatch__img {
    display: block;
    width: 100%;
    height: 90px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,.08);
    object-fit: contain;     /* Sığdırma – kırpmadan, aspect ratio koruyarak */
    background: #fff;        /* Saydam görsellerde arka plan */
}

.iueklenti-wrapper .iueklenti-swatch__label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.3;
    padding: 0 4px 6px;
}

/* Gizli swatch'lar (ton filtresi) */
.iueklenti-wrapper .iueklenti-swatch--hidden {
    display: none !important;
}

/* ─── Mini Ürün Kartı (flex satır sonu – full width) ─── */
.iueklenti-wrapper .iueklenti-product-card {
    flex-basis: 100%;       /* Flex satırının tamamını kapla */
    width: 100%;
    min-width: 0;
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    position: relative;
    box-sizing: border-box;
    /* Animasyonlu açılma */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height .4s ease, opacity .3s ease, padding .3s ease, margin .3s ease;
    padding: 0 24px;
    margin: 0;
}

.iueklenti-wrapper .iueklenti-product-card.iueklenti-card-open {
    max-height: 800px;
    opacity: 1;
    padding: 24px;
    margin: 8px 0;
    animation: iueklentiSlideDown .4s ease;
}

@keyframes iueklentiSlideDown {
    from { opacity: 0; transform: translateY(-15px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Yüklenme Spinner */
.iueklenti-wrapper .iueklenti-product-card__loader {
    display: none;
    text-align: center;
    padding: 40px;
}
.iueklenti-wrapper .iueklenti-product-card__loader.active { display: block; }

.iueklenti-wrapper .iueklenti-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #333;
    border-radius: 50%;
    animation: iueklentiSpin .6s linear infinite;
}
@keyframes iueklentiSpin {
    to { transform: rotate(360deg); }
}

/* 3 Kolonlu Kart Grid */
.iueklenti-wrapper .iueklenti-card {
    display: grid;
    grid-template-columns: 200px 1fr 280px;
    gap: 24px;
    align-items: start;
}

/* Kolon 1: Görsel */
.iueklenti-wrapper .iueklenti-card__image {
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    background: #fff;
}
.iueklenti-wrapper .iueklenti-card__image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Kolon 2: Bilgi + Sepet */
.iueklenti-wrapper .iueklenti-card__info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.iueklenti-wrapper .iueklenti-card__title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}
.iueklenti-wrapper .iueklenti-card__title a {
    color: #1a1a1a;
    text-decoration: none;
}
.iueklenti-wrapper .iueklenti-card__title a:hover { text-decoration: underline; }

.iueklenti-wrapper .iueklenti-card__sku,
.iueklenti-wrapper .iueklenti-card__price {
    font-size: 14px;
    color: #555;
    margin: 0;
}
.iueklenti-wrapper .iueklenti-card__price strong {
    font-size: 18px;
    color: #1a1a1a;
}

/* Adet + Sepete Ekle */
.iueklenti-wrapper .iueklenti-card__cart {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.iueklenti-wrapper .iueklenti-card__qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}
.iueklenti-wrapper .iueklenti-qty-btn {
    width: 36px;
    height: 38px;
    border: none;
    background: #f0f0f0;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    /* Reset tema stilleri */
    box-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    padding: 0;
    margin: 0;
    line-height: 1;
    color: #333;
}
.iueklenti-wrapper .iueklenti-qty-btn:hover { background: #e0e0e0; }
.iueklenti-wrapper .iueklenti-qty-input {
    width: 48px;
    height: 38px;
    border: none;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    text-align: center;
    font-size: 15px;
    -moz-appearance: textfield;
    /* Reset */
    padding: 0;
    margin: 0;
    background: #fff;
}
.iueklenti-wrapper .iueklenti-qty-input::-webkit-inner-spin-button,
.iueklenti-wrapper .iueklenti-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.iueklenti-wrapper .iueklenti-add-to-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 0 24px;
    height: 40px;
    background: #1a1a1a !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .5px;
    cursor: pointer;
    transition: background .2s;
    /* Reset */
    box-shadow: none !important;
    text-transform: uppercase;
    line-height: 1;
}
.iueklenti-wrapper .iueklenti-add-to-cart:hover { background: #333 !important; }
.iueklenti-wrapper .iueklenti-add-to-cart.iueklenti-added {
    background: #00a32a !important;
}
.iueklenti-wrapper .iueklenti-add-to-cart:disabled { opacity: .6; cursor: wait; }

/* Kolon 3: Öznitelikler Tablosu */
.iueklenti-wrapper .iueklenti-card__attrs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.iueklenti-wrapper .iueklenti-attrs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.iueklenti-wrapper .iueklenti-attrs-table th,
.iueklenti-wrapper .iueklenti-attrs-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}
.iueklenti-wrapper .iueklenti-attrs-table th {
    width: 45%;
    font-weight: 600;
    color: #555;
    background: #fafafa;
}
.iueklenti-wrapper .iueklenti-attrs-table td {
    color: #1a1a1a;
}

/* Renk rozeti kaldırıldı – öznitelikler tablosunda zaten mevcut (v2.0.1) */

/* Hata mesajı */
.iueklenti-wrapper .iueklenti-card-error {
    padding: 16px;
    text-align: center;
    color: #d63638;
    font-size: 14px;
}

/* ─── Responsive ─── */
@media (max-width: 960px) {
    .iueklenti-wrapper .iueklenti-card {
        grid-template-columns: 160px 1fr;
    }
    .iueklenti-wrapper .iueklenti-card__attrs {
        grid-column: 1 / -1;
    }
    .iueklenti-wrapper .iueklenti-filters {
        gap: 12px;
    }
    .iueklenti-wrapper .iueklenti-filter-group {
        min-width: 140px;
        flex: 1 1 140px;
    }
}

@media (max-width: 640px) {
    .iueklenti-wrapper .iueklenti-color-swatches {
        gap: 8px;
    }
    .iueklenti-wrapper .iueklenti-swatch {
        width: 90px;
    }
    .iueklenti-wrapper .iueklenti-swatch__color {
        height: 65px;
    }
    .iueklenti-wrapper .iueklenti-swatch__img {
        height: 65px;
    }
    .iueklenti-wrapper .iueklenti-card {
        grid-template-columns: 1fr;
    }
    .iueklenti-wrapper .iueklenti-card__image {
        max-width: 200px;
        margin: 0 auto;
    }
    .iueklenti-wrapper .iueklenti-card__cart {
        flex-direction: column;
        align-items: stretch;
    }
    /* Miktar seçici – full width (SEPETE EKLE ile aynı genişlik) */
    .iueklenti-wrapper .iueklenti-card__qty {
        display: flex;
        width: 100%;
    }
    .iueklenti-wrapper .iueklenti-qty-btn {
        flex: 0 0 48px;
        height: 44px;
        font-size: 20px;
    }
    .iueklenti-wrapper .iueklenti-qty-input {
        flex: 1;
        width: auto;
        height: 44px;
        font-size: 16px;
    }
    .iueklenti-wrapper .iueklenti-add-to-cart {
        width: 100%;
        height: 44px;
    }
    /* Filtreler – mobilde tam genişlik */
    .iueklenti-wrapper .iueklenti-filters {
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
    }
    .iueklenti-wrapper .iueklenti-filter-group {
        min-width: 100%;
        max-width: 100%;
    }
    /* Seri butonu – mobilde tam genişlik */
    .iueklenti-series-btn {
        width: 100%;
        text-align: center;
    }
}
