/* ==========================================================================
   MediCorp ERP – responsive overrides
   ========================================================================== */

/* < 1200px: collapsed navbar */
@media (max-width: 1199.98px) {
    .site-header .navbar-collapse { padding: 1rem 0 .5rem; max-height: calc(100vh - 80px); overflow-y: auto; }
    .site-header .nav-link { padding: .7rem .85rem !important; }
    .nav-actions { margin-top: 1rem; }
    .nav-actions .btn { width: 100%; }
    .dropdown-menu { border: 0; box-shadow: none; background: var(--mc-bg-alt); }
}

/* < 992px */
@media (max-width: 991.98px) {
    .section { padding: 72px 0; }
    .hero { padding: 64px 0 112px; }
    .cta-section { padding-bottom: 72px; }
    .section-alt + .cta-section, .section-dark + .cta-section { padding-top: 72px; }
    .cta-box { padding: 40px 32px; }
    .mock-float-1 { left: -8px; }
    .mock-float-2 { right: -8px; }
    .layer-item { margin-left: 0; }
    .form-card { padding: 28px; }
    .section-heading { margin-bottom: 2.25rem; }
}

/* < 768px */
@media (max-width: 767.98px) {
    .section { padding: 56px 0; }
    .page-hero { padding: 48px 0 56px; }
    .hero-text { font-size: 1.05rem; }
    .stats-strip { margin-top: -64px; }
    .stat strong { font-size: 1.6rem; }
    .mock-kpis { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .mock-kpi strong { font-size: 1rem; }
    .mock-float { display: none; }
    .journey-node { width: 70px; margin: -35px 0 0 -35px; transform: rotate(var(--angle)) translate(38vw) rotate(calc(-1 * var(--angle))); }
    .journey-node i { width: 42px; height: 42px; font-size: 1.05rem; }
    .journey-node span { font-size: .65rem; }
    .journey-core { width: 110px; height: 110px; }
    .journey-core img { width: 40px; height: 40px; }
    .timeline::before { left: 7px; }
    .timeline-item { flex-direction: column; gap: .25rem; padding-left: 2rem; }
    .timeline-item::after { left: 0; }
    .timeline-year { width: auto; text-align: left; }
    .timeline-content { padding-left: 0; }
    .cta-box { padding: 32px 24px; border-radius: 18px; }
    .cta-section { padding-bottom: 56px; }
    .section-alt + .cta-section, .section-dark + .cta-section { padding-top: 56px; }
    .form-card { padding: 22px 18px; }
    .side-card { padding: 22px; }
    .feature-card, .module-card, .industry-card, .post-card, .step-card, .deploy-card, .phase-card, .standard-card, .plan-card { padding: 22px; }
    .spec-grid { gap: 12px; }
    .spec-grid div { padding: 18px; }
    .spec-grid strong { font-size: 1.3rem; }
    .admin-login-card { padding: 32px 22px; }
    .footer-bottom { flex-direction: column; }
}

/* < 576px */
@media (max-width: 575.98px) {
    .hero-title { font-size: 2.1rem; }
    .btn-lg { width: 100%; }
    .hero .d-flex .btn-lg, .page-hero .d-flex .btn-lg { width: 100%; }
    .mock-body { padding: 14px; }
    .mock-kpi { padding: 8px; }
    .mock-kpi small { font-size: .6rem; }
    .mock-bars { height: 80px; gap: 6px; }
    /* Filters wrap onto several lines instead of scrolling sideways */
    .filter-bar { justify-content: flex-start; flex-wrap: wrap; gap: .4rem; }
    .filter-btn { padding: .4rem .85rem; font-size: .82rem; }
    .solution-nav { justify-content: flex-start; }
    .solution-pill { padding: .45rem .8rem; font-size: .82rem; }
    .status-tabs { flex-wrap: wrap; gap: .4rem; }
    .status-tab { padding: .35rem .75rem; font-size: .82rem; }
}

/* ==========================================================================
   Horizontal-overflow fixes (page must never slide sideways on mobile)
   ========================================================================== */

/* Safety net: clip anything wider than the screen without breaking the sticky header */
html { overflow-x: hidden; }
body { overflow-x: clip; position: relative; width: 100%; }

/* Bootstrap's .g-5 gutter (48px) is wider than the container padding (24px),
   so rows stuck out 12px on each side on phones/tablets. Match the padding. */
@media (max-width: 991.98px) {
    .row.g-5, .row.gx-5 { --bs-gutter-x: 1.5rem; }
}

/* Long words / URLs must wrap instead of widening the page */
@media (max-width: 767.98px) {
    h1, h2, h3, p, li, dd, a { overflow-wrap: anywhere; }
    .table-responsive { -webkit-overflow-scrolling: touch; }
}
