/* ============================================
   MOBİL BOTTOM NAVIGATION BAR (iPhone Style)
   ============================================ */

/* Desktop'ta gizle */
.mobile-bottom-nav {
    display: none;
}

.mobile-bottom-nav-new,
.mobile-whatsapp-float {
    display: none;
}

/* Sadece mobilde göster */
@media (max-width: 991px) {
    /* CSS Variable: Bottom nav yüksekliği */
    :root {
        --bottom-nav-h: 75px;
    }

    /* ESKİ BAR: Mobilde tamamen gizle */
    .mobile-bottom-nav {
        display: none !important;
    }

    /* YENİ MOBİL ALT NAVIGATION */
    .mobile-bottom-nav-new {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
        z-index: 9999 !important;
        padding-bottom: env(safe-area-inset-bottom);
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: var(--bottom-nav-h);
        min-height: var(--bottom-nav-h);
    }

    .mobile-bottom-nav-new__item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #000000;
        padding: 8px 4px;
        position: relative;
        transition: color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
        border-left: 1px solid #e5e7eb;
    }

    .mobile-bottom-nav-new__item:first-child {
        border-left: none;
    }

    /* Tüm butonlar varsayılan olarak siyah */
    .mobile-bottom-nav-new__item {
        color: #000000 !important;
    }

    .mobile-bottom-nav-new__item .mobile-bottom-nav-new__icon,
    .mobile-bottom-nav-new__item .mobile-bottom-nav-new__text {
        color: #000000 !important;
    }

    /* Bağış Yap butonu her zaman kırmızı */
    .mobile-bottom-nav-new__item--donate,
    #mbn-donate {
        color: #c40000 !important;
    }

    .mobile-bottom-nav-new__item--donate .mobile-bottom-nav-new__icon,
    .mobile-bottom-nav-new__item--donate .mobile-bottom-nav-new__text,
    #mbn-donate .mobile-bottom-nav-new__icon,
    #mbn-donate .mobile-bottom-nav-new__text {
        color: #c40000 !important;
    }

    /* Active state artık kırmızı yapmıyor */
    .mobile-bottom-nav-new__item.active {
        color: #000000 !important;
    }

    .mobile-bottom-nav-new__item.active .mobile-bottom-nav-new__icon,
    .mobile-bottom-nav-new__item.active .mobile-bottom-nav-new__text {
        color: #000000 !important;
    }

    .mobile-bottom-nav-new__icon {
        font-size: 22px;
        margin-bottom: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 24px;
    }

    .mobile-bottom-nav-new__icon img {
        width: 20px;
        height: 20px;
        object-fit: contain;
    }

    .mobile-bottom-nav-new__text {
        font-size: 11px;
        font-weight: 500;
        line-height: 1.2;
        text-align: center;
    }

    /* Dil seçici özel stil */
    .mobile-bottom-nav-new__item--lang {
        flex: 0.8;
    }

    .mobile-bottom-nav-new__lang-content {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .mobile-bottom-nav-new__lang-flag {
        width: 20px;
        height: 20px;
        border-radius: 2px;
        object-fit: cover;
    }

    /* Sayfa içeriği altta barın altında kalmasın */
    body {
        padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)) !important;
    }
}

/* Mobilde (<=767.98px) sayfa wrapper ve içerik için ek padding */
@media (max-width: 767.98px) {
    :root {
        --bottom-nav-h: 55px;
    }
    
    /* Sayfa wrapper'ına padding ekle */
    .page-wrapper {
        padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)) !important;
    }
    
    /* Bağış listesi sayfası için özel padding (mevcut padding'e ek olarak) */
    .bagis-listesi-page,
    .bagis-listesi-wrapper,
    .bagis-listesi-wrapper .bagis-listesi-page {
        padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)) !important;
    }
    
    /* Bağış yap sayfası için de padding */
    .bagis-listesi-wrapper {
        padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)) !important;
    }

    /* FLOATING WHATSAPP BUTTON */
    .mobile-whatsapp-float {
        position: fixed;
        bottom: calc(var(--bottom-nav-h) + 14px + env(safe-area-inset-bottom));
        left: 16px;
        width: 56px;
        height: 56px;
        background: #25D366;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
        z-index: 9998;
        text-decoration: none;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-whatsapp-float:active {
        transform: scale(0.95);
        box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
    }

    .mobile-whatsapp-float i {
        color: #ffffff;
        font-size: 28px;
    }


    /* Çakışma temizliği: Mobilde eski widget'ları kapat */
    /* Header'daki kırmızı donate FAB */
    .donate-fab,
    #donateFabMobile {
        display: none !important;
    }

    /* Floating WhatsApp widget - mobilde gizle (yeni floating button kullanılıyor) */
    .floating-contact-wrap,
    .floating-contact-btn {
        display: none !important;
    }

    /* Scroll-to-top butonu mobilde kapalı */
    .scroll-to-target.scroll-to-top {
        display: none !important;
    }

    /* Weglot overlay çakışmasını engelle - mobilde z-index düşür */
    [class*="weglot"],
    [id*="weglot"],
    .weglot-container,
    .wg-default,
    .weglot_switcher {
        z-index: 1000 !important;
    }

    /* Weglot dropdown açıkken bile alt bar üstünde olsun */
    [class*="weglot"].open,
    [class*="weglot"].show,
    [class*="weglot"].active {
        z-index: 1000 !important;
    }
}

/* ============================================
   BAĞIŞ YAP SAYFASI - DİĞER BAĞIŞLAR TOGGLE
   ============================================ */

/* Desktop'ta normal görünüm */
#otherDonationsSection {
    display: block;
}

/* Sadece mobilde animasyonlu aç/kapa */
@media (max-width: 991px) {
    #otherDonationsSection.donations-collapsed {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-6px);
        transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.25s ease;
        margin-bottom: 0;
        padding-bottom: 0;
        pointer-events: none;
    }

    #otherDonationsSection.donations-collapsed.is-open {
        max-height: 70vh;
        opacity: 1;
        transform: translateY(0);
        margin-bottom: inherit;
        padding-bottom: inherit;
        pointer-events: auto;
    }

    /* Liste içeriği için ekstra padding */
    #otherDonationsSection.donations-collapsed .sidebar__category-list {
        padding-top: 0;
        padding-bottom: 0;
    }

    #otherDonationsSection.donations-collapsed.is-open .sidebar__category-list {
        padding-top: inherit;
        padding-bottom: inherit;
    }
}

/* ============================================
   BAĞIŞ EKLE BOTTOM SHEET (MOBİL)
   ============================================ */

/* Desktop'ta gizle */
.donate-sheet-overlay,
.donate-sheet {
    display: none;
}

/* Sadece mobilde göster */
@media (max-width: 991px) {
    /* Overlay */
    .donate-sheet-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 10000;
        display: block;
    }

    .donate-sheet-overlay[hidden] {
        display: none;
    }

    /* Bottom Sheet */
    .donate-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 72vh;
        max-height: 72vh;
        background: #fff;
        border-top-left-radius: 22px;
        border-top-right-radius: 22px;
        box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.25);
        z-index: 10001;
        display: flex;
        flex-direction: column;
        transform: translateY(110%);
        transition: transform 0.28s ease;
        overflow: hidden;
    }

    .donate-sheet[hidden] {
        display: none;
    }

    .donate-sheet.is-open {
        transform: translateY(0);
    }

    /* Handle (üstteki çizgi) */
    .donate-sheet__handle {
        width: 44px;
        height: 5px;
        border-radius: 999px;
        background: rgba(15, 23, 42, 0.18);
        margin: 10px auto 6px;
        flex: 0 0 auto;
        cursor: grab;
    }

    .donate-sheet__handle:active {
        cursor: grabbing;
    }

    /* Header */
    .donate-sheet__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 14px;
        background: #fff;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        flex: 0 0 auto;
    }

    .donate-sheet__title {
        font-weight: 800;
        font-size: 16px;
        color: #0f172a;
        margin: 0;
    }

    .donate-sheet__close {
        width: 38px;
        height: 38px;
        border-radius: 14px;
        border: 0;
        background: rgba(15, 23, 42, 0.06);
        font-size: 24px;
        line-height: 1;
        color: #0f172a;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        transition: background 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .donate-sheet__close:hover {
        background: rgba(0, 0, 0, 0.1);
    }

    .donate-sheet__close:active {
        background: rgba(0, 0, 0, 0.15);
    }

    /* Content (scroll container) */
    .donate-sheet__content {
        flex: 1 1 auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px 14px calc(16px + env(safe-area-inset-bottom));
        overscroll-behavior: contain;
        min-height: 200px;
        background: #fff;
    }

    /* Sheet içindeki section'ların görünür olması */
    .donate-sheet__content > * {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* "Diğer Bağışlar" bloğunu sheet içinde zorla görünür yap */
    .donate-sheet #otherDonationsSection,
    .donate-sheet #otherDonationsSection.donations-collapsed,
    .donate-sheet #otherDonationsSection.donations-collapsed.is-open {
        max-height: none !important;
        opacity: 1 !important;
        transform: none !important;
        overflow: visible !important;
        display: block !important;
        visibility: visible !important;
        height: auto !important;
        margin-bottom: inherit !important;
        padding-bottom: inherit !important;
        pointer-events: auto !important;
    }

    /* Sheet içindeki liste container'ı */
    .donate-sheet #otherDonationsSection .sidebar__category-list {
        padding-top: inherit !important;
        padding-bottom: inherit !important;
        display: block !important;
    }

    /* Sheet içindeki "Diğer Bağışlar" section stilleri */
    .donate-sheet__content .sidebar__single,
    .donate-sheet__content .sidebar__category {
        margin: 0;
        padding: 0;
    }

    .donate-sheet__content .sidebar__title {
        margin-top: 0;
        margin-bottom: 12px;
        font-size: 18px;
        font-weight: 700;
    }

    .donate-sheet__content .sidebar__category-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .donate-sheet__content .sidebar__category-list li {
        margin-bottom: 8px;
    }

    .donate-sheet__content .sidebar__category-list li a {
        display: block;
        padding: 12px;
        border-radius: 8px;
        background: rgba(0, 0, 0, 0.02);
        transition: background 0.2s ease;
        text-decoration: none;
        color: inherit;
    }

    .donate-sheet__content .sidebar__category-list li a:hover {
        background: rgba(0, 0, 0, 0.05);
    }

    /* Sheet açıkken body scroll kilitli */
    html.sheet-open {
        overflow: hidden !important;
        height: 100%;
    }

    html.sheet-open body {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Placeholder gizli */
    #otherDonationsPlaceholder {
        display: none !important;
    }

    /* Weglot'u sheet içinde gizle */
    .donate-sheet .weglot-container,
    .donate-sheet .wg-default,
    .donate-sheet .weglot_switcher,
    .donate-sheet [class*="weglot"],
    .donate-sheet [id*="weglot"] {
        display: none !important;
    }

    /* Liste container - modern card tasarım */
    .donate-sheet .sidebar__category-list {
        margin: 0;
        padding: 8px;
        background: #f6f7f8;
        border-radius: 16px;
        list-style: none;
    }

    .donate-sheet .sidebar__category-list li {
        margin: 8px 0;
        background: #fff;
        border-radius: 14px;
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
        overflow: hidden;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        width: 100%;
    }

    .donate-sheet .sidebar__category-list li:active {
        transform: scale(0.99);
    }

    /* Liste linkleri - flex layout (grid değil, flex kullan) */
    .donate-sheet .sidebar__category-list a,
    .donate-sheet .donate-sheet-list a {
        display: flex !important;
        align-items: flex-start !important;
        gap: 10px !important;
        padding: 14px 12px !important;
        width: 100% !important;
        color: #0f172a !important;
        font-size: 15px !important;
        line-height: 1.25 !important;
        text-indent: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        text-decoration: none !important;
        transition: background 0.2s ease;
        flex-direction: row !important;
    }

    /* Tema bazen pseudo element ile "şerit" yapıp text'i gizler -> kapat */
    .donate-sheet .sidebar__category-list a::before,
    .donate-sheet .sidebar__category-list a::after,
    .donate-sheet .donate-sheet-list a::before,
    .donate-sheet .donate-sheet-list a::after,
    .donate-sheet .special-icon-listing a::before,
    .donate-sheet .special-icon-listing a::after {
        content: none !important;
        display: none !important;
    }

    /* special-icon-listing pseudo element'lerini kapat */
    .donate-sheet .special-icon-listing li::before,
    .donate-sheet .special-icon-listing li::after {
        content: none !important;
        display: none !important;
    }

    .donate-sheet .sidebar__category-list a:hover {
        background: rgba(15, 23, 42, 0.02);
    }

    /* Sol "+" ikonu badge */
    .donate-sheet .don-plus {
        width: 28px;
        height: 28px;
        border-radius: 10px;
        background: rgba(33, 113, 98, 0.14);
        color: #217162;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 900;
        font-size: 16px;
        line-height: 1;
        flex: 0 0 28px;
        margin-top: 2px;
    }

    /* Metin direkt a içinde olduğu için a elementine stil uygula */
    .donate-sheet .sidebar__category-list a,
    .donate-sheet .donate-sheet-list a {
        /* Metin stilleri - zorla görünür */
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
        line-height: 1.25 !important;
        text-indent: 0 !important;
        letter-spacing: normal !important;
        text-transform: none !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    /* donate-sheet-list için özel stiller */
    .donate-sheet .donate-sheet-list a,
    .donate-sheet .donate-sheet-list .don-text {
        color: #0f172a !important;
        font-size: 15px !important;
        line-height: 1.25 !important;
        text-indent: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Sağ ok ikonu kaldırıldı - CSS'den de gizle (güvenlik için) */
    .donate-sheet .sidebar__category-list a span.fa-angle-right,
    .donate-sheet .sidebar__category-list a .fa-angle-right,
    .donate-sheet .sidebar__category-list a .fa-chevron-right {
        display: none !important;
    }

    /* Liste başlığı */
    .donate-sheet .sidebar__title {
        font-size: 18px;
        font-weight: 700;
        color: #0f172a;
        margin-bottom: 12px;
        padding: 0 8px;
    }
}

