/* =============================================
   TILLOS TRAVEL — PWA & MOBİL İYİLEŞTİRME CSS
   Bu dosyayı site.css'in EN SONUNA ekleyin
   veya ayrı pwa-mobile.css olarak referans verin
   ============================================= */

/* ===== DİL DROPDOWN FIX ===== */
.language-dropdown {
    position: relative;
}

.language-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999;
    margin-top: 4px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    border: 1px solid rgba(0,0,0,0.1);
}

.language-dropdown .dropdown-menu.show {
    display: block;
}

/* Mobilde dropdown'un kesilmemesi için */
@media (max-width: 991.98px) {
    .language-dropdown .dropdown-menu {
        position: fixed;
        top: auto;
        left: 8px;
        right: 8px;
        width: auto;
        max-height: 70vh;
        overflow-y: auto;
        z-index: 9999;
    }
}

/* ===== PWA INSTALL BANNER ===== */
.pwa-install-banner {
    position: fixed;
    bottom: 70px; /* bottom nav üzerinde */
    left: 12px;
    right: 12px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 9999;
    animation: slideUpBanner 0.4s ease-out;
    border: 1px solid rgba(0,51,102,0.1);
}

@keyframes slideUpBanner {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.pwa-install-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
}

.pwa-install-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pwa-install-text strong {
    font-size: 14px;
    color: #003366;
    white-space: nowrap;
}

.pwa-install-text span {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-btn {
    background: linear-gradient(135deg, #003366, #0077b6);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.pwa-install-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,51,102,0.3);
}

.pwa-dismiss-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

/* Desktop'ta install banner */
@media (min-width: 769px) {
    .pwa-install-banner {
        bottom: 20px;
        left: auto;
        right: 20px;
        max-width: 380px;
    }
}

/* ===== MOBİL BOTTOM NAVIGATION BAR ===== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.08);
    z-index: 1040;
    padding-bottom: env(safe-area-inset-bottom, 0);
    border-top: 1px solid #eef1f5;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none;
    color: #8a9ab5;
    font-size: 10px;
    font-weight: 500;
    gap: 3px;
    padding: 8px 4px 6px;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.bottom-nav-item i {
    font-size: 20px;
    transition: transform 0.2s;
}

.bottom-nav-item span {
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.bottom-nav-item.active {
    color: #003366;
}

.bottom-nav-item.active i {
    transform: scale(1.1);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: #003366;
    border-radius: 0 0 4px 4px;
}

/* Ortadaki "Bilet Al" butonu - vurgulu */
.bottom-nav-center {
    position: relative;
}

.bottom-nav-center-btn {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #003366, #0077b6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -28px;
    box-shadow: 0 4px 16px rgba(0,51,102,0.35);
    transition: all 0.3s;
}

.bottom-nav-center-btn i {
    color: #fff;
    font-size: 22px;
}

.bottom-nav-center:active .bottom-nav-center-btn {
    transform: scale(0.92);
}

.bottom-nav-center span {
    color: #003366;
    font-weight: 600;
    margin-top: 2px;
}

/* ===== BODY PADDİNG - Bottom nav için boşluk ===== */
@media (max-width: 991.98px) {
    body {
        padding-bottom: 70px;
    }
    
    /* Footer alt padding */
    .main-footer {
        padding-bottom: 80px !important;
    }
    
    /* WhatsApp butonu bottom nav üzerinde */
    .whatsapp-float,
    .scroll-to-top,
    #scrollTop {
        bottom: 80px !important;
    }
    
    /* === BOTTOM NAV ÜZERİNE ÇIKARTMA ===
       Sayfanın altına yapışan tüm fixed bar'lar 
       (sefer seçim barı, fiyat barı vs.) 
       bottom nav'ın üzerinde gösterilsin */
    body > div[style*="fixed"],
    body > div[style*="sticky"],
    #selectedExpeditionBar,
    .selected-expedition-bar,
    .expedition-selection-bar,
    .ferry-selection-bar,
    .booking-action-bar,
    .checkout-sticky-bar {
        margin-bottom: 64px;
    }
}

/* ===== MOBİL GENEL İYİLEŞTİRMELER ===== */
@media (max-width: 991.98px) {
    
    /* Touch-friendly minimum boyutlar - HEADER HARİÇ */
    .main-content button, .main-content .btn, .main-content a.btn,
    .main-content input[type="submit"],
    .main-content input[type="button"],
    .main-content select,
    .mobile-menu-panel button, .mobile-menu-panel .btn,
    .modal button, .modal .btn,
    form button, form .btn, form a.btn,
    form input[type="submit"],
    form input[type="button"],
    form select {
        min-height: 44px;
    }
    
    /* Input'lar daha büyük - parmakla kolay kullanım */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    input[type="password"],
    textarea,
    select,
    .form-control,
    .form-select {
        font-size: 16px !important; /* iOS zoom engelleme */
        min-height: 48px;
        padding: 10px 14px;
        border-radius: 10px;
    }
    
    /* Kart düzenleme */
    .card {
        border-radius: 14px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.06);
        border: 1px solid #eef1f5;
    }
    
    .card-header {
        border-radius: 14px 14px 0 0 !important;
        padding: 14px 16px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    /* Container daha dar padding */
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* Header iyileştirme */
    .main-header {
        padding: 6px 0;
    }
    
    .main-header .navbar {
        height: auto;
        min-height: 48px;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 4px;
        overflow: visible;
    }
    
    .main-header .navbar-brand {
        flex-shrink: 0;
        margin-right: auto;
    }
    
    .main-header .navbar-brand img {
        height: 28px;
        width: auto;
        max-width: 85px;
    }

    /* Hamburger menü mobilde göster */
    .main-header .navbar-toggler {
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 5px 8px;
        order: 99;
        flex-shrink: 0;
    }
    
    /* Header butonları mobilde küçük ve sabit boyutlu */
    .main-header .header-btn {
        flex-shrink: 0;
        width: auto !important;
        min-height: auto !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
        border-radius: 6px;
    }
    
    /* Dil dropdown mobilde küçült */
    .main-header .language-dropdown {
        flex-shrink: 0;
    }
    
    .main-header .language-dropdown .dropdown-toggle {
        padding: 6px 10px;
        font-size: 12px;
        min-height: auto !important;
    }
    
    /* Hamburger menü butonu */
    .main-header .navbar-toggler {
        min-height: auto !important;
    }

    /* Top bar ortalama */
    .top-bar {
        text-align: center;
    }

    .top-bar .container .d-flex > div:first-child {
        width: 100%;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Tablo responsive */
    .table-responsive {
        border-radius: 10px;
    }
    
    table.table th,
    table.table td {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    /* Alert daha compact */
    .alert {
        padding: 12px 14px;
        font-size: 13px;
        border-radius: 10px;
    }
    
    /* Modal iyileştirme */
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-content {
        border-radius: 16px;
    }
    
    .modal-header {
        border-radius: 16px 16px 0 0;
        padding: 14px 16px;
    }
    
    /* Badge daha büyük */
    .badge {
        padding: 5px 10px;
        font-size: 11px;
        border-radius: 8px;
    }
    
    /* Sayfa h1/h2/h3 boyutları */
    h1, .h1 { font-size: 1.6rem; }
    h2, .h2 { font-size: 1.35rem; }
    h3, .h3 { font-size: 1.15rem; }
    h4, .h4 { font-size: 1rem; }
    
    /* Buton yığılmasını önle */
    .btn-group-vertical,
    .d-flex.gap-2 {
        flex-wrap: wrap;
    }
}

/* ===== ANA SAYFA MOBİL ===== */
@media (max-width: 991.98px) {
    
    /* Hero section daha compact */
    .hero-section {
        padding: 20px 0 30px 0 !important;
        overflow: visible !important;
        min-height: auto !important;
    }
    
    .hero-container {
        flex-direction: column !important;
        gap: 16px !important;
    }
    
    .hero-left {
        text-align: center;
    }
    
    .hero-left h1 {
        font-size: 1.5rem !important;
        margin-bottom: 4px;
    }
    
    .hero-left p {
        font-size: 0.9rem !important;
    }
    
    .hero-badge {
        display: none; /* Mobilde badge gizle, yer kazanma */
    }
    
    .announcement-slider {
        display: flex !important;
        flex-direction: column;
        min-width: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 15px 20px !important;
        min-height: 120px;
    }
    
    /* Arama formu mobil */
    .search-box,
    .search-card {
        border-radius: 16px !important;
        padding: 16px !important;
        margin: 0 -4px;
    }
    
    /* Rota kartları - tek sütun */
    .route-cards .row > div,
    .featured-routes .col-lg-3,
    .featured-routes .col-md-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* Rota kartları - yatay layout */
    .route-card {
        flex-direction: row !important;
        padding: 12px 16px !important;
        gap: 12px;
        border-radius: 12px !important;
    }
    
    .route-card .route-icon,
    .route-card .route-image {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }
    
    .route-card .route-info {
        flex: 1;
    }
    
    .route-card .route-price {
        white-space: nowrap;
    }
}

/* ===== SEFER SONUÇLARI MOBİL ===== */
@media (max-width: 991.98px) {
    
    /* Sefer kartları - kart görünümü */
    .expedition-card,
    .result-card {
        border-radius: 14px !important;
        padding: 14px !important;
        margin-bottom: 12px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    }
    
    /* Sefer detayları - dikey stack */
    .expedition-details {
        flex-direction: column !important;
    }
    
    .expedition-time {
        font-size: 1.3rem !important;
    }
    
    /* Fiyat daha belirgin */
    .expedition-price,
    .price-badge {
        font-size: 1.2rem !important;
        font-weight: 700;
    }
    
    /* Seçim butonu tam genişlik */
    .expedition-card .btn,
    .result-card .btn-select {
        width: 100% !important;
        min-height: 48px;
        font-size: 15px;
        border-radius: 12px !important;
        margin-top: 10px;
    }
    
    /* Sticky bottom fiyat barı */
    .price-summary-bar,
    .sticky-price-bar {
        position: fixed;
        bottom: 64px; /* bottom nav üstünde */
        left: 0;
        right: 0;
        background: #fff;
        padding: 12px 16px;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
        z-index: 1030;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-top: 1px solid #eee;
    }
    
    /* Genel: Sayfanın altına fixed yapışan tüm bar'lar bottom nav üstünde olsun */
    [style*="position: fixed"][style*="bottom: 0"],
    [style*="position:fixed"][style*="bottom:0"],
    div[style*="position: fixed"][style*="bottom"],
    .fixed-bottom,
    .sticky-bottom {
        bottom: 64px !important;
    }
}

/* ===== CHECKOUT/PASSENGERS MOBİL ===== */
@media (max-width: 991.98px) {
    
    /* Yolcu formları accordion tarzı */
    .passenger-form,
    .passenger-card {
        border-radius: 14px !important;
        margin-bottom: 12px;
        overflow: hidden;
    }
    
    .passenger-form .card-header,
    .passenger-card .card-header {
        padding: 12px 16px;
        cursor: pointer;
    }
    
    /* İki sütunlu alanlar alt alta */
    .passenger-form .row > .col-md-6,
    .passenger-form .row > .col-md-4,
    .passenger-form .row > .col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }
    
    /* İsim alanları yan yana kalsın */
    .passenger-form .name-row > .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    /* Doğum tarihi - native picker */
    .passenger-form input[type="date"],
    .passenger-form .flatpickr-input {
        font-size: 16px !important;
    }
    
    /* Fatura bölümü */
    .invoice-section {
        margin-top: 16px;
    }
    
    /* Özet sidebar - mobilde üstte */
    .checkout-sidebar,
    .order-summary {
        order: -1 !important;
        margin-bottom: 16px;
        position: sticky;
        top: 60px;
        z-index: 100;
    }
}

/* ===== ÖDEME SAYFASI MOBİL ===== */
@media (max-width: 991.98px) {
    
    /* Kredi kartı formu */
    .payment-card-form {
        padding: 16px;
        border-radius: 14px;
    }
    
    /* Kart numarası büyük */
    .card-number-input,
    #cardNo {
        font-size: 18px !important;
        letter-spacing: 2px;
        text-align: center;
    }
    
    /* Taksit seçimi grid */
    .installment-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .installment-option {
        border-radius: 10px;
        padding: 10px;
        text-align: center;
        border: 2px solid #eee;
        cursor: pointer;
    }
    
    .installment-option.selected,
    .installment-option:active {
        border-color: #003366;
        background: rgba(0,51,102,0.05);
    }
    
    /* Banka logoları */
    .bank-logos {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .bank-logo {
        width: 60px;
        height: 36px;
        object-fit: contain;
        border: 1px solid #eee;
        border-radius: 6px;
        padding: 4px;
    }
}

/* ===== VOUCHER/BİLET MOBİL ===== */
@media (max-width: 991.98px) {
    
    /* Bilet kartı */
    .voucher-card,
    .ticket-card {
        border-radius: 16px;
        overflow: hidden;
    }
    
    /* QR kod ortala */
    .qr-code-section {
        text-align: center;
        padding: 20px;
    }
    
    .qr-code-section img,
    .qr-code-section canvas {
        max-width: 200px;
        margin: 0 auto;
    }
    
    /* Paylaş/İndir butonları */
    .voucher-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 16px;
    }
    
    .voucher-actions .btn {
        border-radius: 10px;
        font-size: 13px;
    }
}

/* ===== SEFER TAKVİMİ MOBİL ===== */
@media (max-width: 991.98px) {
    .timetable-table {
        font-size: 12px;
    }
    
    .timetable-table th,
    .timetable-table td {
        padding: 8px 6px;
        white-space: nowrap;
    }
}

/* ===== PWA STANDALONE MODE ===== */
@media all and (display-mode: standalone) {
    /* PWA olarak açıldığında - status bar alanı */
    .sticky-header-wrapper {
        padding-top: env(safe-area-inset-top, 0);
    }
    
    .main-header {
        /* safe-area header'ın kendisine değil wrapper'a */
    }
    
    .mobile-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    
    /* Body padding status bar için */
    body {
        padding-top: env(safe-area-inset-top, 0);
    }
}

/* ===== iOS SAFE AREA ===== */
@supports (padding: max(0px)) {
    .mobile-bottom-nav {
        height: calc(64px + env(safe-area-inset-bottom, 0));
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    
    @media (max-width: 991.98px) {
        body {
            padding-bottom: calc(70px + env(safe-area-inset-bottom, 0));
        }
    }
}

/* ===== SMOOTH SCROLL & TOUCH ===== */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ===== PULL TO REFRESH ENGELLEME (tarayıcıda, PWA'da native çalışsın) ===== */
body.no-pull-refresh {
    overscroll-behavior-y: contain;
}

/* ===== SKELETON LOADING ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 22px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 120px; margin-bottom: 12px; }
.skeleton-btn { height: 48px; width: 100%; }

/* ===== LOADING OVERLAY GÜNCELLEME ===== */
#loadingOverlay.active,
.search-loading-overlay.active {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ===== FOOTER MOBİL ===== */
@media (max-width: 991.98px) {
    .main-footer {
        text-align: center;
    }
    
    .main-footer .row > div {
        margin-bottom: 24px;
    }
    
    .main-footer h5 {
        font-size: 1rem;
    }
    
    .main-footer ul li {
        padding: 6px 0;
    }
    
    /* Harita gizle mobilde */
    .footer-map {
        display: none;
    }
    
    .footer-bottom {
        padding: 16px 0;
        font-size: 12px;
    }
}

/* ===== TOP BAR MOBİL ===== */
@media (max-width: 991.98px) {
    .top-bar {
        font-size: 11px;
        padding: 4px 0;
    }
    
    .top-bar .d-flex {
        justify-content: center !important;
    }
}

/* ===== GEÇİŞ ANİMASYONLARI ===== */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
