/* =============================================================================
 * Bayiseç — Sepete ekleme geri bildirimi (toast + rozet "bump")
 *
 * Kapsam: assets/js/magaza-cart.js. Swal CDN'i reklam engelleyiciler tarafından
 * sık sık bloklanıyor ve script o durumda SESSİZ kalıyordu (kullanıcı sepete
 * eklediğini anlamıyordu) → kendi toast'ımız Swal'a bağımlı değil.
 *
 * Yüklendiği yerler (footer.php): /magaza (ana site, kart üstünden sepete
 * ekleme) + /sepetlerim (my-carts.php — rozetler orada da görünür durumda).
 * Mobil karşılığı: mobile-theme/assets/css/bayisec-cart-feedback.css.
 * ========================================================================== */

.bs-toast-host {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 99999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    max-width: 320px;
    pointer-events: none;
}
.bs-toast {
    pointer-events: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(20, 61, 89, .18);
    padding: 12px 34px 12px 14px;
    position: relative;
    font-size: 13px;
    line-height: 1.4;
    color: #1b2b38;
    border-left: 4px solid var(--theme-deafult, #143d59);
    opacity: 0;
    transform: translateY(8px);
    animation: bs-toast-in .25s ease forwards;
}
.bs-toast-success { border-left-color: #51bb25; }
.bs-toast-error   { border-left-color: #dc3545; }
.bs-toast-warning { border-left-color: var(--theme-secondary, #f4b41a); }
.bs-toast-hide { animation: bs-toast-out .25s ease forwards; }

@keyframes bs-toast-in  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bs-toast-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(8px); } }

.bs-toast-text {
    font-weight: 600;
    padding-right: 4px;
}
.bs-toast-link {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--theme-deafult, #143d59);
    text-decoration: underline;
}
.bs-toast-close {
    position: absolute;
    top: 4px;
    right: 6px;
    border: 0;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    color: #8b8b9b;
    cursor: pointer;
    padding: 2px 6px;
}
.bs-toast-close:hover { color: #1b2b38; }

@media (max-width: 480px) {
    .bs-toast-host { left: 10px; right: 10px; max-width: none; }
}

/* Rozet/toplam güncellenince kısa bir "bump" (ölçek + parlaklık) — değişiklik
   sessizce geçmesin. JS 700ms sonra sınıfı kaldırıyor (magaza-cart.js). */
@keyframes bs-bump {
    0%   { transform: scale(1);   filter: brightness(1); }
    35%  { transform: scale(1.3); filter: brightness(1.3); }
    100% { transform: scale(1);   filter: brightness(1); }
}
.bs-bump {
    display: inline-block;
    animation: bs-bump .7s ease;
}

/* =============================================================================
 * RFC-06 / S6.4 — alternatif teklif UI'ları (functions-alternatives-ui.php)
 *
 * Bu dosya zaten ".bs-add-cart" bulunan HER sayfada yükleniyor (/magaza ana site
 * + sepet + ödeme — bkz. footer.php), yani RFC-06 kartlarının bulunabileceği
 * her yerde otomatik hazır. Kart markup'ı partial/magaza-network.php'nin
 * .product-box/.bs-cta/.bs-price/.bs-cta-note kurallarını AYNEN kullanır; burada
 * yalnız YENİ sınıflar (raf, yatay kaydırma, kart genişliği, panel) tanımlanır.
 * ========================================================================== */

.bs-alt-shelf { margin: 22px 0 4px; }
.bs-alt-shelf-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--bs-ink, #1b2b38);
    margin: 0 0 10px;
}
.bs-alt-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.bs-alt-card {
    flex: 0 0 200px;
    max-width: 200px;
}
.bs-alt-card .card { margin-bottom: 0; height: 100%; }
.bs-alt-card .product-box .product-details h4 a { color: inherit; text-decoration: none; }
/* B0-126: panel <body>'ye basılıyor (.page-body dışı) → vendor yeşili rgb(81,187,37) + beyaz
   yazı 2,47 kalıyordu. bayisec-ds.css rozet çiftleriyle aynı. */
.bs-alt-card .badge-success { background: var(--bs-ok-050, #e8f7ee); color: var(--bs-ok-700, #166534); }
.bs-alt-card .badge-danger  { background: var(--bs-danger-050, #fdecec); color: #b91c1c; }
.bs-alt-card .badge { border-radius: var(--bs-r-pill, 999px); } /* B0-131 */

/* Sepete ekleme sonrası panel (bayisec-alt-offers.js) — sağdan açılan sabit sayfa.
   İçerik iki blok: ÜSTTE sabit duran sepet özeti (.bs-alt-added), ALTINDA 2'li grid
   halinde ve KENDİ İÇİNDE kaydırılan alternatif rafı. Bu yüzden panel gövdesi
   kaydırılmaz (overflow:hidden) — kaydırma yalnız .bs-alt-scroll'dadır. */
.bs-alt-panel { position: fixed; inset: 0; z-index: 100000; display: none; }
.bs-alt-panel.bs-alt-panel-open { display: block; }
.bs-alt-panel-backdrop { position: absolute; inset: 0; background: rgba(20, 61, 89, .45); }
.bs-alt-panel-sheet {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    /* 2'li grid için 380px dardı — kartlar sıkışıyordu. */
    width: min(460px, 94vw);
    background: #fff;
    box-shadow: -8px 0 24px rgba(20, 61, 89, .18);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .25s ease;
}
.bs-alt-panel-open .bs-alt-panel-sheet { transform: translateX(0); }
.bs-alt-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--bs-line-soft, #e5e9ee);
    font-weight: 700;
    font-size: 14px;
    color: var(--bs-ink, #1b2b38);
    flex: 0 0 auto;
}
.bs-alt-panel-close {
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--bs-body, #4a5a6a);
    padding: 2px 6px;
}
.bs-alt-panel-close:hover { color: #1b2b38; }
.bs-alt-panel-body {
    padding: 0;
    overflow: hidden;         /* kaydırma alt bloğa (.bs-alt-scroll) devredilir */
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* --- Panel üstü: eklenen kalemin sepet özeti (bayisec_alt_render_added) --- */
.bs-alt-added {
    flex: 0 0 auto;
    padding: 14px 16px 12px;
    background: linear-gradient(180deg, #f6f9fc 0%, #fff 100%);
    border-bottom: 1px solid var(--bs-line-soft, #e5e9ee);
}
.bs-alt-added-head {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .2px;
    text-transform: uppercase;
    color: #2f9e44;
}
.bs-alt-added-tick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2f9e44;
    color: #fff;
    font-size: 11px;
    line-height: 1;
}
.bs-alt-added-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.bs-alt-added-thumb {
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
    border: 1px solid var(--bs-line-soft, #e5e9ee);
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.bs-alt-added-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bs-alt-added-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bs-alt-added-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--bs-ink, #1b2b38);
    /* Uzun ürün adı özeti şişirmesin. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bs-alt-added-brand {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: var(--bs-body, #4a5a6a);
}
.bs-alt-added-calc { font-size: 12px; color: #5c6b7a; margin-top: 2px; }
.bs-alt-added-calc b { color: var(--bs-ink, #1b2b38); font-weight: 700; }
.bs-alt-added-line {
    flex: 0 0 auto;
    font-size: 16px;
    font-weight: 700;
    color: var(--theme-deafult, #143d59);
    white-space: nowrap;
    padding-top: 2px;
}
.bs-alt-added-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--bs-line-soft, #e5e9ee);
    font-size: 12px;
    color: #5c6b7a;
}
.bs-alt-added-cart b { color: var(--bs-ink, #1b2b38); font-weight: 700; margin-left: 4px; }
.bs-alt-added-link {
    font-weight: 700;
    color: var(--theme-deafult, #143d59);
    text-decoration: none;
    white-space: nowrap;
}
.bs-alt-added-link:hover { text-decoration: underline; }

/* --- Panel altı: "Alternatif Fırsatlar" — 2'li grid, kendi içinde kaydırma --- */
.bs-alt-panel-body .bs-alt-shelf {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.bs-alt-panel-body .bs-alt-shelf-title {
    flex: 0 0 auto;
    margin: 0;
    padding: 14px 16px 10px;
    font-size: 14px;
}
.bs-alt-panel-body .bs-alt-scroll {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 16px 16px;
}
.bs-alt-panel-body .bs-alt-card { flex: none; max-width: none; min-width: 0; }

/* Grid hücresi dar → kart içeriği sıkıştırılır (raf kartının kendi ölçüleri korunur). */
.bs-alt-panel-body .bs-alt-card .card { border-radius: var(--bs-r, 12px); overflow: hidden; }
.bs-alt-panel-body .bs-alt-card .product-img { padding: 8px; background: #fff; }
.bs-alt-panel-body .bs-alt-card .product-img img { width: 100%; height: 96px; object-fit: contain; }
.bs-alt-panel-body .bs-alt-card .product-details { padding: 8px 10px 10px; }
.bs-alt-panel-body .bs-alt-card .product-details h4 {
    font-size: 12px;
    line-height: 1.35;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bs-alt-panel-body .bs-alt-card .product-details p { font-size: 10.5px; margin-bottom: 6px !important; }
.bs-alt-panel-body .bs-alt-card .d-flex { flex-wrap: wrap; row-gap: 4px; }
.bs-alt-panel-body .bs-alt-card .badge { font-size: 9.5px; padding: 3px 6px; }
.bs-alt-panel-body .bs-alt-card .bs-price { font-size: 13px; font-weight: 700; }
/* .product-details p kuralından SONRA gelmesi yetmez, ondan daha spesifik olmalı
   (ikisi de aynı <p>'yi hedefliyor). */
.bs-alt-panel-body .bs-alt-card .product-details .bs-cta-note { font-size: 10px; margin: 6px 0 8px !important; line-height: 1.3; }
.bs-alt-panel-body .bs-alt-card .bs-cta .btn { width: 100%; font-size: 11.5px; padding: 7px 8px; border-radius: var(--bs-r-sm, 8px); }

@media (max-width: 480px) {
    .bs-alt-panel-sheet { width: 100%; }
    .bs-alt-added-line { font-size: 15px; }
}
