/**
 * BissoPos — global responsive / overflow (Web: flexbox + dvh + safe-area)
 * Sabit px genişlik yerine esnek yapı; taşan içerik scroll.
 */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    margin: 0;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
}

img, video, svg, canvas {
    max-width: 100%;
    height: auto;
}

input, select, textarea, button {
    max-width: 100%;
}

table {
    max-width: 100%;
}

/* —— Giriş ekranı —— */
@media (max-width: 900px) {
    .auth-overlay,
    .auth-split {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .auth-split-left {
        flex: 1 1 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: clamp(12px, 4vw, 20px) clamp(12px, 4vw, 16px) !important;
    }

    .auth-form-wrap,
    .auth-field,
    .auth-field input,
    .auth-btn,
    .auth-links {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .auth-welcome {
        font-size: clamp(18px, 5vw, 22px);
        word-break: break-word;
    }

    .auth-brand-text {
        font-size: clamp(22px, 6vw, 28px);
    }
}

@media (min-width: 901px) and (max-width: 1100px) {
    .auth-split-left {
        flex: 0 0 50%;
        max-width: 50%;
        min-width: 0;
        padding: 24px clamp(16px, 3vw, 32px);
    }
}

/* —— Uygulama kabuğu (mobil + tablet) —— */
@media (max-width: 1100px) {
    .app-body {
        height: 100dvh;
        height: var(--m3-app-height, 100dvh);
        overflow: hidden;
    }

    .app-shell {
        height: 100dvh;
        height: var(--m3-app-height, 100dvh);
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    #app,
    .app-main,
    .app-main-scroll,
    .app-content,
    #mainContent {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .m3,
    .m3-shell,
    .m3s-shell,
    .m3s-pure,
    .phone-screen,
    .main-phone-screen,
    .m3-home-page,
    .fast-sales-page,
    .sales-page-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    /* Kaydırılabilir içerik alanları */
    .m3-home-scroll,
    .m3-scroll,
    .m3s-scroll,
    .m3-form-scroll,
    .m3-cari-detay-scroll,
    .customer-list-scroll,
    .form-content-area,
    .view-tx-scroll,
    .m3s-pure .main-content-flow,
    .m3s-pure .tx-scroll,
    .fast-sales-scroll,
    .m3-fast-body {
        flex: 1 1 auto;
        min-height: 0;
        min-width: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    /* Sabit alt bar — tam genişlik, px sınırı yok */
    .m3-form-footer,
    .m3s-foot,
    .m3s-foot--ref,
    .m3s-fixed-foot,
    .m3-mob-satis-foot,
    .fixed-footer-button-container,
    .m3s-pure .following-bottom-panel,
    .m3-fast-paybar,
    .m3-mobile-footer {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .m3-hdr,
    .m3s-hdr,
    .app-header,
    .black-header {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex-shrink: 0;
    }

    .m3-hdr .ttl,
    .m3s-hdr .ttl {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Geniş tablolar yatay kaydırma */
    .bh-list-table,
    .bh-md-grid,
    .bh-cust-list,
    .bh-inv-list,
    .bh-sp-table,
    .bh-fs-proto-table-wrap,
    .bh-fs-mu-table,
    .bh-fs-table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Çok dar telefon (320–360px) */
@media (max-width: 360px) {
    .auth-split-left {
        padding: 12px 12px !important;
    }

    .m3-dialog-box {
        width: calc(100% - 20px) !important;
        padding: 18px !important;
    }

    .m3-tiles {
        gap: 6px !important;
    }
}

/* Tablet yatay */
@media (min-width: 601px) and (max-width: 1100px) {
    .m3-home-page {
        max-width: 100%;
    }

    .m3-dialog-box {
        max-width: min(420px, 92vw) !important;
    }
}
