/* Shared mobile safety rules for KunharIndia's admin, storefront and user pages. */
@media (max-width: 767px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    main,
    .mobile-layout-content {
        min-width: 0;
    }

    /* Tables preserve every column inside a touch-scrollable region. */
    .mobile-table-scroll,
    .overflow-x-auto,
    .overflow-auto,
    .overflow-scroll {
        max-width: 100%;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .mobile-table-scroll {
        overflow-x: auto;
    }

    .mobile-table-scroll > table {
        width: max-content;
        min-width: 100%;
        margin-bottom: 0;
    }

    /* Opt-in listing tables become cards; no column is removed. */
    table.mobile-card-table.mobile-card-ready,
    table.mobile-card-table.mobile-card-ready tbody {
        display: block;
        width: 100%;
        min-width: 0 !important;
    }

    table.mobile-card-table.mobile-card-ready thead {
        display: none;
    }

    table.mobile-card-table.mobile-card-ready tbody > tr {
        display: block !important;
        margin: 0.75rem;
        overflow: hidden;
        border: 1px solid #e5e7eb;
        border-radius: 0.75rem;
        background: #ffffff;
        box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
    }

    table.mobile-card-table.mobile-card-ready tbody > tr > td {
        display: block;
        width: 100%;
        box-sizing: border-box;
        padding: 0.75rem 1rem;
        white-space: normal;
        border: 0;
    }

    table.mobile-card-table.mobile-card-ready tbody > tr > td + td {
        border-top: 1px solid #f3f4f6;
    }

    table.mobile-card-table.mobile-card-ready tbody > tr > td[data-mobile-label]::before {
        content: attr(data-mobile-label);
        display: block;
        margin-bottom: 0.35rem;
        color: #6b7280;
        font-size: 0.6875rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    /* Prevent form controls and media from creating a page-level overflow. */
    main input:not([type='checkbox']):not([type='radio']):not([type='range']),
    main select,
    main textarea {
        max-width: 100%;
    }

    main img,
    main video,
    main iframe,
    main canvas {
        max-width: 100%;
    }
}
