:root {
    --kb-primary: #16a085;
    --kb-muted: #4b5563;
    --radius: 16px;
    --tabbar-h: 92px;
    /* JS ile ölçülür; fallback */
    --kb-header-h: 56px;
}

/* === QR CTA (Kampanya Detay) === */
.kb-qr-cta{
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: linear-gradient(135deg, #16a085 0%, #0ea5e9 100%);
    box-shadow: 0 10px 24px rgba(22, 160, 133, 0.28);
    transition: transform .14s ease, box-shadow .16s ease, filter .16s ease;
    will-change: transform, box-shadow;
}
.kb-qr-cta:hover{
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(22, 160, 133, 0.36);
    filter: saturate(1.06);
}
.kb-qr-cta:active{
    transform: translateY(0px) scale(.99);
    box-shadow: 0 8px 18px rgba(22, 160, 133, 0.28);
}
.kb-qr-cta:focus-visible{
    outline: 2px solid rgba(14, 165, 233, .35);
    outline-offset: 3px;
}
.kb-qr-cta .kb-qr-cta-label{
    font-weight: 800;
    letter-spacing: .1px;
}
.kb-qr-cta .kb-qr-cta-badge{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.30);
    color: rgba(255,255,255,.95);
    font-size: .75rem;
    font-weight: 800;
    line-height: 1.2;
}
.kb-qr-cta::after{
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 999px;
    border: 2px solid rgba(22, 160, 133, .35);
    opacity: .0;
    transform: scale(.98);
    animation: kbQrPulse 2.1s ease-out infinite;
    pointer-events: none;
}
@keyframes kbQrPulse{
    0%   { opacity: 0; transform: scale(.98); }
    12%  { opacity: .55; }
    55%  { opacity: 0; transform: scale(1.08); }
    100% { opacity: 0; transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce){
    .kb-qr-cta{ transition: none; }
    .kb-qr-cta::after{ animation: none; }
}

*:focus-visible {
    outline: 2px solid #16a08540;
    outline-offset: 2px;
}

html,
body {
    height: 100%;
}

body {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background: #f6f7f9;
}

/* Opt-in sayfalarda uzun, boşluksuz metinler (URL, token, hata kodu vb.)
   alert/kart içinde taşmasın. Diğer sayfaların metin kırma düzenini etkilemez. */
body.kb-keyboard-fix .alert,
body.kb-keyboard-fix .kb-firm-alert,
body.kb-keyboard-fix .kb-campaign-alert {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Opt-in sayfalarda flex içinde taşma olmaması için */
body.kb-keyboard-fix .kb-firm-alert-content,
body.kb-keyboard-fix .kb-firm-alert-text {
    min-width: 0;
}

main {
    flex: 1 0 auto;
    scroll-margin-top: var(--kb-header-h, 72px);
}

/* Ortak sticky arama bloğu: header'ın hemen altına yapış */
.search-sticky {
    position: sticky;
    top: var(--kb-header-h, 56px);
    z-index: 1010;
}

/* === BREADCRUMB / SITE HARİTASI ===
   Tüm sayfalarda firma-detay görünümüyle uyumlu ortak stil */
.kb-breadcrumb{
    font-size: .92rem;
    color: #6b7280;
}
.kb-breadcrumb a{
    color: #0f766e;
    text-decoration: none;
}
.kb-breadcrumb a:hover{
    text-decoration: underline;
}
.kb-breadcrumb .sep{
    color: #94a3b8;
    margin: 0 .35rem;
}

/* Arama kartı kompakt varyant (sayfa bazlı class eklenir) */
.search-card.kb-search-card--compact .card-body {
    padding: 10px 12px;
}

/* Başlık satırındaki label daha sıkı dursun */
.search-card.kb-search-card--compact .form-label {
    margin-bottom: 0;
}

/* Arama kartı içindeki sıralama satırı: desktop'ta tek satır, çok dar ekranda kırılabilir */
.search-card .kb-sort-row {
    flex-wrap: nowrap;
}
.search-card .kb-sort-row label {
    white-space: nowrap;
}
.search-card .kb-sort-row .form-select {
    width: auto;
    flex: 1 1 260px; /* dar ekranda küçülebilsin */
    min-width: 0;    /* flex item taşmayı engellesin */
}
/* Aşırı dar ekranlarda (çok küçük cihazlar) gerekirse alt satıra düşsün */
@media (max-width: 360px) {
    .search-card .kb-sort-row { flex-wrap: wrap; }
    .search-card .kb-sort-row .form-select { width: 100%; flex-basis: 100%; }
}

/* Kampanyalar gibi: solda toggle, sağda sıralama kalan alanı kullansın */
.search-card .kb-filter-row{
    display:flex;
    align-items:center;
    gap:10px;
    width:100%;
    justify-content:flex-start !important;
}
.search-card .kb-filter-row > .kb-sort-fill{
    flex:1 1 auto;
    min-width:0;
}
.search-card .kb-sort-fill{
    display:flex;
    align-items:center;
    gap:8px;
    width:100%;
}
.search-card .view-toggle{
    flex: 0 0 auto;
}
.search-card .kb-sort-fill label{
    white-space:nowrap;
    flex:0 0 auto;
}
.search-card .kb-sort-fill .form-select{
    flex:1 1 auto;
    min-width:0;
    width:100%;
}

/* Bootstrap form-switch varsayılan padding/margin'ini sıfırla:
   "Bitenleri göster" bloğu gerçek anlamda sola yaslansın */
.search-card .switch-compact.form-check,
.search-card .switch-compact.form-switch{
    padding-left: 0 !important;
}
.search-card .switch-compact .form-check-input{
    margin-left: 0 !important;
}

/* === HEADER === */
.kb-header {
    position: sticky;
    top: 0;
    z-index: 1035;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.kb-brand {
    display: inline-flex;
    align-items: center;
    gap: .08rem;
    text-decoration: none;
}

.kb-brand-text {
    font-family: 'Montserrat', Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    display: inline-flex;
    align-items: baseline;
    gap: .15rem;
    font-weight: 700; /* fallback */
    font-size: 1.125rem;
    color: #111827;
}
.kb-brand-text .kb-brand-korkuteli{ font-weight: 600; }
.kb-brand-text .kb-brand-burada{ font-weight: 500; }

.kb-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: block;
}

.kb-topmenu {
    display: none;
}

.kb-cta-mobile {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
}

@media (min-width: 768px) {
    .kb-topmenu {
        display: flex;
        gap: .5rem;
        align-items: center;
        justify-content: flex-end;
    }

    .kb-topmenu a,
    .kb-topmenu .dropdown-toggle {
        text-decoration: none;
        color: #4b5563;
        padding: .45rem .75rem;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        gap: .35rem;
        font-size: .95rem;
    }

    .kb-topmenu a:hover,
    .kb-topmenu .dropdown-toggle:hover {
        background: #ecfdf5;
        color: var(--kb-primary);
    }

    /* Aktif sayfa vurgusu */
    .kb-topmenu a.active,
    .kb-topmenu .dropdown-toggle.active,
    .kb-topmenu a.is-active,
    .kb-topmenu .dropdown-toggle.is-active {
        background: #d1fae5;
        color: var(--kb-primary);
        font-weight: 600;
        box-shadow: inset 0 -2px 0 var(--kb-primary);
    }

    /* Dropdown içi aktif alt menü */
    .kb-topmenu .dropdown-menu .dropdown-item.is-active {
        background: #ecfdf5;
        color: var(--kb-primary);
        font-weight: 600;
    }

    .kb-topmenu .btn-cta {
        color: #fff;
        background: var(--kb-primary);
        border-radius: 999px;
        padding: .45rem 1.1rem;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
    }

    .kb-topmenu .btn-cta:hover {
        filter: brightness(.96);
    }
}

/* === FOOTER (DESKTOP ALT BAR) === */
.kb-footer {
    display: none;
}

@media (min-width: 768px) {
    .kb-footer {
        display: block;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        position: relative;
        z-index: 10;
    }

    .kb-footer .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: .75rem 1rem;
    }

    .kb-footer .brand {
        font-weight: 700;
        color: #111827;
    }

    .kb-footer a,
    .kb-footer .dropdown-toggle {
        text-decoration: none;
        color: #4b5563;
        padding: .45rem .75rem;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        gap: .25rem;
        font-size: .92rem;
    }

    .kb-footer a:hover,
    .kb-footer .dropdown-toggle:hover {
        background: #ecfdf5;
        color: var(--kb-primary);
    }

    .kb-footer .dropdown-menu {
        font-size: .875rem;
    }

    /* Aktif sayfa vurgusu (footer) */
    .kb-footer a.is-active,
    .kb-footer .dropdown-toggle.is-active {
        background: #ecfdf5;
        color: var(--kb-primary);
        font-weight: 600;
    }

    .kb-footer .dropdown-menu .dropdown-item.is-active {
        background: #ecfdf5;
        color: var(--kb-primary);
        font-weight: 600;
    }
}

/* === MOBIL ALT TABBAR === */
.mobile-tabbar {
    display: none;
}

/* Mobil + tablet (LG altı) alt tabbar */
@media (max-width: 991.98px) {
    main {
        padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    }

    /* Yönetim sayfaları: içerik <main> içinde değil (sayfa-özel container).
       Alt tabbar altında kalmaması için tabbar yüksekliği kadar ekstra alt boşluk. */
    body .kb-author-main,
    body .kb-member-main,
    body .kb-review-main,
    body .kb-news-main,
    body .kb-article-main {
        padding-bottom: calc(1.5rem + var(--tabbar-h) + env(safe-area-inset-bottom));
    }

    /* iOS/WebKit: input font-size 16px altı olursa otomatik zoom yapabiliyor.
       Sadece belirli sayfalarda (JS body'ye kb-keyboard-fix ekler) devreye girsin. */
    body.kb-keyboard-fix input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]),
    body.kb-keyboard-fix textarea,
    body.kb-keyboard-fix select {
        font-size: 16px;
    }

    .mobile-tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        display: flex;
        justify-content: space-around;
        gap: 2px;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, .06);
        padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
        transition: transform .18s ease-out, opacity .18s ease-out;
    }

    .mobile-tabbar a,
    .mobile-tabbar .dropup > a.drop-toggle {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #6b7280;
        font-size: clamp(10px, 2.6vw, 12px);
        line-height: 1.1;
        border-radius: 12px;
        padding: 8px 2px;
        min-height: 56px;
    }

    .mobile-tabbar a i,
    .mobile-tabbar .dropup > a.drop-toggle i {
        font-size: 20px;
        display: block;
        margin-bottom: 4px;
    }

    .mobile-tabbar a.is-active,
    .mobile-tabbar .dropup.show > a.drop-toggle,
    .mobile-tabbar .dropup > a.drop-toggle:focus-visible {
        color: var(--kb-primary);
        background: #ecfdf5;
        font-weight: 600;
        box-shadow: inset 0 3px 0 var(--kb-primary);
    }

    .mobile-tabbar a.is-active i {
        color: var(--kb-primary);
    }

    .mobile-tabbar .dropup {
        flex: 1 1 0;
        text-align: center;
        position: relative;
    }

    .mobile-tabbar a span,
    .mobile-tabbar .dropup > a.drop-toggle span {
        display: block;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-tabbar .dropdown-menu-center {
        left: 50%;
        transform: translateX(-50%);
    }

    /* Mobil klavye açıldığında (sayfa-özel JS body'ye class ekler),
       fixed alt tabbar + viewport değişimi zıplama/kayma yaratabiliyor.
       Bu durumda tabbarı geçici olarak gizleyip boşluğu azaltıyoruz. */
    body.kb-keyboard-open main {
        padding-bottom: 16px !important;
    }

    body.kb-keyboard-open .mobile-tabbar {
        transform: translateY(120%);
        opacity: 0;
        pointer-events: none;
    }
}

/* Mobilde (telefon): yönetim sayfalarındaki açıklama cümleleri yer kaplıyor.
   Masaüstünde kalsın, sadece mobilde gizlensin. */
@media (max-width: 767.98px) {
    .kb-mobile-hide-help {
        display: none !important;
    }
}


/* === PAYLAS PANELI (BOTTOM SHEET) === */

body.kb-share-open {
    overflow: hidden;
}

#kbShareBackdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease-out;
    z-index: 1050;
}

#kbShareBackdrop.kb-share-visible {
    opacity: 1;
    pointer-events: auto;
}

#kbSharePanel {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 110%);
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -16px 40px rgba(15, 23, 42, 0.35);
    padding: 10px 16px 16px;
    z-index: 1051;
    transition: transform .2s ease-out, opacity .2s ease-out;
    opacity: 0;
}

@media (min-width: 768px) {
    #kbSharePanel {
        bottom: 18px;
        border-radius: 20px;
        padding: 14px 18px 16px;
    }
}

#kbSharePanel.kb-share-visible {
    transform: translate(-50%, 0%);
    opacity: 1;
}

.kb-share-handle {
    width: 44px;
    height: 4px;
    border-radius: 999px;
    background: #e5e7eb;
    margin: 4px auto 10px;
}

.kb-share-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
    padding-right: 32px; /* close butonu için alan */
}

.kb-share-title {
    font-size: .95rem;
    font-weight: 700;
    color: #111827;
}

.kb-share-subtitle {
    font-size: .8rem;
    color: #6b7280;
    max-height: 3.2em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kb-share-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    cursor: pointer;
}

.kb-share-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.kb-share-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.kb-share-btn {
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 999px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-size: .9rem;
    color: #111827;
    cursor: pointer;
    transition: background .14s ease, transform .12s ease, box-shadow .14s ease, border-color .14s ease;
}

.kb-share-btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.kb-share-btn-icon i {
    font-size: 1rem;
}

.kb-share-btn-label {
    flex: 1 1 auto;
    text-align: left;
}

.kb-share-btn:hover {
    background: #ffffff;
    border-color: #d1fae5;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
}

/* Platform bazlı renk vurguları */
.kb-share-btn-whatsapp .kb-share-btn-icon {
    background: #22c55e;
    color: #ecfdf5;
}

.kb-share-btn-facebook .kb-share-btn-icon {
    background: #2563eb;
    color: #eff6ff;
}

.kb-share-btn-x .kb-share-btn-icon {
    background: #111827;
    color: #f9fafb;
}

.kb-share-btn-telegram .kb-share-btn-icon {
    background: #0ea5e9;
    color: #e0f2fe;
}

.kb-share-btn-linkedin .kb-share-btn-icon {
    background: #0a66c2;
    color: #eff6ff;
}

.kb-share-btn-email .kb-share-btn-icon {
    background: #4b5563;
    color: #f9fafb;
}

.kb-share-btn-copy .kb-share-btn-icon {
    background: #ecfdf5;
    color: #16a085;
}

