/* ==========================================================================
   MedForge Fusion — Responsive overrides
   Load after style.css
   Breakpoints: 1199 / 991 / 767 / 575
   ========================================================================== */

/* ---------- Global safety ---------- */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
    height: auto;
}

table {
    max-width: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Keep centered site width — do NOT force containers to 100% */
.container,
.hero-premium-container,
.compare-refined-container,
.benefits-refined-container,
.includes-refined-container,
.premium-testimonials-container,
.premium-ctas-container,
.premium-whyfree-container,
.footer-premium-container,
.footer-disclaimer-container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
}

.hero-premium-container,
.compare-refined-container,
.benefits-refined-container,
.includes-refined-container,
.premium-testimonials-container,
.premium-ctas-container,
.premium-whyfree-container,
.footer-premium-container,
.footer-disclaimer-container {
    max-width: 1400px;
}

.container {
    max-width: 1328px;
}

@media (max-width: 1399.98px) {
    .container {
        max-width: 1140px;
    }
}

@media (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
}

@media (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }
}

@media (max-width: 767.98px) {
    .container {
        max-width: 540px;
    }
}

@media (max-width: 575.98px) {
    .container {
        max-width: 100%;
    }
}

.row {
    --bs-gutter-x: 1.5rem;
}

/* ---------- Large tablets / small desktops ---------- */
@media (max-width: 1199.98px) {
    .hero-premium-grid {
        gap: 48px !important;
    }

    .hero-premium-partners {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .hero-partners-grid {
        gap: 20px !important;
    }

    .brand-logo--header {
        max-width: 150px;
    }

    .header-phone-content {
        display: none;
    }
}

/* ---------- Tablets ---------- */
@media (max-width: 991.98px) {
    body.has-header-premium,
    body:has(.header-premium) {
        padding-top: 0 !important;
    }

    .header-premium {
        position: sticky;
        top: 0;
        z-index: 1030;
        background: #fff;
    }

    .header-premium-nav {
        padding: 10px 0 !important;
    }

    .header-premium-nav .container {
        gap: 12px !important;
    }

    .header-phone-link {
        display: none !important;
    }

    .v3-trust-bar .container,
    .header-premium-nav .container,
    .hero-premium-container,
    .compare-refined-container,
    .benefits-refined-container,
    .includes-refined-container,
    .premium-testimonials-container,
    .premium-ctas-container,
    .footer-premium-container,
    .footer-disclaimer-container,
    section.container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .hero-premium-section {
        padding: 24px 0 48px !important;
    }

    .hero-premium-grid {
        grid-template-columns: 1fr !important;
        gap: 28px !important;
    }

    .hero-premium-headline {
        font-size: 40px !important;
        text-align: center;
    }

    .hero-premium-subheadline {
        text-align: center;
        font-size: 17px !important;
    }

    .hero-premium-form-wrapper {
        position: static !important;
        width: 100%;
    }

    .hero-premium-form-card {
        width: 100%;
        max-width: 560px;
        margin-left: auto;
        margin-right: auto;
    }

    .compare-refined-grid,
    .benefits-cards-grid,
    .premium-ctas-grid,
    .testimonial-quotes-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .compare-refined-card.featured {
        transform: none !important;
    }

    .benefits-intro-grid,
    .includes-refined-grid {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }

    .includes-features-list {
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
    }

    .footer-cta-content {
        flex-direction: column !important;
        align-items: stretch !important;
        text-align: center;
        gap: 24px !important;
    }

    .footer-search-form {
        width: 100%;
        max-width: 520px;
        margin: 0 auto;
        flex-wrap: wrap;
    }

    .footer-nav-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 32px !important;
    }

    .footer-brand-column {
        grid-column: 1 / -1;
    }

    .events-hero {
        min-height: 0 !important;
        padding-top: 24px;
    }

    .events-hero .u-s17 {
        font-size: 34px !important;
        line-height: 1.15 !important;
    }

    .aurora-card {
        margin-top: 8px;
    }

    .story-highlight-panel {
        min-height: 0 !important;
        padding: 28px 22px !important;
    }

    .premium-cta-title {
        font-size: 26px !important;
    }

    .btn,
    .hero-form-submit,
    .footer-search-button,
    .v3-trust-bar-cta {
        white-space: normal;
    }
}

/* ---------- Phones / small tablets ---------- */
@media (max-width: 767.98px) {
    .v3-trust-bar {
        position: relative;
        z-index: 1040;
    }

    .header-premium-brand .brand-logo--header,
    .brand-logo--header {
        max-width: 130px;
    }

    .brand-logo--footer {
        max-width: 160px;
        height: 64px;
    }

    .hero-premium-headline {
        font-size: 32px !important;
        letter-spacing: -0.02em !important;
    }

    .hero-form-title {
        font-size: 22px !important;
    }

    .hero-form-group .form-label {
        flex-wrap: wrap;
        gap: 8px;
    }

    .hero-premium-partners {
        margin-top: 28px;
    }

    .hero-partners-grid {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px !important;
        align-items: center;
        justify-items: center;
    }

    .hero-partner-logo {
        max-width: 100px !important;
        width: 100%;
        height: auto !important;
    }

    .compare-refined-section,
    .benefits-refined-section,
    .includes-refined-section,
    .premium-testimonials-section,
    .premium-whyfree-section,
    .premium-ctas-section {
        padding-top: 48px !important;
        padding-bottom: 56px !important;
    }

    .compare-refined-headline,
    .benefits-refined-headline,
    .includes-refined-headline {
        font-size: 30px !important;
        line-height: 1.2 !important;
    }

    .premium-testimonials-title {
        font-size: 28px !important;
    }

    .compare-refined-card,
    .benefits-refined-card,
    .includes-bofa-card,
    .testimonial-quote-card,
    .premium-cta-card {
        padding: 18px 14px !important;
    }

    .compare-price {
        font-size: 36px !important;
    }

    .compare-company-name {
        font-size: 16px !important;
    }

    .compare-feature-badge {
        font-size: 13px !important;
    }

    .compare-feature-text,
    .compare-cta {
        font-size: 13px !important;
    }

    .includes-features-list {
        grid-template-columns: 1fr !important;
    }

    .includes-feature-item {
        gap: 14px !important;
    }

    .footer-premium-container,
    .footer-disclaimer-container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .footer-cta-section {
        padding: 28px 20px !important;
        margin-bottom: 40px !important;
    }

    .footer-cta-headline {
        font-size: 26px !important;
    }

    .footer-search-form {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .footer-search-input,
    .footer-search-button {
        width: 100% !important;
        border-radius: 10px !important;
    }

    .footer-nav-grid {
        grid-template-columns: 1fr !important;
        gap: 28px !important;
        text-align: left;
    }

    .footer-bottom {
        flex-direction: column !important;
        gap: 16px !important;
        text-align: center;
    }

    .premium-cta-button,
    .hero-mobile-cta,
    .compare-cta {
        width: 100%;
        justify-content: center;
    }

    .reviews-summary {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    .reviews-summary-score {
        font-size: 34px !important;
    }

    /* Forms */
    .form-control-lg,
    .fv2-form-select,
    .form-select {
        font-size: 16px !important; /* prevents iOS zoom */
        min-height: 48px;
    }

    .card-body.p-4.p-lg-5,
    .card-body.p-4 {
        padding: 20px !important;
    }

    /* Events */
    .events-hero {
        padding-bottom: 36px !important;
    }

    .events-hero .lead {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        text-align: center;
    }

    .events-hero h1,
    .events-hero .u-s17 {
        font-size: 28px !important;
        text-align: center;
    }

    .events-hero h2 {
        text-align: center;
        font-size: 20px !important;
    }

    .events-hero .fs-lg,
    .events-hero .u-s18 {
        text-align: center;
        font-size: 16px !important;
    }

    .events-hero .d-sm-flex {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .events-hero .btn,
    .events-hero .u-s20 {
        max-width: 100% !important;
        width: 100%;
        margin: 0 !important;
    }

    .event-strip .steps {
        flex-direction: column;
        gap: 12px;
    }

    .steps-horizontal-md {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .btn-scroll-top {
        right: 12px !important;
        bottom: 12px !important;
    }
}

/* ---------- Small phones ---------- */
@media (max-width: 575.98px) {
    .hero-premium-headline {
        font-size: 28px !important;
    }

    .compare-refined-headline,
    .benefits-refined-headline,
    .includes-refined-headline,
    .premium-testimonials-title,
    .v3-page-title {
        font-size: 26px !important;
    }

    .hero-partners-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .hero-form-helper,
    .compare-refined-subheadline,
    .benefits-refined-subheadline {
        font-size: 15px !important;
    }

    .story-highlight-stat {
        font-size: 36px !important;
    }

    .story-highlight-copy {
        max-width: none;
    }

    .testimonial-quote-text,
    .reviews-item-title {
        font-size: 15px !important;
    }

    .footer-cta-headline {
        font-size: 24px !important;
    }

    .premium-cta-title {
        font-size: 22px !important;
    }

    .events-hero .u-s17 {
        font-size: 24px !important;
    }

    .offcanvas {
        max-width: 100vw;
    }

    .v3-mobile-nav-links a {
        font-size: 16px !important;
        padding: 14px 4px !important;
    }
}

/* ---------- Very small phones ---------- */
@media (max-width: 379.98px) {
    .hero-premium-headline {
        font-size: 26px !important;
    }

    .v3-trust-bar-cta,
    .header-mobile-toggle {
        transform: scale(0.95);
        transform-origin: right center;
    }

    .hero-partners-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }
}

/* ---------- Landscape phones ---------- */
@media (max-height: 480px) and (orientation: landscape) {
    .events-hero {
        min-height: 0 !important;
    }

    .offcanvas-body {
        overflow-y: auto;
    }
}

/* ---------- Lead modal ---------- */
.lead-modal {
    padding: 16px !important;
}
.lead-modal-dialog {
    width: min(100%, 560px);
    max-width: 100%;
    margin: 0 auto;
}
.lead-modal-body {
    max-height: min(78vh, 720px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 575.98px) {
    .lead-modal-row {
        grid-template-columns: 1fr !important;
    }
    .lead-modal-title {
        font-size: 22px !important;
    }
    .lead-modal-submit {
        width: 100%;
    }
    .lead-modal-dialog {
        border-radius: 16px !important;
    }
}

/* ---------- Homepage extras ---------- */
@media (max-width: 991.98px) {
    .home-reviews-slider-wrap {
        padding: 0 36px !important;
    }
    .home-reviews-title {
        font-size: 22px !important;
    }
    .premium-benefits-educational-grid,
    .site-faq-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    .how-we-help-slider-wrap {
        padding: 0 36px 4px !important;
    }
}

@media (max-width: 767.98px) {
    .home-reviews-section {
        padding: 48px 0 56px !important;
    }
    .home-reviews-nav {
        width: 34px !important;
        height: 34px !important;
    }
    .events-strip-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    .events-hero-title {
        font-size: 1.75rem !important;
        text-align: center;
    }
    .events-hero-tagline,
    .events-hero-copy > p {
        text-align: center;
    }
    .events-hero-meta {
        justify-content: center;
    }
    .events-hero-cta,
    .events-feature-section .btn,
    .events-final-cta .btn {
        width: 100%;
    }
    .events-media,
    .events-media--lg,
    .events-media--md {
        min-height: 210px !important;
        height: 210px !important;
    }
    .events-tickets-copy,
    .events-final-cta-panel {
        padding: 28px 20px !important;
    }
    .speaker-card {
        padding: 18px 14px 16px !important;
    }
    .includes-features-list {
        grid-template-columns: 1fr !important;
    }
    .site-faq-section {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

@media (max-width: 575.98px) {
    .events-strip-grid {
        grid-template-columns: 1fr !important;
    }
    .events-strip-item {
        justify-content: flex-start !important;
    }
    .compare-refined-card,
    .includes-bofa-card,
    .content-card {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }
    .home-reviews-slider-wrap {
        padding: 0 32px !important;
    }
}

/* ---------- Touch / performance helpers ---------- */
img[loading="lazy"] {
    content-visibility: auto;
}

.swiper,
.home-reviews-swiper,
.how-we-help-swiper,
.events-guest-swiper {
    max-width: 100%;
}

/* Defer paint for below-fold blocks */
.home-reviews-section,
.events-speakers-section,
.events-why-vegas,
.events-tickets-section,
.premium-ctas-section,
.site-faq-section,
.footer-premium {
    content-visibility: auto;
    contain-intrinsic-size: 1px 720px;
}

/* ---------- Print ---------- */
@media print {
    .v3-trust-bar,
    .header-mobile-toggle,
    .btn-scroll-top,
    .offcanvas,
    .offcanvas-backdrop,
    .lead-modal {
        display: none !important;
    }

    body.has-header-premium {
        padding-top: 0 !important;
    }
}
