/* ==========================================================================
   DUYEM ELEKTRONİK — MOBİL DENEYİM & RESPONSIVE MİMARİ (index.html)
   Masaüstü görünümü bozmadan mobil cihazlarda (320px – 768px) sıfır taşma,
   dokunmatik uyum, okunabilirlik ve hızlı aksiyon deneyimi sağlar.
   ========================================================================== */

/* Yatay taşma koruması (tüm ekranlar) */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

section[id] {
    scroll-margin-top: 86px;
}

/* Mobil Alt Hızlı Aksiyon Barı (Masaüstünde gizli) */
.duyem-mobile-dock {
    display: none;
}

@media (max-width: 768px) {
    /* Mobil alt sabit bar için sayfa sonu boşluğu */
    body {
        padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    }

    /* iOS Safari input odaklanınca istem dışı yakınlaştırmayı (auto-zoom) engelle */
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Navbar & Mobil Menü hizalama düzeltmesi */
    .nav-container {
        padding: 0.7rem 1rem !important;
    }

    .nav-links.mobile-menu-open {
        background: rgba(5, 11, 20, 0.98) !important;
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-bottom: 1px solid rgba(59, 130, 246, 0.3) !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
        padding: 1.25rem 1rem 1.5rem 1rem !important;
        gap: 0.85rem !important;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .nav-links.mobile-menu-open a {
        width: 100%;
        padding: 0.55rem 0.75rem;
        border-radius: 10px;
        text-align: center;
        justify-content: center;
    }

    .nav-links.mobile-menu-open .btn-neon {
        margin-left: 0 !important;
        width: 100%;
        padding: 0.75rem 1.25rem !important;
    }

    .nav-links.mobile-menu-open .lang-switch {
        margin-left: 0 !important;
        justify-content: center;
    }

    /* Canlı Cihaz Takip input + buton mobilde taşmadan alt alta temiz dursun */
    #canli-takip .glass-card > div:first-child {
        gap: 0.85rem !important;
    }

    #canli-takip #trackInput {
        padding: 0.85rem 1rem !important;
        padding-right: 1rem !important;
        border-radius: 14px !important;
        margin-bottom: 0.6rem;
    }

    #canli-takip #trackInput + button {
        position: static !important;
        width: 100%;
        padding: 0.82rem 1.2rem !important;
        border-radius: 14px !important;
    }

    /* Video Vitrin (Spotlight) — Mobilde siyah boşluksuz tam 16:9 */
    .duyem-spotlight-wrap {
        margin-bottom: 1.5rem;
    }

    .duyem-spotlight-card {
        border-radius: 18px;
    }

    .duyem-spotlight-media {
        min-height: 0 !important;
        aspect-ratio: 16 / 9;
    }

    .duyem-sound-toggle {
        top: 10px;
        right: 10px;
        padding: 0.38rem 0.75rem;
        font-size: 0.76rem;
    }

    .duyem-spotlight-info {
        padding: 1.15rem !important;
        gap: 0.9rem;
    }

    .duyem-spotlight-title {
        font-size: 1.22rem !important;
    }

    .duyem-spotlight-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.55rem;
    }

    .duyem-spotlight-actions a,
    .duyem-spotlight-actions button {
        width: 100%;
        padding: 0.72rem 0.65rem !important;
        font-size: 0.85rem !important;
    }

    /* Önceki Videolar & Paylaşımlar — Mobilde 2 sütun kompakt küçük kartlar! */
    .duyem-filters-bar {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.4rem;
        margin-bottom: 1.25rem;
        scrollbar-width: none;
    }
    .duyem-filters-bar::-webkit-scrollbar { display: none; }
    .duyem-filter-pill { flex-shrink: 0; font-size: 0.82rem; padding: 0.45rem 0.9rem; }

    .duyem-feed-grid.compact-mode {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }

    .duyem-feed-grid.compact-mode .duyem-card {
        border-radius: 14px;
    }

    .duyem-feed-grid.compact-mode .duyem-card-body {
        padding: 0.7rem 0.72rem 0.75rem 0.72rem !important;
        gap: 0.35rem;
    }

    .duyem-feed-grid.compact-mode .duyem-card-title {
        font-size: 0.84rem !important;
        line-height: 1.3;
    }

    .duyem-feed-grid.compact-mode .duyem-card-desc {
        display: none;
    }

    .duyem-feed-grid.compact-mode .duyem-card-meta-top {
        font-size: 0.7rem;
    }

    .duyem-feed-grid.compact-mode .duyem-cat-badge {
        font-size: 0.68rem;
        padding: 0.18rem 0.48rem;
    }

    .duyem-feed-grid.compact-mode .duyem-card-footer {
        padding-top: 0.55rem;
        margin-top: 0.2rem;
    }

    .duyem-feed-grid.compact-mode .duyem-icon-action {
        padding: 0.28rem 0.48rem;
        font-size: 0.74rem;
    }

    .duyem-feed-grid.compact-mode .duyem-read-more-btn {
        font-size: 0.74rem;
    }

    .duyem-feed-grid.compact-mode .duyem-card-play-badge {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    /* Hızlı Arıza Kodu Sorgulama — Mobil dokunmatik rahatlık */
    .duyem-fault-lookup {
        padding: 1.15rem !important;
        border-radius: 18px;
        margin-bottom: 1.75rem;
    }

    .duyem-fault-search-row {
        flex-direction: column;
    }

    .duyem-fault-search-row button {
        width: 100%;
    }

    .duyem-fault-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.3rem;
        scrollbar-width: none;
    }
    .duyem-fault-chips::-webkit-scrollbar { display: none; }
    .duyem-fault-chip { flex-shrink: 0; }

    /* Hizmet Kartları & Görselleri */
    .service-item .service-images img {
        height: 104px !important;
    }

    .service-item.glass-card::before {
        opacity: 0.85;
        bottom: 10px;
        right: 12px;
        font-size: 0.74rem;
    }

    /* Hizmet Detay Modalı & Tablolar — Mobilde yatay taşmadan rahat okuma */
    .service-modal {
        padding: 1.35rem 1.1rem !important;
        border-radius: 18px !important;
        max-height: 92vh;
    }

    .modal-header {
        margin-bottom: 1.15rem;
        padding-right: 2rem;
    }

    .modal-icon {
        width: 52px;
        height: 52px;
        font-size: 1.65rem;
        border-radius: 14px;
        flex-shrink: 0;
    }

    .modal-title h3 {
        font-size: 1.2rem;
    }

    .duyem-code-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.8rem;
    }

    .duyem-code-table th,
    .duyem-code-table td {
        padding: 0.5rem 0.55rem;
    }

    .duyem-code-table .code-cell {
        white-space: normal;
        min-width: 90px;
    }

    /* Dijital Broşürler Carousel — Mobilde 150px siyah gölgeyi 28px'e düşür! */
    .carousel-wrapper {
        overflow: hidden !important;
        padding: 1rem 0 !important;
    }

    .carousel-wrapper::before,
    .carousel-wrapper::after {
        width: 28px !important;
        pointer-events: none;
    }

    .carousel-slide {
        width: 175px !important;
        height: 260px !important;
    }

    /* Online İşlemler Sekmeleri */
    .service-tabs {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem !important;
        margin-bottom: 1.25rem !important;
    }

    .service-tabs .tab-btn {
        padding: 0.72rem 0.5rem !important;
        font-size: 0.88rem !important;
        border-radius: 14px !important;
        text-align: center;
    }

    /* Mobilde üst üste binen sağ alt yuvarlak butonları gizle; şık alt sabit barı göster! */
    .whatsapp-btn,
    .ai-bot-btn,
    .duyem-scroll-top {
        display: none !important;
    }

    .duyem-mobile-dock {
        display: grid;
        grid-template-columns: 1fr 1fr 1.1fr;
        gap: 0.5rem;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9990;
        padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom, 0px)) 0.75rem;
        background: rgba(5, 11, 20, 0.94);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-top: 1px solid rgba(59, 130, 246, 0.28);
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.65);
    }

    .duyem-dock-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        padding: 0.7rem 0.5rem;
        border-radius: 12px;
        font-family: var(--font-main);
        font-size: 0.84rem;
        font-weight: 700;
        text-decoration: none;
        border: none;
        cursor: pointer;
        color: #ffffff;
        transition: transform 0.15s ease;
    }

    .duyem-dock-btn:active {
        transform: scale(0.96);
    }

    .duyem-dock-btn.call {
        background: #2563eb;
        box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    }

    .duyem-dock-btn.wa {
        background: #10b981;
        box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    }

    .duyem-dock-btn.ai {
        background: linear-gradient(135deg, #3b82f6, #9333ea);
        box-shadow: 0 4px 14px rgba(147, 51, 234, 0.35);
    }

    /* Sohbet kutusu mobilde alt barın hemen üstünde ferah açılsın (çift çerçevesiz, sıfır çakışma) */
    .ai-chatbox.duyem-ai-v2 {
        left: 0.55rem !important;
        right: 0.55rem !important;
        width: auto !important;
        max-width: none !important;
        padding: 0 !important;
        bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
        height: 70vh !important;
        max-height: calc(100vh - 148px) !important;
        border-radius: 20px !important;
    }

    /* Post Detay Modal mobilde tam ferah */
    .duyem-modal-overlay {
        padding: 0.6rem;
    }

    .duyem-modal-box {
        border-radius: 18px;
        max-height: 94vh;
    }
}

/* Çok küçük telefonlar (< 360px) */
@media (max-width: 360px) {
    .duyem-feed-grid.compact-mode {
        grid-template-columns: 1fr !important;
    }
    .duyem-dock-btn {
        font-size: 0.78rem;
        padding: 0.65rem 0.35rem;
    }
}
