/* ============================================================
   AirVyo — Global Mobile CSS (mobile.css)
   Mobile-first responsive system for ALL pages
   ============================================================ */

/* ── 1. RESET & BOX MODEL ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── 2. SAFE AREA (iPhone notch / Dynamic Island) ── */
:root {
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
    --sar: env(safe-area-inset-right, 0px);
}

/* Fixed navbars need top safe area */
.nav,
nav,
header,
.navbar {
    padding-top: max(0px, var(--sat));
    padding-left: max(0px, var(--sal));
    padding-right: max(0px, var(--sar));
}

/* Footers need bottom safe area */
footer,
.ft {
    padding-bottom: max(16px, calc(16px + var(--sab)));
    padding-left: max(0px, var(--sal));
    padding-right: max(0px, var(--sar));
}

/* ── 3. TOUCH TARGET SIZES (min 44x44px per Apple HIG) ── */
a,
button,
input,
select,
textarea,
[role="button"],
[tabindex] {
    min-height: 44px;
    min-width: 44px;
}

/* Inline links & small decorative anchors can be smaller */
a.inline-link,
.ft a,
.ft-grid ul li a,
.breadcrumb a,
.small-link {
    min-height: unset;
    min-width: unset;
}

/* ── 4. MINIMUM FONT SIZES (prevent iOS zoom on focus) ── */
input,
select,
textarea {
    font-size: 16px !important;
}

body {
    font-size: 16px;
}

/* ── 5. GLOBAL CONTAINER ── */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── 6. IMAGES & MEDIA ── */
img,
video,
canvas,
svg,
iframe {
    max-width: 100%;
    height: auto;
}

/* ── 7. HOVER → ACTIVE/FOCUS (touch-friendly) ── */
@media (hover: none) {

    /* Remove hover states on touch devices */
    a:hover,
    button:hover {
        opacity: 1;
    }

    a:active,
    button:active {
        opacity: 0.85;
        transform: scale(0.98);
        transition: transform 0.1s, opacity 0.1s;
    }
}

/* ── 8. GLOBAL FOOTER SYSTEM (.ft) ── */
.ft {
    background: #0a1628;
    color: #94a3b8;
}

.ft-logo {
    font-size: 1.3rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.02em;
    display: inline-block;
    text-decoration: none;
    min-height: unset;
    min-width: unset;
}

.ft-logo .vyo {
    color: #10b981;
}

.ft-brand p {
    font-size: 0.88rem;
    line-height: 1.7;
    color: #64748b;
    margin-top: 10px;
}

.ft-top {
    padding: 60px 0 0;
    margin-bottom: 40px;
}

.ft-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    padding-bottom: 40px;
    border-bottom: 1px solid #1e293b;
    width: 100%;
    box-sizing: border-box;
}

.ft-grid>div {
    min-width: 0;
}

.ft-grid h4 {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    min-height: unset;
}

.ft-grid ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ft-grid ul li a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.87rem;
    transition: color 0.2s;
    display: inline-block;
    padding: 2px 0;
    min-height: unset;
    min-width: unset;
}

.ft-grid ul li a:hover {
    color: #10b981;
}

.ft-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    font-size: 0.82rem;
    color: #475569;
    flex-wrap: wrap;
    gap: 10px;
}

.ft-lang {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
}

.ft-lang img {
    width: 20px;
    border-radius: 3px;
    vertical-align: middle;
}

/* -- 9. GLOBAL NAV MOBILE RULES -- */
/* Hide desktop items on mobile -- applies to ALL pages */
@media (max-width: 768px) {

    /* Strong multi-selector to override ANY page inline style */
    html body .nav-tabs,
    html body .nav-tabs a,
    html body a.account-link,
    html body .account-link,
    html body .nav-right .account-link,
    html body .nav-inner .account-link,
    html body .lang-switch,
    html body .nav-right .lang-switch,
    html body .nav-inner .lang-switch,
    html body .nav-right .lang-btn,
    html body .lang-btn {
        display: none !important;
    }

    html body .hamburger,
    html body button.hamburger,
    html body #hamburger,
    html body .nav-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .container {
        padding: 0 16px;
    }

    html,
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Make sure nav doesn't overflow horizontally but allows dropdowns to show */
    nav,
    .nav,
    .navbar {
        max-width: 100vw;
    }

    .nav-inner {
        max-width: 100%;
    }
}


/* ── 10. FOOTER RESPONSIVE ── */
@media (max-width: 900px) {
    .ft-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }
}

@media (max-width: 600px) {
    .ft-top {
        padding: 36px 0 0;
        margin-bottom: 24px;
    }

    .ft-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        padding-bottom: 28px;
    }

    .ft-grid h4 {
        font-size: 0.78rem;
        margin-bottom: 10px;
    }

    .ft-grid ul li a {
        font-size: 0.8rem;
    }

    .ft-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: 0.76rem;
        padding: 14px 0;
    }

    .ft-logo {
        font-size: 1.1rem;
    }
}

@media (max-width: 430px) {
    .ft-top {
        padding: 28px 0 0;
        margin-bottom: 20px;
    }

    .ft-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .ft-grid h4 {
        font-size: 0.74rem;
        margin-bottom: 8px;
    }

    .ft-grid ul li a {
        font-size: 0.75rem;
    }

    .container {
        padding: 0 14px;
    }
}

/* ── 11. DASHBOARD PANEL MOBILE ── */
@media (max-width: 768px) {
    .esim-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden;
        flex-wrap: wrap;
    }

    .esim-card>* {
        min-width: 0;
        max-width: 100%;
    }

    .esim-details {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .esim-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .esim-meta {
        flex-wrap: wrap;
        min-width: 0;
    }

    .dashboard-page {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    .install-panel {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .qr-placeholder {
        max-width: 100%;
    }
}

/* ── 12. GENERAL SECTION OVERFLOW PREVENTION ── */
@media (max-width: 768px) {

    main,
    section,
    article,
    aside,
    .section {
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Prevent tables from overflowing */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Flex containers that might overflow */
    .flex-row,
    .row,
    .grid-row {
        flex-wrap: wrap;
    }
}

/* ── 13. PERFORMANCE: Reduce motion for accessibility ── */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── 14. HIGH DPI / RETINA DISPLAYS ── */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    /* Ensure borders look sharp on retina */
    .ft-grid {
        border-bottom-width: 0.5px;
    }
}