/* ============================================================
   Akıllı Yem Ürünler — Genel Görünüm
   ============================================================ */

.ayu-filtre-satiri {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 32px;
}
.ayu-filtre-btn {
    background: #fff;
    border: 1px solid #EFE4EE;
    color: #463047;
    font-size: .938em;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.ayu-filtre-btn.ayu-aktif,
.ayu-filtre-btn:hover {
    background: #5E1155;
    border-color: #5E1155;
    color: #fff;
}

.ayu-izgara {
    display: flex;
    flex-wrap: wrap;
    /* NOT: "gap" ÖZELLİKLE kullanılmıyor — bazı render motorlarında
       (ve muhtemelen bazı eski/gömülü tarayıcı görünümlerinde) flex
       "gap" çalışmıyor, kartlar birbirine yapışık görünüyor. Bunun
       yerine her kartın kendi sağ/alt margin'i + PHP'nin ürettiği
       :nth-child kuralı kullanılıyor (bkz. class-ayu-frontend.php).
       Bu proje boyunca defalarca doğrulanmış, güvenilir bir ders. */
}
.ayu-izgara .ayu-kart {
    margin: 0 24px 24px 0;
    box-sizing: border-box;
}

.ayu-bos {
    width: 100%;
    text-align: center;
    color: #8A7791;
    padding: 40px 0;
}

/* ============================================================
   SAYFALAMA
   ============================================================ */
.ayu-sayfalama {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 24px;
}
.ayu-sayfa-btn {
    background: #fff;
    border: 1px solid #EFE4EE;
    color: #463047;
    font-size: .9em;
    font-weight: 600;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.ayu-sayfa-btn:hover {
    background: #5E1155;
    border-color: #5E1155;
    color: #fff;
}
.ayu-sayfa-btn.ayu-sayfa-aktif,
.ayu-sayfa-btn.ayu-sayfa-aktif:hover {
    background: #5E1155;
    border-color: #5E1155;
    color: #fff;
    cursor: default;
}
.ayu-sayfa-btn-pasif {
    background: transparent;
    border: 1px solid transparent;
    color: #C9BAC8;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}
.ayu-sayfa-nokta {
    color: #8A7791;
    padding: 0 4px;
}

.ayu-kart {
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.ayu-gorsel-alani {
    position: relative;
    width: 100%;
    height: 320px;
    overflow: hidden;
    background: #F3EEF2;
}
.ayu-gorsel-link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
}

/* ============================================================
   ÜRÜN GÖRSEL SLAYDI — "Akıllı Yem — Ürün Liste Slaytı"
   eklentisindeki mağaza/kategori slaytıyla AYNI davranış: hover'da
   2. görsele kayar, oklarla galerideki diğer görseller arasında
   gezinilebilir.
   ============================================================ */
.ayu-loop-slider-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.ayu-loop-slider {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
}
.ayu-loop-slider::-webkit-scrollbar {
    display: none;
}
.ayu-loop-slide {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    height: 100%;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}
.ayu-gorsel {
    width: 100%;
    height: 100%;
    /* Varsayılan: "contain" — görsel hiç kırpılmadan, verilen kutu
       yüksekliğine/genişliğine oranlı olarak sığdırılır. Panelden
       "Kutuyu Doldur" seçilirse aşağıdaki dinamik <style> bloğu bunu
       "cover"a çevirip üzerine yazar (bkz. class-ayu-frontend.php). */
    object-fit: contain;
    display: block;
    margin: 0;
}
.ayu-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(0, 0, 0, .05);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all .25s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .2);
    font-size: 14px;
    color: #333;
    z-index: 4;
    padding: 0;
    line-height: 0;
    user-select: none;
}
.ayu-slider-prev { left: 8px; }
.ayu-slider-next { right: 8px; }
.ayu-loop-slider-wrap:hover .ayu-slider-btn {
    opacity: 1;
    visibility: visible;
}
.ayu-slider-btn:hover {
    background: #fff;
    color: #5E1155;
    transform: translateY(-50%) scale(1.1);
}

.ayu-video-rozeti {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(28,18,36,.65);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    pointer-events: none;
}

.ayu-icerik {
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}
/* --- Kategori adı: HER ZAMAN 1 satır. Kart yüksekliği ürünler
   arasında sabit kalsın diye taşan metin "..." ile kesilir; kısa
   metinlerde de satır her zaman aynı yüksekliği kaplar. --- */
.ayu-kategori {
    color: #5E1155;
    font-size: .75em;
    font-weight: 700;
    letter-spacing: .04em;
    display: block;
    width: 100%;
    max-width: 100%;
    line-height: 1.3;
    height: 1.3em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* --- Kategori / Ürün Adı / Fiyat / Buton — her biri kendi
   satırında, yatay ortalı (dikey/kolon düzeni). Her alanın satır
   sayısı SABİT: kategori 1, ürün adı 3, fiyat 1, buton 1 — böylece
   metin kısa da uzun da olsa tüm kartlardaki fiyat/buton aynı
   yükseklikte hizalı kalır. --- */
.ayu-alt-satir {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 8px;
}
/* Ürün adı: HER ZAMAN 3 satırlık alan. Kısa başlıklarda alt kısım
   boş kalır (min-height), uzun başlıklarda 3. satırdan sonrası
   "..." ile kesilir (line-clamp) — ikisi birlikte satır sayısını
   sabitler. */
.ayu-urun-adi {
    color: #1C1224;
    font-size: 1.02em;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.35;
    max-width: 100%;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    min-height: calc(1.35em * 3);
}
.ayu-urun-adi:hover { text-decoration: underline; }
/* Fiyat: HER ZAMAN 1 satır. */
.ayu-fiyat {
    display: block;
    width: 100%;
    max-width: 100%;
    color: #0F5F55;
    font-size: .938em;
    font-weight: 700;
    line-height: 1.3;
    height: 1.3em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ayu-fiyat ins { text-decoration: none; }
.ayu-fiyat del { opacity: .55; font-weight: 400; margin-right: 6px; }

/* ============================================================
   BUTON — 4 hazır şablon. Renkler HER ZAMAN CSS değişkeni
   üzerinden (bkz. Akıllı Yem Slayt eklentisindeki hover-özgüllük
   dersi) — normal ve hover AYNI özgüllük seviyesinden geliyor.
   ============================================================ */
/* Buton: HER ZAMAN 1 satır — metin uzun olsa da alt satıra
   kaymaz, "..." ile kesilir; böylece buton her kartta aynı
   yükseklikte kalır. */
.ayu-buton {
    display: inline-block;
    text-align: center;
    flex: 0 0 auto;
    padding: 10px 18px;
    font-size: .875em;
    font-weight: 700;
    text-decoration: none;
    box-sizing: border-box;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 2px solid var( --ayu-cizgi, transparent );
    color: var( --ayu-renk, #5E1155 );
    background-color: var( --ayu-arkaplan, transparent );
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}
.ayu-buton:hover {
    color: var( --ayu-hover-renk, var( --ayu-renk, #5E1155 ) );
    background-color: var( --ayu-hover-arkaplan, var( --ayu-arkaplan, transparent ) );
    border-color: var( --ayu-hover-cizgi, var( --ayu-cizgi, transparent ) );
}

.ayu-buton-dolgu { border-radius: 10px; }
.ayu-buton-anahat { border-radius: 10px; background-color: transparent !important; }
.ayu-buton-hap { border-radius: 999px; }
.ayu-buton-metin-link {
    border: none !important;
    padding: 0;
    text-decoration: underline;
    background: transparent !important;
}

/* ============================================================
   VİDEO POPUP
   ============================================================ */
.ayu-video-popup {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15,10,15,.9);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 30px;
    box-sizing: border-box;
}
.ayu-video-popup.ayu-acik { display: flex; }
.ayu-video-ic {
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16/9;
    background: #000;
}
.ayu-video-ic iframe,
.ayu-video-ic video {
    width: 100%;
    height: 100%;
    border: 0;
}
.ayu-video-kapat {
    position: absolute;
    top: 22px;
    right: 26px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    box-sizing: border-box;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.35);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease, transform .3s ease;
}
.ayu-video-kapat:hover {
    background: #5E1155;
    transform: rotate(90deg);
}

@media (max-width: 900px) {
    .ayu-izgara .ayu-kart { flex-basis: calc(50% - 12px) !important; max-width: calc(50% - 12px) !important; }
    .ayu-izgara .ayu-kart:nth-child(2n) { margin-right: 0 !important; }
}
@media (max-width: 480px) {
    .ayu-izgara .ayu-kart { flex-basis: 100% !important; max-width: 100% !important; margin-right: 0 !important; }
}
