/* ==========================================================================
   AFYON LEZZET HANEM — YENİ NESİL ETKİLEŞİM KATMANI
   Yapışkan başlık, yapışkan satın alma kutusu, sepet geri bildirimi,
   kaydırmada beliren içerik. Tüm sayfalarda yüklenir.
   ========================================================================== */

/* ==========================================================================
   1) KAYDIRINCA BELİREN SABİT ÜST ÇUBUK
   Not: index.php'de html'e overflow-x:hidden verilmiş; bu, position:sticky'yi
   devre dışı bırakıyor. Bu yüzden başlığı yapıştırmak yerine ayrı, sabit
   konumlu ince bir çubuk kullanıyoruz — overflow kısıtından etkilenmiyor.
   ========================================================================== */
.ux-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1300;
    background: rgba(255,252,248,.94);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid #EDE4DA;
    box-shadow: 0 10px 30px rgba(23,18,15,.10);
    transform: translateY(-102%);
    transition: transform .42s cubic-bezier(.22,.61,.36,1);
    will-change: transform;
}
.ux-bar.is-on { transform: none; }

.ux-bar__in {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 66px;
}
.ux-bar__logo { flex: none; display: inline-flex; align-items: center; }
.ux-bar__logo img { height: 34px; width: auto; display: block; }

.ux-bar__search { flex: 1 1 auto; min-width: 0; position: relative; margin: 0; }
.ux-bar__search input {
    width: 100%;
    height: 42px;
    padding: 0 46px 0 18px;
    border-radius: 50px;
    border: 1px solid #EDE4DA;
    background: #fff;
    font-size: 13.5px;
    font-family: inherit;
    color: #17120F;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.ux-bar__search input:focus {
    border-color: rgba(242,106,42,.55);
    box-shadow: 0 0 0 4px rgba(242,106,42,.12);
}
.ux-bar__search button {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8C8073;
    cursor: pointer;
}
.ux-bar__search button:hover { color: #F26A2A; }

.ux-bar__links { display: flex; align-items: center; gap: 22px; flex: none; }
.ux-bar__links a {
    font-size: 12.5px;
    font-weight: 600;
    color: #3B3128;
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s ease;
}
.ux-bar__links a:hover { color: #F26A2A; text-decoration: none; }

.ux-bar__cart {
    flex: none;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 18px;
    border-radius: 50px;
    background: linear-gradient(135deg, #F87A38, #E1571C);
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    transition: transform .2s ease, box-shadow .2s ease;
}
.ux-bar__cart:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(242,106,42,.35); }
.ux-bar__cart b {
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 20px;
    background: rgba(255,255,255,.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

/* Okuma ilerleme çubuğu — sabit çubuğun altına oturur */
.ux-progress {
    position: absolute;
    left: 0;
    bottom: -1px;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, #F26A2A, #E2B159);
    transition: width .12s linear;
    pointer-events: none;
}

@media (max-width: 991px) {
    .ux-bar__links { display: none; }
}
@media (max-width: 600px) {
    .ux-bar__in { height: 58px; gap: 10px; }
    .ux-bar__logo img { height: 26px; }
    .ux-bar__cart { padding: 9px 13px; font-size: 0; gap: 0; }
    .ux-bar__cart i { font-size: 14px; }
    .ux-bar__cart b { font-size: 10px; margin-left: 6px; }
}

/* NOT: Ürün detayda "yapışkan satın alma kutusu" denendi ancak index.php'de
   html'e verilen overflow-x:hidden, position:sticky'yi tarayıcı düzeyinde
   devre dışı bırakıyor. Yanlış izlenim vermemek için o kural kaldırıldı;
   kök nedene (overflow) dokunmak sayfanın hiç kaydırılamaması riskini taşıyor. */

/* ==========================================================================
   3) ÜRÜN KARTI — HIZLI EKLEME GERİ BİLDİRİMİ
   ========================================================================== */
.product-card-v2 .add-to-cart-btn {
    position: relative;
    overflow: hidden;
}
.product-card-v2 .add-to-cart-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.28);
    transform: translateX(-101%) skewX(-18deg);
    transition: transform .55s cubic-bezier(.22,.61,.36,1);
}
.product-card-v2 .add-to-cart-btn:hover::after { transform: translateX(101%) skewX(-18deg); }
.product-card-v2 .add-to-cart-btn:active { transform: scale(.985); }

/* Favori kalbi seçilince */
.product-card-v2 .action-btn:active { transform: scale(.9); }

/* ==========================================================================
   4) KAYDIRDIKÇA BELİREN İÇERİK (liste sayfaları)
   ========================================================================== */
.ux-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s cubic-bezier(.22,.61,.36,1),
                transform .6s cubic-bezier(.22,.61,.36,1);
    will-change: opacity, transform;
}
.ux-reveal.is-in { opacity: 1; transform: none; }

/* ==========================================================================
   5) YUKARI ÇIK DÜĞMESİ
   ========================================================================== */
.ux-top {
    position: fixed;
    right: 22px;
    bottom: 26px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid #EDE4DA;
    background: rgba(255,255,255,.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #17120F;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(23,18,15,.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all .3s cubic-bezier(.22,.61,.36,1);
    z-index: 1100;
}
.ux-top.is-on { opacity: 1; visibility: visible; transform: none; }
.ux-top:hover { background: #17120F; color: #fff; border-color: #17120F; }

@media (max-width: 780px) {
    .ux-top { right: 14px; bottom: 96px; width: 42px; height: 42px; }
}

/* ==========================================================================
   6) SEÇİM VE ODAK
   ========================================================================== */
::selection { background: rgba(242,106,42,.22); color: #17120F; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid rgba(242,106,42,.6);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Yumuşak kaydırma */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .ux-reveal { opacity: 1 !important; transform: none !important; }
}

/* ==========================================================================
   7) ÜRÜN DETAY — SABİT SATIN ALMA ÇUBUĞU
   Ana "Sepete Ekle" ekrandan çıkınca altta ince bir çubuk belirir.
   position:fixed kullanır; overflow kısıtından etkilenmez.
   ========================================================================== */
.ux-buybar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1250;
    background: rgba(255,252,248,.96);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid #EDE4DA;
    box-shadow: 0 -12px 34px rgba(23,18,15,.12);
    transform: translateY(102%);
    transition: transform .42s cubic-bezier(.22,.61,.36,1);
    will-change: transform;
    display: none;
}
.ux-buybar.is-on { transform: none; }

.ux-buybar__in {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 78px;
}
.ux-buybar__img {
    width: 54px;
    height: 54px;
    flex: none;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid #EDE4DA;
    background: #FAF6F1;
}
.ux-buybar__meta { flex: 1 1 auto; min-width: 0; }
.ux-buybar__meta b {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #17120F;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.ux-buybar__meta span {
    display: block;
    font-size: 12px;
    color: #8C8073;
    margin-top: 2px;
}
.ux-buybar__price {
    flex: none;
    font-size: 22px;
    font-weight: 800;
    color: #17120F;
    letter-spacing: -.02em;
    white-space: nowrap;
}
.ux-buybar__btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    border: 0;
    border-radius: 12px;
    background: #F26A2A;
    color: #fff;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .25s ease, transform .2s ease;
}
.ux-buybar__btn:hover { background: #E1571C; transform: translateY(-1px); }

@media (min-width: 768px) {
    .ux-buybar { display: block; }
}

/* Telefonda tema kendi sabit butonunu gösteriyor — onu düzenliyoruz */
@media (max-width: 480px) {
    .bp-actions {
        background: rgba(255,252,248,.96) !important;
        -webkit-backdrop-filter: saturate(180%) blur(14px);
        backdrop-filter: saturate(180%) blur(14px);
        border-top: 1px solid #EDE4DA !important;
        box-shadow: 0 -12px 30px rgba(23,18,15,.12) !important;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
        gap: 10px !important;
    }
    .bp-btn-cart { border-radius: 12px !important; }
    /* Alt menü ile üst üste binmesin */
    .bp-mobnav { bottom: 64px; }
}

/* ==========================================================================
   8) LİSTELEME — SIRALAMA HAPLARI
   Açılır kutu DOM'da kalır (filtre durumu korunur), üzerine haplar basılır.
   ========================================================================== */
.ux-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.ux-sort__pill {
    border: 1px solid #EDE4DA;
    background: #fff;
    color: #3B3128;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 50px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .22s ease;
}
.ux-sort__pill:hover { border-color: rgba(242,106,42,.45); color: #F26A2A; }
.ux-sort__pill.is-on {
    background: #17120F;
    border-color: #17120F;
    color: #fff;
}

@media (max-width: 767px) {
    .ux-sort {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }
    .ux-sort::-webkit-scrollbar { display: none; }
    .ux-sort__pill { padding: 8px 14px; font-size: 12px; }
}
