html { scroll-behavior: auto; }
body { overflow-anchor: none; }

/* Sample refill plan tables (reference pricing) */
.refill-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.refill-table th,
.refill-table td {
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgb(51 65 85);
}
.refill-table th {
    color: rgb(148 163 184);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.refill-table tbody tr:last-child td {
    border-bottom: none;
}
.refill-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: rgb(226 232 240);
    white-space: nowrap;
}
details summary::-webkit-details-marker { display: none; }
details summary::marker { content: ''; }

/* Hero layered backgrounds — scene photos with unified grading */
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-color: #0f172a;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: 50% 50%;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.7s ease, transform 0.9s ease;
    pointer-events: none;
    filter: saturate(0.8) brightness(0.78) contrast(0.98);
}
.hero-bg.is-active {
    z-index: 1;
    opacity: 1;
    transform: scale(1);
}
.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.64) 0%, rgba(15, 23, 42, 0.5) 48%, rgba(15, 23, 42, 0.68) 100%),
        radial-gradient(1200px 500px at 10% 0%, rgba(59, 130, 246, 0.14), transparent 60%),
        radial-gradient(900px 420px at 90% 100%, rgba(14, 116, 144, 0.12), transparent 62%);
}
.hero-bg-host {
    background-image: url('https://images.unsplash.com/photo-1505691938895-1758d7feb511?auto=format&fit=crop&w=1920&q=80');
    background-position: center 45%;
}
.hero-bg-host::after {
    opacity: 1;
}
.hero-bg-trucker {
    background-image: url('https://images.unsplash.com/photo-1494412685616-a5d310fbb07d?auto=format&fit=crop&w=1920&q=80');
    background-position: center 52%;
}
.hero-bg-trucker::after {
    opacity: 1;
}
.hero-bg-nomad {
    background-image: url('https://images.unsplash.com/photo-1487014679447-9f8336841d58?auto=format&fit=crop&w=1920&q=80');
    background-position: center 42%;
}
.hero-bg-nomad::after {
    opacity: 1;
}
.hero-bg-rv {
    background-image: url('https://images.unsplash.com/photo-1526772662000-3f88f10405ff?auto=format&fit=crop&w=1920&q=80');
    background-position: center 56%;
}
.hero-bg-rv::after {
    opacity: 1;
}

/* Tab navigation */
.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 4.25rem;
    padding: 0.625rem 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    background: transparent;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.tab-btn-icon {
    font-size: 1.25rem;
    line-height: 1;
}
.tab-btn-label {
    display: block;
}
.tab-btn:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}
.tab-btn-active {
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-color: rgba(147, 197, 253, 0.35);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}
@media (min-width: 640px) {
    .tab-btn {
        min-height: 4.5rem;
        padding: 0.75rem 0.625rem;
        font-size: 0.8125rem;
    }
}
@media (min-width: 1024px) {
    .tab-btn {
        flex-direction: row;
        gap: 0.5rem;
        min-height: 3.25rem;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        text-align: left;
    }
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.45s ease-out; }
.hero-copy h1 {
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}
.hero-copy p {
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.country-chip.is-hidden { display: none; }
.nav-active { color: #fff !important; font-weight: 600; }

/* Brand logo — dark header: white wordmark; light surfaces: navy (no white box, no CSS invert) */
.iotesim-brand-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: min(200px, 62vw);
    max-height: 2.75rem;
    object-fit: contain;
    object-position: left center;
    flex-shrink: 0;
    filter: none !important;
    -webkit-filter: none !important;
    opacity: 1;
    background: transparent !important;
    padding: 0 !important;
    transition: opacity 0.15s ease;
}
#site-header .iotesim-brand-link {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0;
    line-height: 0;
}

/* Header layout — mobile: centered logo row + promo row; desktop: logo left, promo right */
#site-header .iotesim-header-shell {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
#site-header .iotesim-header-main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
}
#site-header .iotesim-header-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}
#site-header .iotesim-header-brand .iotesim-brand-logo {
    object-position: center center;
}
#site-header .iotesim-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.75rem;
    width: 100%;
}
#site-header .iotesim-header-promo-short {
    display: inline;
}
#site-header .iotesim-header-promo-full {
    display: none;
}
@media (min-width: 640px) {
    #site-header .iotesim-header-promo-short {
        display: none;
    }
    #site-header .iotesim-header-promo-full {
        display: inline;
    }
}
@media (min-width: 768px) {
    #site-header .iotesim-header-shell {
        gap: 1rem;
    }
    #site-header .iotesim-header-main {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }
    #site-header .iotesim-header-brand {
        justify-content: flex-start;
        width: auto;
        flex: 0 1 auto;
    }
    #site-header .iotesim-header-brand .iotesim-brand-logo {
        object-position: left center;
    }
    #site-header .iotesim-header-actions {
        justify-content: flex-end;
        width: auto;
        flex: 0 1 auto;
    }
}

/* Header + main nav (layout.js) — stable on every page; not tied to Tailwind CDN class scan */
#site-header .iotesim-header-promo {
    font-size: 0.6875rem;
    white-space: nowrap;
    padding: 0.375rem 0.625rem;
    border-radius: 9999px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.2);
    color: rgb(147 197 253);
}
@media (min-width: 640px) {
    #site-header .iotesim-header-promo { font-size: 0.75rem; padding: 0.375rem 0.75rem; }
}
@media (min-width: 768px) {
    #site-header .iotesim-header-promo { font-size: 0.875rem; padding: 0.375rem 1rem; }
}
#site-header .iotesim-header-cta {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: rgb(249 115 22);
    color: #fff;
    text-decoration: none;
    transition: background 0.15s ease;
}
#site-header .iotesim-header-cta:hover {
    background: rgb(234 88 12);
}
#site-header nav.iotesim-main-nav {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.25rem;
    font-size: 0.875rem;
    color: rgb(148 163 184);
    border-top: 1px solid rgba(51, 65, 85, 0.5);
    padding-top: 1rem;
}
@media (min-width: 768px) {
    #site-header nav.iotesim-main-nav {
        flex-wrap: wrap;
        gap: 1.25rem 1.25rem;
        padding-bottom: 0;
        overflow-x: visible;
    }
}
#site-header .iotesim-nav-link {
    flex-shrink: 0;
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid rgb(51 65 85);
    background: rgba(30, 41, 59, 0.7);
    color: rgb(203 213 225);
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
#site-header .iotesim-nav-link:hover {
    color: #fff;
    border-color: rgb(100 116 139);
}
#site-header .iotesim-nav-link.nav-active {
    color: #fff !important;
    font-weight: 600;
    border-color: rgba(59, 130, 246, 0.6);
    background: rgba(59, 130, 246, 0.1);
}
@media (min-width: 768px) {
    #site-header .iotesim-nav-link {
        padding: 0;
        border: none;
        border-radius: 0;
        background: transparent;
    }
    #site-header .iotesim-nav-link.nav-active {
        border: none;
        background: transparent;
    }
}

.page-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

.payment-badges {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
}
.pay-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    height: 30px;
    border-radius: 0.4rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: #1f2937;
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #ffffff;
    box-sizing: border-box;
    padding: 0 0.5rem;
    text-transform: uppercase;
}
.pay-visa { background: #0b67c7; border-color: #0b67c7; }
.pay-mastercard, .pay-maestro { background: #23354a; border-color: #2f445e; }
.pay-union { background: #4e46e5; border-color: #5e56f5; }
.pay-paypal { background: #0369a1; border-color: #0284c7; text-transform: none; }
.pay-apple { background: #1f1f1f; border-color: #3b3b3b; font-size: 0.74rem; }
.pay-gpay { background: #ffffff; border-color: #d1d5db; color: #111827; text-transform: none; }
.pay-union { text-transform: none; }
.pay-apple { text-transform: none; }
@media (max-width: 640px) {
    .hero-copy .inline-flex {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    .pay-logo {
        min-width: 78px;
        height: 28px;
        font-size: 0.6rem;
    }
}

/* Legacy icon-only markup (if any page still references it) */
.iotesim-brand-icon {
    filter: none;
    opacity: 1;
}
.bg-white .iotesim-brand-icon,
.iotesim-on-light .iotesim-brand-icon,
#site-header.iotesim-header-light .iotesim-brand-icon {
    filter: none !important;
}
body.bg-slate-900 #site-header:not(.iotesim-header-light) .iotesim-brand-icon,
body.iotesim-wc-flow #site-header:not(.iotesim-header-light) .iotesim-brand-icon {
    filter: brightness(0) invert(1);
    opacity: 0.94;
}
body.bg-slate-900 #site-header:not(.iotesim-header-light) a:hover .iotesim-brand-icon,
body.iotesim-wc-flow #site-header:not(.iotesim-header-light) a:hover .iotesim-brand-icon {
    opacity: 1;
}

/* Checkout forms */
.checkout-field {
    display: block;
}
.checkout-field > span {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(148 163 184);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.checkout-field input,
.checkout-field select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgb(51 65 85);
    background: rgb(15 23 42);
    color: rgb(248 250 252);
    font-size: 0.9375rem;
}
.checkout-field input:focus,
.checkout-field select:focus {
    outline: none;
    border-color: rgb(59 130 246);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

/* ===== Global mobile adaptation ===== */
@media (max-width: 767.98px) {
    html {
        -webkit-text-size-adjust: 100%;
    }
    body {
        overflow-x: hidden;
    }

    /* Header */
    #site-header {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    #site-header .iotesim-header-brand .iotesim-brand-logo {
        max-width: min(180px, 70vw);
        max-height: 2.25rem;
    }
    #site-header .iotesim-header-actions {
        justify-content: space-between;
    }
    #site-header .iotesim-header-promo {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 6.75rem);
        overflow: hidden;
        text-overflow: ellipsis;
    }
    #site-header .iotesim-header-cta {
        flex: 0 0 auto;
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
        white-space: nowrap;
    }
    #site-header nav.iotesim-main-nav {
        gap: 0.4rem;
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    #site-header nav.iotesim-main-nav::-webkit-scrollbar {
        display: none;
    }
    #site-header .iotesim-nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
        min-height: 2.5rem;
        display: inline-flex;
        align-items: center;
    }

    /* Main content (static pages) */
    body.bg-slate-900 > main {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Footer */
    #site-footer {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    #site-footer .iotesim-footer-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
    #site-footer .iotesim-footer-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    #site-footer .payment-badges {
        width: 100%;
    }

    /* Home hero */
    #hero-container {
        min-height: auto !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: 1rem !important;
        padding-bottom: 1.5rem !important;
    }
    #hero-container .hero-copy {
        min-height: 0 !important;
    }
    #hero-container .hero-copy h1 {
        font-size: clamp(1.65rem, 7vw, 2.25rem) !important;
        line-height: 1.15 !important;
    }
    #hero-container .tab-nav {
        max-width: 100%;
    }
    #pricing {
        padding: 1rem !important;
        gap: 1rem !important;
    }
    #pricing .w-36 {
        width: 7rem !important;
        height: 7rem !important;
    }
    #pricing .text-3xl {
        font-size: 1.75rem !important;
        line-height: 1.1;
    }
    #pricing a#cta-button,
    #pricing .flex.flex-col.gap-3 a {
        width: 100%;
    }

    /* Tables / grids that overflow */
    .refill-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* T8 device page — horizontal swipe gallery (below fixed product hero) */
.t8-gallery-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgb(71 85 105) transparent;
}
.t8-gallery-scroll:focus {
    outline: 2px solid rgb(59 130 246 / 0.5);
    outline-offset: 2px;
}
.t8-gallery-scroll-track {
    display: flex;
    gap: 0.75rem;
    padding: 0.25rem 0.5rem 0.75rem;
    width: max-content;
}
.t8-gallery-slide {
    flex: 0 0 auto;
    width: min(78vw, 17rem);
    scroll-snap-align: start;
    margin: 0;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid rgb(51 65 85);
    background: rgb(30 41 59);
    box-shadow: 0 4px 24px rgb(0 0 0 / 0.25);
}
.t8-gallery-slide img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: rgb(15 23 42);
}
.t8-gallery-slide:first-child img {
    object-fit: contain;
    background: #fff;
    padding: 0.5rem;
}

@media (max-width: 389.98px) {
    .iotesim-brand-logo {
        max-width: min(150px, 54vw) !important;
        max-height: 1.85rem !important;
    }
    #site-header .iotesim-header-promo {
        max-width: calc(100% - 6.75rem);
        font-size: 0.625rem;
        padding: 0.35rem 0.5rem;
    }
}
