::-webkit-scrollbar {
    width: 13px; /*genislik 10px olsun*/
    background-color: #eaeaea; /*scrollbar arkaplan renk*/
    border-left: 1px solid #f1f1f1;  /*arkaplan sol tarafa cizgi cek*/
}
::-webkit-scrollbar-thumb {
    background-color: #623D91; /*scrollbar renk*/
    border-radius:15px /*oval olsun*/
}
::-webkit-scrollbar-thumb:hover { /*tiklandiginda*/
    background-color: #523276;
}

/* ====== OVERLAY (her iki sınıf adıyla da çalışır) ====== */
.rfb-overlay,
.popup-overlay{
    position: fixed !important;
    inset: 0 !important;                 /* top/right/bottom/left = 0 */
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    background: rgba(0,0,0,.6) !important;
    z-index: 999999 !important;          /* her şeyin üstünde */
    display: none !important;            /* .show ile açılacak */
    align-items: center !important;      /* dikey merkez */
    justify-content: center !important;  /* yatay merkez */
    /* bazı temalarda tıklanamaz olabiliyor */
    pointer-events: auto !important;
    /* MOBİL DÜZELTME: viewport sorunları için */
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
}

/* .show gelince görünür */
.rfb-overlay.show,
.popup-overlay.show{
    display: flex !important;
}

/* aria-hidden ile kontrol ediyorsan da destekler */
.rfb-overlay[aria-hidden="false"],
.popup-overlay[aria-hidden="false"]{
    display: flex !important;
}
.rfb-overlay[aria-hidden="true"],
.popup-overlay[aria-hidden="true"]{
    display: none !important;
}

.teklif-buton-lg{
    font-size: 15px !important;
    font-weight: 600;
    margin-left: 20px;
    margin-top: 8px !important;
}
.teklif-buton-sm{
    display: none !important;
}
.menulogo{
    margin-top: -6px;
}

@media(max-width:768px) {
    .teklif-buton-lg{
        display: none !important;
    }
    .teklif-buton-sm{
        font-size: 15px !important;
        font-weight: 600;
        display: grid !important;
        margin-top: 95px;
        width: 100px;
    }
    .menulogo{
        margin-top: -10px !important;
    }
}

/* ====== POPUP KUTUSU ====== */
.rfb-box,
.popup-box{
    position: relative !important;       /* flex içinde konum */
    background: #fff !important;
    width: min(1000px, 92vw) !important; /* genişlik */
    height: min(90vh, 900px) !important; /* yükseklik - DEĞİŞTİRMEDİM */
    border-radius: 12px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 20px 50px rgba(0,0,0,.4) !important;
    animation: rfb-pop .22s ease !important;
    /* MOBİL DÜZELTME: flex shrink ve safe area */
    flex-shrink: 0 !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
}

/* Flex bozulursa (tema çakışması), JS ile .fallback-center ekleyebilirsin */
.rfb-box.fallback-center,
.popup-box.fallback-center{
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    z-index: 1000000 !important;
}

/* ====== BAŞLIK ====== */
.rfb-header,
.popup-header{
    background: #623D91 !important;
    color: #fff !important;
    padding: 10px 14px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font: 600 15px/1 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important;
    user-select: none;
    /* MOBİL DÜZELTME: header'ın küçülmesini engelle */
    flex-shrink: 0 !important;
    min-height: 44px !important; /* touch target için minimum yükseklik */
}
.rfb-header .rfb-close,
.popup-header button,
.popup-header .rfb-close{
    background: none !important;
    border: 0 !important;
    color: #fff !important;
    font-size: 22px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 2px 6px !important;
    border-radius: 8px !important;
    /* MOBİL DÜZELTME: touch target büyütme */
    min-width: 44px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.rfb-header .rfb-close:hover,
.popup-header button:hover{
    background: rgba(255,255,255,.15) !important;
}

/* ====== İÇERİK (iframe alanı) - SCROLLBAR DÜZELTMESİ ====== */
.rfb-content,
.popup-content{
    flex: 1 1 auto !important;
    background: #f9fafb !important;
    overflow: hidden !important;         /* POPUP CONTAINER SCROLLBAR GİZLE */
    /* MOBİL DÜZELTME: webkit scroll ve minimum yükseklik */
    -webkit-overflow-scrolling: touch !important;
    min-height: 0 !important; /* flex child için gerekli */
}
.rfb-content iframe,
.popup-content iframe{
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    /* MOBİL DÜZELTME: iframe responsive */
    min-height: 300px !important;
    /* İFRAME KENDİ SCROLLBAR'INI KULLANSIN */
    overflow: auto !important;
}

/* MASAÜSTÜNDE POPUP CONTENT SCROLLBAR'INI GİZLE */
@media (min-width: 769px) {
    .rfb-content,
    .popup-content {
        overflow: hidden !important;
    }
}

/* Açılış animasyonu */
@keyframes rfb-pop{
    from { transform: scale(.98); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* ====== Mobil uyum ====== */
@media (max-width: 600px){
    .rfb-box, .popup-box{
        width: 95vw !important;
        height: 85vh !important;
        border-radius: 10px !important;
        /* MOBİL DÜZELTME: safe area ve margin */
        margin: env(safe-area-inset-top, 10px) env(safe-area-inset-right, 10px) env(safe-area-inset-bottom, 10px) env(safe-area-inset-left, 10px) !important;
        max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 20px) !important;
    }
    .rfb-header, .popup-header{
        padding: 8px 12px !important;
        font-size: 14px !important;
    }

    /* MOBİL DÜZELTME: Çok küçük ekranlar için */
    .rfb-overlay, .popup-overlay{
        padding: 10px !important;
        align-items: flex-start !important; /* üstten başlat */
        padding-top: max(20px, env(safe-area-inset-top, 0px)) !important;
    }
}

/* MOBİL DÜZELTME: Landscape mod için */
@media (max-width: 900px) and (orientation: landscape){
    .rfb-box, .popup-box{
        height: 95vh !important;
        width: 90vw !important;
    }
}

/* MOBİL DÜZELTME: iOS Safari için viewport fix */
@supports (-webkit-touch-callout: none) {
    .rfb-overlay, .popup-overlay{
        height: -webkit-fill-available !important;
    }
}

/* ====== Yaygın çakışma gidericiler ====== */
/* Bazı temalar overlay içindeki elemanlara transform/translate uygulayabilir */
.rfb-overlay *, .popup-overlay *{
    box-sizing: border-box;
}
/* Bazı temalar body/html'e overflow verip taşmayı engelliyor; gerekirse aç */
html.popup-open, body.popup-open{
    overflow: hidden !important; /* istersen JS ile overlay açıldığında bu class'ı ekle */
    /* MOBİL DÜZELTME: iOS scroll bounce engelleme */
    position: fixed !important;
    width: 100% !important;
}