/*
 * smsVerificationService — global responsive layer.
 *
 * Loaded LAST from every master/base template so it can override page-local
 * styles without !important spam. Breakpoints mirror Bootstrap 5 plus the
 * project-wide spec from the user:
 *   mobile        : ≤ 768px
 *   tablet        : 769px — 1024px
 *   desktop       : ≥ 1025px
 *
 * Goals (per spec):
 *   1. No horizontal scroll on any page.
 *   2. ≥ 44px tap targets on mobile (Apple HIG).
 *   3. ≥ 14px body text on mobile.
 *   4. Form fields full-width and ≥ 16px on mobile (avoids iOS auto-zoom).
 *   5. Data tables wrapped in horizontal-scroll containers, with a card-view
 *      fallback at < 640px when the row markup includes data-label="…" cells.
 *   6. Navbars collapse to a hamburger ≤ 991.98px (Bootstrap default); bell
 *      icon and user avatar stay visible alongside the hamburger.
 *   7. Buttons / CTAs full-width on mobile when in a single-button row.
 *
 * Authors: Cursor agent — keep this file the single source of truth, do not
 * scatter mobile rules across page templates.
 */

/* ──────────────────────────────────────────────────────────────────────────
 * 0. UNIVERSAL: kill horizontal scroll, normalise images, sticky footer.
 *
 * The sticky-footer rules pin <footer> (or any element with class
 * .sfs-site-footer / .site-footer / footer.account-footer) to the bottom
 * of the viewport when the page content is shorter than the screen.
 * Without this, short pages (e.g. a freshly-loaded /dashboard/ with no
 * orders yet) leave a big white gap below the footer.
 * ────────────────────────────────────────────────────────────────────────── */
html,
body {
    height: 100%;
    margin: 0;
    max-width: 100vw;
    overflow-x: hidden;
}
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
/* The footer is the last visible block in <body> on every layout; pushing
 * it down with margin-top:auto inside a flex column makes it stick to the
 * viewport bottom when content is short, and behave naturally otherwise. */
body > footer,
body > .sfs-site-footer,
body > .site-footer,
body > footer.account-footer,
body > footer.marketing-site-footer {
    margin-top: auto;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
    height: auto;
}

/* Generic responsive table wrapper applied automatically to any <table>
 * that sits inside a `.table-responsive-auto` parent. Use this when you
 * cannot edit the table markup directly. */
.table-responsive-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-responsive-auto > table {
    min-width: max-content;
}

/* ──────────────────────────────────────────────────────────────────────────
 * 1. MOBILE (≤ 768px)
 * ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {

    /* 1.1 Typography — minimum readable sizes. */
    body {
        font-size: 14px;
        line-height: 1.55;
    }
    h1, .h1 { font-size: 1.85rem;  line-height: 1.18; }
    h2, .h2 { font-size: 1.55rem;  line-height: 1.22; }
    h3, .h3 { font-size: 1.3rem;   line-height: 1.28; }
    h4, .h4 { font-size: 1.125rem; line-height: 1.3;  }
    h5, .h5 { font-size: 1rem;     line-height: 1.35; }
    h6, .h6 { font-size: 0.95rem;  line-height: 1.4;  }

    /* 1.2 Touch-target minimums for every interactive control.
     *     Apple HIG: 44×44 CSS px.  Material: 48×48.  We pick 44.        */
    .btn,
    button:not(.navbar-toggler):not(.btn-close):not(.dropdown-toggle--inline),
    .dropdown-item,
    .nav-link,
    .page-link,
    a.btn,
    a.copy-btn,
    .btn-copy,
    .copy-button,
    [data-action="copy"],
    .price-page__buy {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding-top: 0.55rem;
        padding-bottom: 0.55rem;
    }
    .form-control,
    .form-select,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="number"],
    input[type="url"],
    select,
    textarea {
        min-height: 44px;
        font-size: 16px !important;            /* prevent iOS auto-zoom on focus */
        width: 100%;
        max-width: 100%;
    }

    /* 1.3 Forms — full-width inputs, full-width primary buttons in single-button rows. */
    form .row > [class*="col-"] {
        margin-bottom: 0.75rem;
    }
    .btn-block-mobile,
    form .btn-primary,
    .form-actions .btn,
    .auth-actions .btn {
        width: 100%;
    }

    /* 1.4 Tables — horizontal scroll wrapper + sticky-first-column for readability.
     *     Bootstrap's `.table-responsive` works out of the box when present;
     *     this rule rescues bare `<table>` markup left over in legacy pages. */
    .table-responsive,
    .dashboard-table-wrapper,
    .order-history-wrap,
    .price-page__table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100vw;
    }
    table.table,
    table.dashboard-table,
    table.price-page__table {
        min-width: 640px;                     /* forces the wrapper to scroll */
        font-size: 0.875rem;
    }
    table th, table td {
        padding: 0.55rem 0.65rem !important;
        white-space: nowrap;
    }
    table .copy-button,
    table .btn-copy {
        min-width: 44px;
        min-height: 44px;
    }

    /* 1.5 Stack `.d-flex .flex-row` rows that aren't already explicitly
     *     marked as md+/lg+ with Bootstrap's flex-md-row utility. */
    .stack-mobile,
    .stack-on-mobile {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .stack-mobile > *,
    .stack-on-mobile > * {
        width: 100%;
        margin-left: 0 !important;
    }

    /* 1.6 Radio / checkbox groups — stack vertically. The dashboard rental
     *     selector wraps three radios in `.rental-options` (or .form-check
     *     siblings) — make them column on mobile. */
    .rental-options,
    .form-check-group,
    .radio-group,
    .dashboard-rental-options {
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
    }
    .rental-options .form-check,
    .form-check-group .form-check,
    .radio-group .form-check {
        width: 100%;
        padding-left: 1.75rem;
    }
    .rental-options .form-check-input,
    .form-check-group .form-check-input {
        margin-top: 0.7rem;                   /* keeps radio centred against text */
    }

    /* 1.7 Cards / containers — kill big desktop padding so content
     *     reaches close to the screen edge. */
    .card,
    .panel,
    .price-page__table-wrap {
        border-radius: 14px;
    }
    .card-body { padding: 1rem; }
    .container,
    .container-fluid { padding-left: 1rem; padding-right: 1rem; }

    /* 1.8 Navbar — bell + user avatar stay visible alongside the hamburger
     *     toggle.  Navbars in this project hide the bell with .d-none.d-md-flex
     *     style classes; that visually loses the notification bell on phones. */
    .navbar .nav-bell-wrap,
    .navbar .nav-user-wrap,
    .navbar .nav-bell-toggle,
    .navbar .nav-user-toggle {
        display: inline-flex !important;
    }
    .navbar-toggler {
        min-width: 44px;
        min-height: 44px;
        padding: 0.4rem 0.65rem;
        border-radius: 8px;
    }
    /* Bell badge slightly bigger so it's visible at thumb distance. */
    .navbar .nav-bell-badge {
        font-size: 0.7rem;
        min-width: 1.1rem;
        min-height: 1.1rem;
        padding: 0 0.3rem;
    }
    /* Make collapsed nav links full-width tap targets. */
    .navbar-collapse .nav-link,
    .navbar-collapse .dropdown-item,
    .navbar-collapse .btn {
        width: 100%;
        text-align: left;
        padding-left: 0.75rem;
    }
    .navbar-collapse .navbar-nav {
        gap: 0.25rem;
    }
    /* Soft-shadow drawer when expanded. */
    .navbar-collapse.show {
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
        border-radius: 0 0 14px 14px;
        padding: 0.75rem;
        margin-top: 0.5rem;
    }
    body.public-home-cyber .navbar-collapse.show {
        background: #ffffff;
    }

    /* 1.9 Marketing CTAs / pricing buy buttons — full width on mobile. */
    .price-page__buy,
    .price-page__search-wrap,
    .home-cyber-cta-row,
    .home-cyber-btn-primary,
    .home-cyber-btn-ghost {
        width: 100% !important;
    }
    .home-cyber-cta-row {
        flex-direction: column;
        align-items: stretch;
    }
    .home-cyber-cta-row > * {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    /* 1.10 Pricing toolbar — stack search + per-page on mobile. */
    .price-page__toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .price-page__per-wrap {
        width: 100%;
        justify-content: flex-end;
    }

    /* 1.11 Top bar (balance / spending widget on marketing master): wrap. */
    .top-bar-wrapper {
        flex-direction: column !important;
        gap: 0.5rem;
    }
    .top-bar-item {
        width: 100%;
    }

    /* 1.12 Footer columns — stack instead of squashing 4 cols into 320px. */
    footer .row > [class*="col-"] {
        margin-bottom: 1.25rem;
    }
}

/* ──────────────────────────────────────────────────────────────────────────
 * 2. CARD-VIEW FALLBACK FOR DATA TABLES (≤ 640px)
 *
 * Markup contract: <td data-label="Number">+1 555…</td>
 * Tables tagged with `.table-card-mobile` will collapse rows into stacked
 * cards on tiny screens.  When the markup doesn't include data-label,
 * the table still scrolls horizontally via rule 1.4 above (no regression).
 * ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    table.table-card-mobile,
    table.table-card-mobile thead,
    table.table-card-mobile tbody,
    table.table-card-mobile tr,
    table.table-card-mobile td {
        display: block;
        width: 100%;
    }
    table.table-card-mobile thead {
        position: absolute;
        left: -9999px;
        top: -9999px;
        visibility: hidden;
    }
    table.table-card-mobile tr {
        margin-bottom: 0.85rem;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: #ffffff;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
        overflow: hidden;
    }
    table.table-card-mobile td {
        padding: 0.7rem 0.95rem !important;
        border: none !important;
        border-bottom: 1px solid #f1f5f9 !important;
        text-align: right;
        white-space: normal !important;
        position: relative;
        min-height: 44px;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }
    table.table-card-mobile td:last-child {
        border-bottom: none !important;
    }
    table.table-card-mobile td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-weight: 700;
        color: #475569;
        font-size: 0.75rem;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        text-align: left;
    }
    table.table-card-mobile td:not([data-label])::before {
        display: none;
    }
}

/* ──────────────────────────────────────────────────────────────────────────
 * 3. TABLET (769px — 1024px)
 * ────────────────────────────────────────────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
    .container { max-width: 100%; padding-left: 1.5rem; padding-right: 1.5rem; }
    table th, table td { padding: 0.7rem 0.85rem !important; }
    .price-page__buy { padding: 0.55rem 1.4rem; }
}

/* ──────────────────────────────────────────────────────────────────────────
 * 4. ADMIN PANEL — sidebar drawer at < 992px.
 *     The admin sidebar lives in templates/admin/layouts/master.html with
 *     id="adminSidebar"; on mobile it slides off-canvas behind a backdrop.
 * ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    #adminSidebar,
    .admin-sidebar,
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 80vw;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
        box-shadow: 0 0 24px rgba(0, 0, 0, 0.18);
    }
    #adminSidebar.show,
    .admin-sidebar.show,
    .sidebar.show {
        transform: translateX(0);
    }
    .admin-content,
    .admin-main,
    .main-content {
        margin-left: 0 !important;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.5);
        z-index: 1040;
    }
    .sidebar-backdrop.show {
        display: block;
    }
}

/* ──────────────────────────────────────────────────────────────────────────
 * 5. DASHBOARD-SPECIFIC RULES
 *
 * The dashboard uses project-local class names that don't follow Bootstrap
 * conventions, so we have to opt them in explicitly.
 * ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* 5.1 Rental selector (STR / LTR-30 / LTR-1 / Global) — stack radios vertically. */
    .price-info-radio-wrapper {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.6rem;
        align-items: stretch;
    }
    .price-info-radio {
        width: 100%;
    }
    .price-info-radio .radio-container {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        padding: 0.7rem 0.85rem;
        min-height: 48px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: #ffffff;
        cursor: pointer;
        font-size: 0.95rem;
    }

    /* 5.2 Service / website select — full-width and tall. */
    .select-button-wrapper-dashboard,
    .dashboard-order-col,
    .price-item-selection {
        width: 100%;
        max-width: 100%;
    }
    .price-item-selection select,
    .price-item-selection .form-select,
    #rentalNumber,
    #global-service-select,
    #global-country-select,
    .select2-container {
        width: 100% !important;
    }

    /* 5.3 Order button cluster — full-width primary action. */
    #productOrderBtnWrapper,
    #ltr30OrderBtnWrapper,
    #ltr1OrderBtnWrapper,
    #globalOrderBtnWrapper,
    .dashboard-order-btn,
    .order-btn-wrapper {
        width: 100% !important;
        display: flex !important;
        justify-content: center;
        margin-top: 0.5rem;
    }
    #productOrderBtnWrapper .btn,
    #ltr30OrderBtnWrapper .btn,
    #ltr1OrderBtnWrapper .btn,
    #globalOrderBtnWrapper .btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    /* 5.4 Dashboard search row — input and button stack on small screens. */
    .dashboard-search-form,
    form.dashboard-search,
    .search-form-wrapper {
        flex-direction: column !important;
        align-items: stretch;
        gap: 0.5rem;
    }
    .dashboard-search-form input[type="search"],
    .dashboard-search-form input[type="text"] {
        width: 100%;
    }

    /* 5.5 Order rows in the dashboard tables: keep readable inside the
     *     horizontal-scroll wrapper (already provided by 1.4). The number /
     *     PIN column gets the most attention because users tap-copy from it. */
    .table.dashboard-table .copy-btn,
    .table.dashboard-table .btn-copy,
    .order-row .copy-btn {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.4rem 0.6rem;
    }

    /* 5.6 Marketing site top-bar (balance widget) — wrap, do not horizontally
     *     squash, and do not push the layout off-screen on phones. */
    .top-bar-root-wrapper { padding: 0.5rem 0.25rem; }
    .top-bar-root-wrapper .top-bar-item p { font-size: 0.875rem; margin-bottom: 0; }
}

/* ──────────────────────────────────────────────────────────────────────────
 * 6. PRINT — keep the previous behaviour (no responsive overrides needed).
 * ────────────────────────────────────────────────────────────────────────── */


/* ════════════════════════════════════════════════════════════════════════════
 * 7. SITE-WIDE MOBILE POLISH (≤ 767px ONLY)
 *
 * Loaded from every master template and is the LAST stylesheet in the cascade,
 * so the rules below win over Bootstrap, design-system.css, page-local
 * `<style>` blocks, AND inline `style="..."` attributes (via `!important`).
 *
 * Hard contract for this block:
 *   • Every rule lives inside `@media (max-width: 767px)`.
 *   • Desktop / tablet (≥ 768px) appearance is COMPLETELY unchanged.
 *   • No template markup is required to opt-in — selectors auto-target the
 *     existing project classes (`.price-info-radio`, `.notification-section`,
 *     `.table-responsive`, `[data-label]`, `.esim-*`, etc).
 *
 * Covers: navbar drawer, rental-type radios, dashboard order tables (STR /
 * LTR-30 / LTR-1 / Global), long-term + 3-days numbers tables, forms,
 * eSIM page (stats / search / country grid), padding, no-horizontal-scroll.
 * ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

    /* ------------------------------------------------------------------ */
    /* 7.0 Universal: kill any horizontal page overflow + give every       */
    /*     section a sane minimum padding.                                 */
    /* ------------------------------------------------------------------ */
    html,
    body {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    .container,
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* ------------------------------------------------------------------ */
    /* 7.1 Rental-type radio rows (USA Short-Term / LTR-30 / LTR-1 /       */
    /*     Global Numbers / e-SIM Data Plans).                             */
    /*     Markup lives in dashboard_new.html, long-term-number.html,      */
    /*     3-days-number.html — same `.price-info-radio` shape on each.    */
    /* ------------------------------------------------------------------ */
    .price-info-radio-wrapper {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.6rem !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .price-info-radio { width: 100% !important; }
    .price-info-radio .radio-container {
        display: block !important;
        width: 100% !important;
        background-color: #1e293b !important;       /* slate-800 */
        color: #f1f5f9 !important;                  /* slate-100 */
        border: 1px solid #4b5563 !important;       /* gray-600 */
        border-radius: 10px !important;
        padding: 12px 16px 12px 36px !important;
        min-height: 48px !important;
        font-size: 0.95rem !important;
    }
    .price-info-radio .radio-container .price-info-green-span {
        color: #4ade80 !important;                  /* green-400 brand accent */
    }
    .price-info-radio .radio-container .checkmark {
        background-color: rgba(255, 255, 255, 0.12) !important;
        border: 1px solid #4b5563 !important;
    }
    .price-info-radio .radio-container .custom-radio:checked + .checkmark {
        background-color: #22c55e !important;
        border-color: #22c55e !important;
    }

    /* ------------------------------------------------------------------ */
    /* 7.2 Kill the legacy white `<section style="background: #fafafa">`   */
    /*     leftover on every "Your <X> Numbers" panel. The class default   */
    /*     in style.css is already dark; the inline override is the bug.   */
    /*     `!important` beats inline non-important. Mobile-only — desktop  */
    /*     keeps the inline `#fafafa` exactly as it is.                    */
    /* ------------------------------------------------------------------ */
    section.notification-section {
        background: #0f172a !important;             /* slate-900 page tone */
        border-top: 1px solid #1f2937 !important;   /* gray-800 separator */
    }

    /* ------------------------------------------------------------------ */
    /* 7.3 ALL `.table-responsive` tables → dark card-stacked layout.      */
    /*                                                                    */
    /*     Auto-targets every table inside a `.table-responsive` wrapper.  */
    /*     Cells with a `data-label="..."` attribute (the project's        */
    /*     existing convention — used by every dashboard / long-term /     */
    /*     3-days / global / history table partial) get the column-name    */
    /*     rendered as an uppercase muted label on the LEFT and the value  */
    /*     aligned on the RIGHT. Cells without a `data-label` still stack  */
    /*     cleanly, just without the label chip.                           */
    /*                                                                    */
    /*     Beats:                                                          */
    /*       - the `min-width: 640px` rule from §1.4 above (forced         */
    /*         horizontal scroll, which made labels unreadable on phones)  */
    /*       - the page-level `@media (max-width: 767px)` blocks in        */
    /*         dashboard_new.html / long-term-number.html /                */
    /*         3-days-number.html (which used `color: rgb(0, 0, 0)` for    */
    /*         the data-label::before — invisible on the dark theme)       */
    /* ------------------------------------------------------------------ */
    .table-responsive {
        overflow-x: visible !important;
        max-width: 100% !important;
    }
    .table-responsive table,
    .table-responsive table.table {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        border: 0 !important;
        background: transparent !important;
        table-layout: auto !important;
    }
    .table-responsive thead { display: none !important; }
    .table-responsive tbody { display: block !important; width: 100% !important; }
    .table-responsive tr {
        display: block !important;
        width: 100% !important;
        background: #1e293b !important;             /* slate-800 card */
        border: 1px solid #374151 !important;       /* gray-700 */
        border-radius: 12px !important;
        margin-bottom: 0.85rem !important;
        padding: 0.25rem !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
        overflow: visible !important;
    }
    .table-responsive td {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0.4rem 0.75rem !important;
        padding: 0.65rem 0.85rem !important;
        border: 0 !important;
        border-bottom: 1px solid #374151 !important;
        background: transparent !important;
        color: #f1f5f9 !important;                  /* slate-100 light text */
        white-space: normal !important;
        text-align: right !important;
        min-height: 44px !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    .table-responsive tr td:last-child {
        border-bottom: 0 !important;
    }
    .table-responsive td[data-label]::before {
        content: attr(data-label);
        flex: 0 0 auto;
        min-width: 4.75rem;
        font-weight: 700;
        font-size: 0.72rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #9ba3b4 !important;                  /* gray-400 muted label */
        text-align: left;
        white-space: nowrap;
    }
    /* Empty-state row (e.g. <td colspan="8">No orders found</td>) renders
     * centred, without card chrome, on its own. */
    .table-responsive tr:has(td[colspan]) {
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        margin-bottom: 0 !important;
    }
    .table-responsive tr td[colspan] {
        text-align: center !important;
        justify-content: center !important;
        background: transparent !important;
        border: 0 !important;
    }
    /* Value side: take remaining row space, allow shrinking & wrapping. */
    .table-responsive td > *:not(script):not(style) {
        max-width: 100%;
    }
    .table-responsive td .input-group {
        flex: 1 1 auto;
        min-width: 0;
        background: rgba(11, 18, 32, 0.6) !important;
        border: 1px solid #374151 !important;
        border-radius: 8px !important;
        overflow: hidden;
    }
    .table-responsive td .copy-input {
        background: transparent !important;
        color: #f1f5f9 !important;
        border: 0 !important;
        text-align: right;
        min-width: 0;
    }
    .table-responsive td .copy-btn,
    .table-responsive td .input-group-text {
        background: transparent !important;
        color: #f1f5f9 !important;
        border: 0 !important;
    }
    /* Action button cell (Cancel / Reuse / Renew) — full-width tap target. */
    .table-responsive tbody td:last-child .btn,
    .table-responsive tbody td:last-child > .d-grid,
    .table-responsive tbody td:last-child > div {
        width: 100% !important;
    }
    .table-responsive .badge { line-height: 1.3 !important; }

    /* Pagination block under the orders tables — make the wrapper
     * transparent and scroll horizontally if the page list is long. */
    .pagination-wrapper {
        background: transparent !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* ------------------------------------------------------------------ */
    /* 7.4 ALL form controls full-width + 44px tap target + 16px font     */
    /*     (the 16px stops iOS Safari from auto-zooming on focus).        */
    /* ------------------------------------------------------------------ */
    .form-control,
    .form-select,
    .form-control-sm,
    .form-select-sm,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="number"],
    input[type="url"],
    input[type="date"],
    select,
    textarea {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 44px !important;
        font-size: 16px !important;
    }
    .input-group { width: 100% !important; }

    /* Single-button rows / dashboard order CTAs full-width. */
    .button-area-dashboard,
    .price-item-bottom-button {
        width: 100% !important;
        display: block !important;
    }
    .price-item-bottom-button .btn,
    .price-item-bottom-button > div {
        width: 100% !important;
        min-height: 48px !important;
        justify-content: center !important;
    }
    /* Every dashboard order button + its loading-state twin. */
    #productOrderBtnWrapper,
    #ltr30OrderBtnWrapper,
    #ltr1OrderBtnWrapper,
    #globalOrderBtnWrapper,
    #shortTermOrder,
    #shortTermOrderLoading,
    #ltr30Order,
    #ltr30OrderLoading,
    #ltr1Order,
    #ltr1OrderLoading,
    #globalOrder,
    #globalOrderLoading,
    #longTermOrder {
        width: 100% !important;
    }

    /* 7.4.1 — Hide the "Pleas wait..." / "Please wait..." loading-state
     * sibling on mobile.
     *
     * Each order panel has TWO `.price-item-bottom-button` siblings: the
     * normal "Order"/"Rent" button and a loading-state twin that contains
     * the spinning `.bi-arrow-repeat` icon and the "Pleas wait..." label.
     * The base markup keeps the loading twin hidden via inline
     * `style="display: none;"` and JS toggles it via jQuery `.show()` /
     * `.hide()` during the AJAX call.
     *
     * The full-width rule above (`.price-item-bottom-button { display:
     * block !important }`) inadvertently overrides the inline `display:
     * none` on mobile, so users see "Order" + "Pleas wait..." stacked
     * inside the same CTA at all times. ID selectors here have specificity
     * (0,1,0,0) which beats the class-level `!important` (0,0,1,0); the
     * `!important` keyword also beats jQuery's non-`!important` inline
     * `display: block` set by `.show()`, so the loading state stays hidden
     * on mobile even while the AJAX call is in flight.
     *
     * Covers the four dashboard panels (`shortTerm`, `ltr30`, `ltr1`,
     * `global` — `templates/user/dashboard_new.html`), the dedicated
     * 30-day rental page (`#rent30OrderLoading` —
     * `templates/user/rent_number_usa_30days.html`), and the long-term /
     * 3-days subpages which reuse `#shortTermOrderLoading`. Desktop is
     * untouched because the rule lives inside `@media (max-width: 767px)`. */
    #shortTermOrderLoading,
    #ltr30OrderLoading,
    #ltr1OrderLoading,
    #globalOrderLoading,
    #rent30OrderLoading {
        display: none !important;
    }
    /* Search-by-number form row above each orders table → stack input
     * and Search button into a tappable column. */
    section.border-top form .input-group,
    section.border-top form .input-group .form-control,
    section.border-top form .input-group .btn {
        width: 100% !important;
    }
    section.border-top form .input-group {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    section.border-top form .input-group .btn {
        border-radius: 0.375rem !important;
    }
    section.border-top form .input-group .form-control {
        border-radius: 0.375rem !important;
    }

    /* ------------------------------------------------------------------ */
    /* 7.5 eSIM Data Plans page (templates/user/esim/index.html).          */
    /*     The page already has its own @media (max-width: 768px) block   */
    /*     collapsing the 3-col stats to 1 col. Reaffirm + extend so the */
    /*     country grid, search bar, and toolbar also stack at ≤ 767.    */
    /* ------------------------------------------------------------------ */
    .esim-page { padding: 16px 0 32px !important; }
    .esim-stats { grid-template-columns: 1fr !important; gap: 10px !important; }
    .esim-stat { padding: 14px 16px !important; }
    .esim-country-grid { grid-template-columns: 1fr !important; }
    .esim-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .esim-search-wrap { max-width: 100% !important; flex: 1 1 100% !important; }
    .esim-search { width: 100% !important; }
    .esim-balance-pill { width: 100% !important; justify-content: space-between !important; }
    .esim-header { gap: 10px !important; }

    /* ------------------------------------------------------------------ */
    /* 7.6 Headings + paragraphs that overflow on narrow viewports.       */
    /* ------------------------------------------------------------------ */
    h1, h2, h3, h4, h5, h6,
    p, span, div, td {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    /* The "Rejection time: 1 hour 30 minutes" heading on the long-term
     * page wraps onto two lines on phones — make sure it doesn't push the
     * layout. */
    h4 { font-size: 1.1rem !important; line-height: 1.35 !important; }

    /* ------------------------------------------------------------------ */
    /* 7.7 "Order History" / "Your <X> Numbers" heading row — stack the   */
    /*     heading and its right-aligned search form vertically.          */
    /* ------------------------------------------------------------------ */
    section.border-top .container .row.justify-content-between {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    section.border-top .container .row.justify-content-between > [class*="col-"] {
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
}

/* ──────────────────────────────────────────────────────────────────────────
 * 8. PUBLIC / LANDING PAGES — MOBILE POLISH (≤ 767px)
 *
 * Mirrors PROBLEM 1/2/3 from the spec for the marketing site:
 *   1. Top nav on phones shows ONLY logo + hamburger; both auth buttons
 *      live INSIDE the dropdown (the markup change in
 *      `templates/includes/marketing_nav.html` does the visibility flip;
 *      this block only paints the drawer + styles the new auth buttons).
 *   2. The home-hero "ghost" CTA (`See Pricing` / `View Full Pricing`)
 *      gets a high-contrast white-on-dark-translucent treatment so the
 *      label is readable on any hero variant the body might render.
 *   3. Single-row clean look — no extra rules needed; (1) achieves it.
 *
 * Tablet and desktop are untouched: every selector lives inside
 * @media (max-width: 767px) and `min-width: 768px` styles never see them.
 * ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {

    /* 8.1 ─ Marketing-nav hamburger drawer (`<details id="marketing-mobile-menu">`).
     *      Paint it dark + flip text + link colors to light so it reads on
     *      a black/midnight body bg. The drawer is opened via the native
     *      <details>/<summary> toggle so the visible state is `[open]`. */
    #marketing-mobile-menu {
        background-color: #0f172a !important;
        color: #f1f5f9 !important;
        border-top: 1px solid #1f2937 !important;
        border-radius: 0 0 12px 12px;
        padding: 0.5rem 0.75rem 0.75rem !important;
        margin-top: 0.5rem;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    }
    /* Plain nav links inside the drawer (Home, Support, Pricing, FAQ,
     * Blog, API Docs, Dashboard). Tailwind's `text-gray-700` would make
     * them invisible on the dark bg. */
    #marketing-mobile-menu a {
        color: #e5e7eb !important;
    }
    #marketing-mobile-menu a:hover,
    #marketing-mobile-menu a:focus {
        color: #ffffff !important;
        background-color: rgba(255, 255, 255, 0.06) !important;
    }

    /* 8.2 ─ The two auth CTAs at the bottom of the drawer. Markup adds the
     *      `marketing-mobile-auth-btn` class; here we make them full-width
     *      tappable buttons. The primary keeps the indigo gradient feel,
     *      the ghost gets a white outline so it stays visible on the dark
     *      drawer (Tailwind's `border-gray-300` would otherwise wash out). */
    .marketing-mobile-auth-btn {
        width: 100% !important;
        min-height: 48px !important;
        font-size: 1rem !important;
        letter-spacing: 0.01em;
    }
    .marketing-mobile-auth-btn--primary {
        background: linear-gradient(105deg, #6366f1 0%, #7c3aed 50%, #2563eb 100%) !important;
        color: #ffffff !important;
        border: none !important;
        box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    }
    .marketing-mobile-auth-btn--primary:hover,
    .marketing-mobile-auth-btn--primary:focus {
        color: #ffffff !important;
        filter: brightness(1.05);
    }
    .marketing-mobile-auth-btn--ghost {
        background: transparent !important;
        color: #f1f5f9 !important;
        border: 1px solid rgba(255, 255, 255, 0.55) !important;
    }
    .marketing-mobile-auth-btn--ghost:hover,
    .marketing-mobile-auth-btn--ghost:focus {
        background: rgba(255, 255, 255, 0.06) !important;
        color: #ffffff !important;
        border-color: #ffffff !important;
    }

    /* 8.3 ─ Belt-and-braces: even if a stray legacy stylesheet tries to
     *      flex the inline auth buttons back in, force them hidden on the
     *      phone breakpoint. The Tailwind `hidden` class does this already
     *      via the markup change, but inline `display:` rules from old
     *      `style.css` could win at equal specificity, so we lock it. */
    nav[aria-label="Main navigation"] > div > div > a[href="/user/login/"]:not(.marketing-mobile-auth-btn),
    nav[aria-label="Main navigation"] > div > div > a[href="/user/register/"]:not(.marketing-mobile-auth-btn) {
        display: none !important;
    }

    /* 8.4 ─ Hero "ghost" / outline CTA on the public landing
     *      (`.home-cyber-btn-ghost` — the `See Pricing` / `View Full
     *      Pricing` button right next to `Get Started`).
     *
     *      Cascade context: the page-inline rule in
     *      `templates/public/pages/home/index.html` declares
     *          color: #0f172a !important;
     *          border: 1px solid #0f172a;
     *          background: transparent;
     *      Loaded AFTER `design-system.css` (which had white-on-dark) and
     *      BEFORE `responsive.css`, so this is the live winner on mobile.
     *      That dark-navy text on the light hero gradient renders too low
     *      contrast (and is invisible the moment the hero is swapped for
     *      a dark variant on small screens), so PROBLEM 2 calls for a
     *      white-on-dark/transparent treatment.
     *
     *      Solution: dark translucent fill + 1.5px white border + white
     *      label. Reads on both the light hero gradient AND the midnight
     *      `body.public-home-cyber` canvas. ID/class specificity is equal
     *      to the page rule, but `responsive.css` loads LAST in
     *      `master.html` (line 304), so this wins by source order. */
    .home-cyber-btn-ghost,
    a.home-cyber-btn-ghost {
        background: rgba(15, 23, 42, 0.78) !important;
        color: #ffffff !important;
        border: 1.5px solid #ffffff !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    }
    .home-cyber-btn-ghost:hover,
    .home-cyber-btn-ghost:focus,
    a.home-cyber-btn-ghost:hover,
    a.home-cyber-btn-ghost:focus {
        background: rgba(15, 23, 42, 0.9) !important;
        color: #ffffff !important;
        border-color: #ffffff !important;
    }
}

