/* ==========================================================================
   mobile-fixes.css
   Loaded after theme.css on every page via seo-head.php.
   Comprehensive responsive overrides for all custom sections added in the
   USP/premium-hero overhaul. Prevents horizontal overflow and ensures layouts
   collapse gracefully on phones.
   ========================================================================== */

/* Base: prevent any element from forcing horizontal scroll */
html, body { max-width: 100%; overflow-x: hidden; }
section { max-width: 100vw; }
section img, section svg, section table { max-width: 100%; height: auto; }

/* ========== Global small-screen rules ( ≤ 768px ) ========== */
@media (max-width: 768px) {

    /* ---- Top contact bar: HIDE on mobile (2-line wrap looks broken) ---- */
    .top-bar { display: none !important; }

    /* ---- Main header: hide "Request Demo" button on phones, show only hamburger ---- */
    .site-header .btn.btn-accent, .site-header .btn-accent,
    .site-header button.btn-accent, .site-header #openModal { display: none !important; }

    /* ---- Announcement bar: give text right-side breathing room for close button ---- */
    #announcementBar .ab-viewport { padding-right: 28px !important; max-width: calc(100% - 40px) !important; }
    #announcementBar .ab-close { right: 6px !important; top: 8px !important; transform: none !important; }
    #announcementBar .ab-dots { display: none !important; }
    #announcementBar .ab-slide { font-size: 11px !important; padding: 0 !important; gap: 6px !important; line-height: 1.35 !important; white-space: normal !important; align-items: center !important; justify-content: flex-start !important; flex-wrap: wrap; }

    /* ---- Hero (hv2) scene — COMPLETELY hide ALL floating satellites ---- */
    .hv2-scene { max-width: 100%; overflow: visible; height: auto !important; min-height: 360px; }
    .hv2-scene-inner { transform: none !important; padding: 0 !important; }
    .hv2-card { position: relative !important; top: auto !important; left: auto !important; transform: none !important; width: 100% !important; max-width: 400px; margin: 0 auto !important; padding: 22px 18px !important; }
    .hv2-card .hv2-stats { gap: 8px; }
    .hv2-card .hv2-stat { padding: 14px 11px; }
    .hv2-card .hv2-stat .num { font-size: 1.35rem; }
    .hv2-card .hv2-stat .lbl { font-size: 10px; line-height: 1.3; }
    /* Hide EVERY satellite element on mobile — cleaner than juggling positions */
    .hv2-scene .hv2-oem,
    .hv2-scene .hv2-sat,
    .hv2-scene .hv2-orbit,
    .hv2-scene .hv2-cloud,
    .hv2-scene .hv2-region,
    .hv2-scene .hv2-voucher-count, .hv2-scene .hv2-coverage,
    .hv2-scene .hv2-htd-risk, .hv2-scene .hv2-htd-pay,
    .hv2-scene .hv2-fh-cohort, .hv2-scene .hv2-fh-stack,
    .hv2-scene .hv2-lt-retention, .hv2-scene .hv2-lt-save,
    .hv2-scene .hv2-cs-cap, .hv2-scene .hv2-cs-cleanup,
    .hv2-scene .hv2-radar-badge { display: none !important; }

    /* Hero terminal variant on mobile */
    .hv2-term { width: 100% !important; max-width: 420px; }
    .hv2-term-body { padding: 14px 16px 12px !important; font-size: 11px; min-height: auto !important; }
    .hv2-term-line { white-space: normal; }

    /* Radar, meter, timeline, pipeline, stack, envs variants: keep inside viewport */
    .hv2-radar, .hv2-pipe, .hv2-timeline, .hv2-meter, .hv2-envs, .hv2-stack { width: 100% !important; max-width: 400px; margin-left: auto; margin-right: auto; }
    .hv2-scene .hv2-radar-badge,
    .hv2-scene .hv2-voucher-count, .hv2-scene .hv2-coverage,
    .hv2-scene .hv2-htd-risk, .hv2-scene .hv2-htd-pay,
    .hv2-scene .hv2-fh-cohort, .hv2-scene .hv2-fh-stack,
    .hv2-scene .hv2-lt-retention, .hv2-scene .hv2-lt-save,
    .hv2-scene .hv2-cs-cap, .hv2-scene .hv2-cs-cleanup { display: none !important; }

    /* ---- Vendor strikethrough strip (home) ---- */
    #vendorStrike .vs-row { gap: 6px; }
    #vendorStrike .vs-chip { font-size: 11px; padding: 6px 10px; }
    #vendorStrike .vs-arrow { display: none; }
    #vendorStrike .vs-syn { font-size: 12px; padding: 9px 14px; margin-top: 10px; }
    #vendorStrike .vs-title { font-size: 1.25rem; }

    /* ---- CMP (Complete Stack) comparison ---- */
    #cmpSection .cmp-card { padding: 24px 18px !important; }
    #cmpSection .cmp-row { grid-template-columns: 110px 1fr; gap: 8px; }
    #cmpSection .cmp-rowlabel { font-size: 11px; line-height: 1.25; }
    #cmpSection .cmp-gap { font-size: 9.5px; margin-top: 2px; display: block; }
    #cmpSection .cmp-track { height: 28px; }
    #cmpSection .cmp-val { font-size: 10px; }
    #cmpSection .cmp-fill { padding: 0 8px; }

    /* ---- Lab Stack comparison table (cloudlabs) — switch to card-stack ---- */
    #labStack .ls-table { border-radius: 14px; }
    #labStack .ls-table-head { display: none; }
    #labStack .ls-row { grid-template-columns: 1fr; padding: 14px 0; border-bottom: 1px solid rgba(163,177,172,.25); }
    #labStack .ls-cell { border-right: none; padding: 6px 16px; justify-content: space-between; align-items: center; gap: 10px; }
    #labStack .ls-cell:first-child { background: rgba(20,26,22,.02); padding: 10px 16px; font-weight: 800; font-size: 12.5px; }
    #labStack .ls-cell:not(:first-child)::before { content: attr(data-lbl); font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: #5a6b64; flex: 1; text-align: left; }
    #labStack .ls-cell--us::before { color: #F26B2B !important; }
    #labStack .ls-sub { display: block !important; font-size: 10.5px !important; }
    #labStack .ls-icon { width: 20px; height: 20px; font-size: 11px; }
    #labStack h2 { font-size: 1.35rem; }

    /* ---- Pay-on-deploy big callout (HTD) ---- */
    #payDeploy .pd-hero { grid-template-columns: 1fr !important; gap: 20px; padding: 24px 20px !important; }
    #payDeploy .pd-hero::before { left: 20px; right: 20px; }
    #payDeploy .pd-zero-val { font-size: 5rem !important; line-height: 0.85; }
    #payDeploy .pd-hero h2 { font-size: 1.55rem; }
    #payDeploy .pd-hero p { font-size: 13.5px; }
    #payDeploy .pd-hero-cta { width: 100%; justify-content: center; }
    #payDeploy .pd-vs-grid { grid-template-columns: 1fr !important; gap: 12px; }
    #payDeploy .pd-vs-card { padding: 22px 18px; }
    #payDeploy .pd-vs-title { font-size: 1.25rem; }
    #payDeploy .pd-vs-item { font-size: 12.5px; }

    /* ---- Bundle CTA (under training offerings) ---- */
    #bundleCta .bu-card { grid-template-columns: 1fr !important; gap: 20px; padding: 26px 20px !important; }
    #bundleCta .bu-card h3 { font-size: 1.3rem; }
    #bundleCta .bu-card p { font-size: 13.5px; }
    #bundleCta .bu-stack { grid-template-columns: 1fr 1fr; gap: 6px; }
    #bundleCta .bu-tile { padding: 12px 13px; }
    #bundleCta .bu-tile-val { font-size: 11.5px; }

    /* ---- Voucher Desk strip (cert pages) ---- */
    #vDesk { padding: 24px 0; }
    #vDesk .vd-row { flex-direction: column; align-items: flex-start !important; gap: 14px; }
    #vDesk .vd-msg { flex-direction: column; align-items: flex-start; gap: 8px; }
    #vDesk .vd-title { font-size: 14px; }
    #vDesk .vd-stats { gap: 14px; justify-content: space-between; width: 100%; }
    #vDesk .vd-stat { align-items: flex-start; }
    #vDesk .vd-stat-val { font-size: 15px; }
    #vDesk .vd-stat--teal .vd-stat-val { font-size: 13px; }
    #vDesk .vd-divider { display: none; }

    /* ---- Why Synergific cards (home) ---- */
    #whySyn { padding: 56px 0 !important; }
    #whySyn .ws-head { margin-bottom: 28px !important; }
    #whySyn h2 { font-size: 1.55rem !important; }
    #whySyn .ws-lead { font-size: 13px !important; }

    /* ---- Tracks section (home) ---- */
    #courses.tw-section { padding: 56px 0 !important; }
    #courses.tw-section h2 { font-size: 1.55rem !important; }
    .tw-card { padding: 20px 18px !important; }

    /* ---- Delivery Modes (home) ---- */
    #deliveryModes { padding: 48px 0 56px !important; }
    #deliveryModes h2 { font-size: 1.45rem !important; }
    .dm-card { padding: 22px 18px !important; }

    /* ---- Stats bar (home) ---- */
    #fintechStats { padding: 40px 0 !important; }
    #fintechStats .fs-num { font-size: 1.4rem !important; }
    #fintechStats .fs-num.fs-iso { font-size: 0.95rem !important; }
    .fs-block { padding: 16px 12px !important; }

    /* ---- Testimonials (home) ---- */
    #testV2 { padding: 48px 0 !important; }
    #testV2 h2 { font-size: 1.55rem !important; }
    #testV2 .tv-card { padding: 22px 18px !important; min-height: auto !important; }
    #testV2 .tv-quote { font-size: 13.5px !important; }

    /* ---- Journey (home) — fix narrow-column desc + line overflow ---- */
    #journey { padding: 56px 0 !important; }
    #journey h2 { font-size: 1.6rem !important; }
    #journey .jv-path { grid-template-columns: 1fr !important; gap: 16px !important; margin-top: 32px !important; }
    #journey .jv-path-line { display: none !important; }
    #journey .jv-step { display: grid !important; grid-template-columns: 48px 1fr !important; grid-template-areas: "circle title" "circle desc" !important; column-gap: 14px !important; row-gap: 4px !important; text-align: left !important; align-items: start !important; padding: 10px 0 !important; }
    #journey .jv-step-circle { grid-area: circle !important; width: 48px !important; height: 48px !important; margin: 0 !important; }
    #journey .jv-step-num { font-size: 1.05rem !important; }
    #journey .jv-step-title { grid-area: title !important; font-size: 14.5px !important; margin: 4px 0 2px !important; }
    #journey .jv-step-desc { grid-area: desc !important; font-size: 12.5px !important; padding: 0 !important; line-height: 1.5 !important; }

    /* ---- Hero announcement bar (carousel) ---- */
    #announcementBar { padding: 8px 0 !important; }
    #announcementBar .ab-slide { font-size: 11.5px !important; padding: 0 32px; }
    #announcementBar .ab-tag { font-size: 10px !important; padding: 2px 6px !important; }
    #announcementBar .ab-viewport { height: 38px !important; }

    /* ---- Training calendar ---- */
    #pbResults .pbv2-course-row { flex-wrap: wrap; gap: 8px; }
    #pbResults .pbv2-course-name { font-size: 13px; }
    #pbResults .pbv2-course-pill { font-size: 10px; padding: 4px 9px; }
    #pbResults .pbv2-sessions-inner { padding: 4px 10px 12px; }
    #pbResults .pbv2-session-date { padding: 10px 6px; }
    #pbResults .pbv2-session-day { font-size: 18px; }
    #pbResults .pbv2-cat-head { flex-wrap: wrap; }
    #pbResults .pbv2-cat-title { font-size: 15px; }

    /* ---- Generic long-text clip prevention ---- */
    .hv2 h1, #whySyn h2, #cmpSection h2, #labStack h2, #payDeploy .pd-hero h2,
    #bundleCta .bu-card h3, .ws-title, .dm-title, .tw-title, .sv-title, .jv-step-title,
    .cvv-title { word-wrap: break-word; overflow-wrap: break-word; hyphens: none; }

    /* ---- Course page cp-hero (original design, preserved on course pages) ---- */
    .cp-hero { padding: 40px 0 !important; }
    .cp-hero-inner { grid-template-columns: 1fr !important; gap: 20px !important; text-align: left; padding: 0 16px !important; }
    .cp-hero h1 { font-size: 1.75rem !important; line-height: 1.2 !important; }
    .cp-hero-oem img { max-height: 80px; }
}

/* ========== Smaller phones ( ≤ 480px ) ========== */
@media (max-width: 480px) {
    .hv2 h1 { font-size: 1.75rem !important; }
    .hv2-sub { font-size: 13px !important; }
    .hv2-actions { flex-direction: column; width: 100%; gap: 8px !important; }
    .hv2-actions .hv2-btn { width: 100%; justify-content: center; }

    #vendorStrike .vs-chip { font-size: 10.5px; padding: 5px 9px; }
    #payDeploy .pd-zero-val { font-size: 4.2rem !important; }
    #bundleCta .bu-stack { grid-template-columns: 1fr; }

    .pbv2-hero h1 { font-size: 1.75rem !important; }
    .pbv2-search { height: 46px !important; padding: 0 110px 0 40px !important; font-size: 13px !important; }
    .pbv2-search-cta { height: 36px !important; padding: 0 12px !important; font-size: 11px !important; }
    .pbv2-filter-group { gap: 5px !important; }
    .pbv2-chip { font-size: 10.5px !important; height: 26px !important; padding: 0 8px !important; }
}

/* ========== Container padding on mobile ========== */
@media (max-width: 720px) {
    .container { padding-left: 16px !important; padding-right: 16px !important; }
}

/* ========== Mobile menu — accordion-style full navigation (brand dark-navy) ========== */
.mobile-menu { display: none; }
@media (max-width: 1024px) {
    .mobile-menu { position: fixed; top: 64px; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, #070B10 0%, #0B2447 55%, #111B2E 100%); overflow-y: auto; padding: 10px 18px 60px; display: none; flex-direction: column; z-index: 9999; -webkit-overflow-scrolling: touch; border-top: 1px solid rgba(242,107,43,.25); box-shadow: 0 16px 48px rgba(0,0,0,.45); color: #fff; }
    .mobile-menu.open { display: flex !important; }
    /* Override theme.css .mobile-menu a { color: var(--text)!important } — we need white on dark-navy */
    .mobile-menu a, .mobile-menu summary, .mobile-menu .mm-direct { display: block; color: #fff !important; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; text-decoration: none; border-bottom: none; padding: 0; }
    .mobile-menu .mm-group { border-bottom: 1px solid rgba(255,255,255,.08); padding: 4px 0; }
    .mobile-menu .mm-group > summary { padding: 14px 4px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; list-style: none; }
    .mobile-menu .mm-group > summary::-webkit-details-marker { display: none; }
    .mobile-menu .mm-chev { width: 16px; height: 16px; color: rgba(255,255,255,.55); transition: transform .25s ease; flex-shrink: 0; }
    .mobile-menu .mm-group[open] > summary > .mm-chev { transform: rotate(180deg); color: #F26B2B; }
    .mobile-menu .mm-group[open] > summary { color: #F26B2B !important; }
    .mobile-menu .mm-links { display: flex; flex-direction: column; padding: 2px 0 12px 4px; border-left: 2px solid rgba(242,107,43,.35); margin-left: 4px; gap: 2px; }
    .mobile-menu .mm-links a { padding: 10px 12px; font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,.78) !important; border-radius: 8px; border-bottom: none; transition: background .15s, color .15s; }
    .mobile-menu .mm-links a:hover, .mobile-menu .mm-links a:active { background: rgba(242,107,43,.12); color: #fff !important; }
    .mobile-menu .mm-links a.mm-all { color: #F26B2B !important; font-weight: 700; margin-top: 4px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); border-radius: 0; }
    .mobile-menu .mm-direct { padding: 14px 4px; border-bottom: 1px solid rgba(255,255,255,.08); }
    .mobile-menu .mm-direct:hover, .mobile-menu .mm-direct:active { color: #F26B2B !important; }
    .mobile-menu .mm-ctas { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
    .mobile-menu .mm-cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: 12px; font-size: 14px; font-weight: 700; letter-spacing: -0.005em; text-decoration: none; border: none; cursor: pointer; font-family: inherit; }
    .mobile-menu a.mm-cta--store { background: rgba(242,107,43,.14); color: #F26B2B !important; border: 1px solid rgba(242,107,43,.5); }
    .mobile-menu a.mm-cta--store:hover, .mobile-menu a.mm-cta--store:active { background: rgba(242,107,43,.22); color: #fff !important; }
    .mobile-menu .mm-cta--demo { background: linear-gradient(135deg, #F26B2B 0%, #E85A1A 100%); color: #fff !important; box-shadow: 0 6px 22px -6px rgba(242,107,43,.55); }

    /* Sticky close button — always visible at top-right while scrolling the menu */
    .mobile-menu .mm-close { position: sticky; top: 0; align-self: flex-end; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; cursor: pointer; padding: 0; margin: 0 -4px 6px auto; z-index: 2; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background .15s, border-color .15s, transform .15s; }
    .mobile-menu .mm-close:hover, .mobile-menu .mm-close:active { background: rgba(242,107,43,.2); border-color: rgba(242,107,43,.55); color: #F26B2B; transform: scale(1.05); }
    .mobile-menu .mm-close svg { display: block; }
}
/* Don't let the page body scroll when mobile menu is open */
body:has(.mobile-menu.open) { overflow: hidden; }

/* ========== Announcement bar readability at all widths ========== */
@media (max-width: 520px) {
    #announcementBar .ab-close { right: 8px !important; font-size: 16px !important; }
}
