/* ===== Mobil "Odalar ve Misafirler" Alt Sheet ===== */
/* Mobil tarih seciciyle (mobile-datepicker.css) ayni davranisi hedefler:
   ekranin altina yapisan bir sheet + baslik cubugu + "Tamam" onay butonu. */

/* Backdrop, sheet ile AYNI ebeveynin (.searchMenu-guests) icine eklenir.
   Sheet bir ust ogenin stacking context'ine sikistigi icin body seviyesindeki
   bir backdrop sheet'in ustunde kaliyordu; ayni context'te olunca z-index
   siralamasi dogru calisir. */
.gm-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99997;
}
.gm-backdrop.gm-bd-show {
    display: block;
}

/* Baslik/alt cubuk DOM'da kalir; sadece sheet modunda gorunur. */
.gm-title,
.gm-bar {
    display: none;
}

@media (max-width: 767px) {

    /* Alt menu (.mobile-bottom-nav) sheet'ten daha yuksek bir yiginda
       durabildigi icin z-index yarisina girmek yerine sheet acikken
       tamamen gizliyoruz — display her zaman z-index'i yener. */
    body.gm-sheet-open .mobile-bottom-nav {
        display: none !important;
    }

    /* Otel detayindaki "Rezervasyon Yap" alt cubugu (.bk-footer) yuzen
       telefon/WhatsApp butonlarinin ustunde kalmak icin yuksek z-index
       (100030) kullaniyor - bu deger "Odalar ve Misafirler" sheet'inden
       (99999) de yuksek oldugu icin sheet acikken cubuk sheet'in ustunde
       gorunuyordu. Sheet acikken cubugu gizliyoruz. */
    body.gm-sheet-open .hotel_room_book_status.bk-footer {
        display: none !important;
    }

    /* Sayfa arkada kaymasin */
    body.gm-sheet-open {
        overflow: hidden !important;
    }

    /* Alt sheet container — ekranin en altina yapisir, bottom menuyu orter */
    .searchMenu-guests__field.gm-sheet {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        background: #fff;
        border-radius: 20px 20px 0 0;
        z-index: 99999 !important;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2) !important;
        overflow: hidden;
        transition: transform 0.32s cubic-bezier(.4, 0, .2, 1) !important;
        /* Baslik sabit, icerik esneyip kayar, alt cubuk sabit: boylece Cocuk
           satiri ve cocuk yaslari kesilmeden erisilebilir kaliyor. */
        display: flex !important;
        flex-direction: column !important;
        max-height: 88vh !important;
    }
    .searchMenu-guests__field.gm-sheet > .gm-title { flex: 0 0 auto; }

    /* Icerik alani — alt cubugu ortmemesi icin padding, tasarsa scroll */
    .searchMenu-guests__field.gm-sheet > .bg-white {
        border-radius: 0 !important;
        padding: 16px 20px !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Baslik cubugu */
    .gm-sheet > .gm-title {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px 20px 14px;
        border-bottom: 1px solid #f0f0f0;
    }

    /* Surukleme cubugu */
    .gm-title .gm-handle {
        width: 40px;
        height: 4px;
        background: #d8d8d8;
        border-radius: 2px;
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
    }

    .gm-title > span {
        font-weight: 700;
        font-size: 17px;
        color: #1a1a1a;
    }

    /* Kapat butonu */
    .gm-title .gm-close {
        background: #f2f2f2;
        border: none;
        border-radius: 50%;
        width: 34px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        color: #555;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0;
        line-height: 1;
    }

    /* Alt ozet cubugu — sheet'in en altinda */
    .gm-sheet > .gm-bar {
        position: static !important;
        flex: 0 0 auto !important;
        height: auto !important;
        background: #fff;
        border-top: 1px solid #ebebeb;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 20px calc(14px + max(env(safe-area-inset-bottom, 0px), 6px));
        gap: 12px;
    }

    .gm-bar .gm-info {
        font-size: 14px;
        font-weight: 600;
        color: #222;
        flex: 1;
    }

    /* Tamam butonu */
    /* Tarih sheet'indeki .drp-m-ok ile birebir ayni; tema button stilleri
       ezmesin diye !important ile veriliyor. */
    .gm-bar .gm-ok {
        background: #3554D1 !important;
        color: #fff !important;
        border: none !important;
        border-radius: 8px !important;
        padding: 10px 22px !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        line-height: 1.4 !important;
        height: auto !important;
        min-height: 0 !important;
        width: auto !important;
        font-family: inherit !important;
        text-transform: none !important;
        box-shadow: none !important;
        cursor: pointer;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .gm-bar .gm-ok:active {
        background: #2a44b8;
    }

    /* ===== Sayac (- 2 +) araligi =====
       .count-display'e verilen size-20 (20x20px) kutu, bazi cihazlarda
       number input'un dogal genisliginden dar kaliyor ve rakam eksi/arti
       butonlarinin arasinda kirpiliyordu. Kutuyu sabit 46px'e cikarip
       input'u ortaliyoruz; butonlar da kuculmesin diye flex-shrink:0. */
    .searchMenu-guests__field.gm-sheet .count-display {
        width: 46px !important;
        min-width: 46px !important;
        height: auto !important;
        margin-left: 8px !important;
        margin-right: 8px !important;
        overflow: visible !important;
        flex: 0 0 46px !important;
    }
    .searchMenu-guests__field.gm-sheet .count-display input[type="number"] {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        text-align: center !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        line-height: 1.2 !important;
        color: #1a1a1a;
        /* Cevirici oklar yer kapliyor ve rakami sola itiyordu */
        -moz-appearance: textfield;
        appearance: textfield;
    }
    .searchMenu-guests__field.gm-sheet .count-display input[type="number"]::-webkit-outer-spin-button,
    .searchMenu-guests__field.gm-sheet .count-display input[type="number"]::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
    .searchMenu-guests__field.gm-sheet .btn-minus,
    .searchMenu-guests__field.gm-sheet .btn-add {
        flex: 0 0 auto !important;
    }
}

