/* ============================================
   RESPONSIVE DESIGN & BREAKPOINTS
   ============================================ */

/* Widescreen and Notebooks */
@media (max-width: 1200px) {
  :root {
    --container-padding: 1.5rem;
  }

  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-content {
    grid-template-columns: 1.1fr 1fr;
    gap: var(--space-4);
  }
}

/* Tablets and Landscapes */
@media (max-width: 992px) {
  /* Navigation */
  .main-nav, .header-cta {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-menu {
    display: block;
  }

  /* Grid Layouts */
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .industries-map {
    grid-template-columns: 1fr;
  }

  .industries-map-hero {
    min-height: auto;
  }

  .why-choose-inner {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }

  .why-choose-left {
    max-width: 100%;
    text-align: center;
  }

  .why-choose-left .section-subtitle {
    margin: 0 auto;
  }

  .erp-inner {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }

  .erp-right {
    text-align: center;
  }

  .erp-right .section-subtitle {
    margin: 0 auto var(--space-6);
  }

  .mobile-app-inner {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }

  .mobile-app-left {
    text-align: center;
  }

  .mobile-app-subtitle {
    margin: 0 auto var(--space-6);
  }

  .contact-inner {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }

  .contact-left {
    max-width: 100%;
    text-align: center;
  }

  .contact-info-list {
    align-items: center;
  }

  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }

  .cta-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cta-newsletter {
    grid-column: span 2;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: var(--space-12);
  }

  .hero-left {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--space-12);
  }

  .hero-description {
    margin: 0 auto var(--space-8);
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats-inline {
    flex-wrap: wrap;
    gap: 8px;
  }

  .hero-stats-inline .stat-card {
    flex: 1 1 calc(33% - 8px);
    min-width: 140px;
  }

  .process-steps {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-8);
  }

  .process-steps::before {
    display: none; /* Hide horizontal line since we wrapping */
  }

  .process-header {
    grid-template-columns: 1fr;
    gap: var(--space-4);
    text-align: center;
  }

  .process-header .section-tag {
    margin: 0 auto var(--space-4);
  }
}

/* Phones and Portrait Tablets */
@media (max-width: 768px) {
  :root {
    --container-padding: 1rem;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-4 {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .why-choose-right {
    grid-template-columns: 1fr;
  }

  .process-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .erp-modules-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .mobile-features-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .mobile-feature-item {
    flex-direction: row;
    text-align: left;
    gap: var(--space-4);
    padding: var(--space-3);
  }

  .mobile-feature-icon {
    margin-bottom: 0;
  }

  .industries-map-metrics {
    grid-template-columns: 1fr;
  }

  .industry-lane {
    grid-template-columns: 36px 46px minmax(0, 1fr);
    padding: var(--space-4);
  }

  .industry-lane-stat {
    grid-column: 3;
    justify-self: start;
    margin-top: var(--space-2);
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .contact-form {
    grid-template-columns: 1fr;
  }

  .contact-form .form-group-full {
    grid-column: span 1;
  }

  .contact-form .btn-primary {
    grid-column: span 1;
  }

  .contact-right {
    padding: var(--space-6);
  }

  .hero-stats-inner {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-stats-inline {
    flex-wrap: wrap;
    gap: 8px;
  }

  .hero-stats-inline .stat-card {
    flex: 1 1 calc(50% - 8px);
    min-width: 140px;
  }

  .stat-card {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .stat-card:nth-child(even) {
    border-right: none;
  }

  .stat-card:last-child {
    border-bottom: none;
    grid-column: span 2;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-brand {
    max-width: 100%;
    text-align: center;
    align-items: center;
  }

  .footer-title::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .footer-links, .footer-contact-info {
    align-items: center;
    text-align: center;
  }

  .footer-bottom-inner {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  .cta-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .cta-button {
    align-self: center;
  }
}

/* Tiny Screens */
@media (max-width: 576px) {
  .hero-stats-inner {
    grid-template-columns: 1fr;
  }

  .hero-stats-inline {
    flex-wrap: wrap;
    gap: 6px;
  }

  .hero-stats-inline .stat-card {
    flex: 1 1 calc(50% - 6px);
    min-width: 130px;
  }

  .stat-card:last-child {
    grid-column: span 1;
  }

  .erp-modules-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .process-steps {
    grid-template-columns: 1fr;
  }

  .phone-mockup-sm, .phone-mockup-lg {
    display: none; /* Hide background mockups, keep only center one on tiny screens */
  }

  .phone-mockup-md {
    width: 100%;
    max-width: 240px;
    height: 400px;
  }

  .mobile-mockups {
    display: none; /* Hide floating phones in hero */
  }
}

/* ============================================
   RESPONSIVE HARDENING PASS
   ============================================ */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

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

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

img,
video {
  height: auto;
}

.container,
.header-inner,
.hero-content,
.partners-inner,
.services-grid,
.process-inner,
.erp-inner,
.mobile-app-inner,
.industries-map,
.testimonials-grid,
.contact-inner,
.footer-inner,
.cta-grid {
  min-width: 0;
}

.section-title,
.hero-title,
.service-title,
.module-label,
.industry-lane-copy,
.contact-info-val,
.footer-contact-item,
.btn,
.btn-book,
.cta-button {
  overflow-wrap: anywhere;
}

.dashboard-mockup,
.dashboard-window,
.dashboard-body,
.erp-visual,
.mobile-visual,
.phone-mockup,
.contact-right,
.service-card,
.testimonial-card,
.industry-lane {
  max-width: 100%;
}

.dashboard-window {
  overflow: hidden;
}

.form-input,
.form-textarea,
select,
textarea,
input {
  max-width: 100%;
}

@media (max-width: 1200px) {
  .header-inner {
    height: 72px;
  }

  .hero-bg-glow,
  .services-bg-orb {
    transform: scale(0.82);
    transform-origin: center;
  }

  .process-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-6);
  }

  .erp-modules-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 992px) {
  .site-header {
    background: rgba(5, 11, 31, 0.95);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .site-logo .logo-name,
  .site-logo .logo-tagline {
    color: var(--color-text-white);
  }

  .hamburger span {
    background: white;
  }

  .mobile-menu {
    top: 72px;
    height: calc(100dvh - 72px);
    padding-bottom: max(var(--space-8), env(safe-area-inset-bottom));
  }

  .hero-section,
  .services-section,
  .why-choose-section,
  .process-section,
  .erp-section,
  .mobile-app-section,
  .industries-section,
  .testimonials-section,
  .contact-section {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
  }

  .hero-content {
    min-height: auto;
  }

  .hero-right,
  .erp-right,
  .mobile-app-right {
    width: 100%;
  }

  .dashboard-body {
    grid-template-columns: minmax(108px, 0.36fr) minmax(0, 1fr) !important;
  }

  .dashboard-main [style*="grid-template-columns: repeat(4"],
  .dashboard-main [style*="grid-template-columns: 2fr"],
  .dashboard-main [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .process-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .industries-map-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .section-header {
    padding: 0 var(--container-padding);
  }

  .section-title,
  .hero-title {
    font-size: clamp(2rem, 9vw, 3rem);
    line-height: 1.08;
  }

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

  .hero-actions .btn,
  .hero-actions .btn-book,
  .cta-button {
    flex: 1 1 220px;
    justify-content: center;
  }

  .services-grid {
    padding-inline: var(--container-padding);
  }

  .service-card {
    min-height: auto;
  }

  .erp-modules-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .module-item {
    max-width: none;
    min-height: 106px;
  }

  .dashboard-body {
    display: block !important;
    min-height: 0 !important;
  }

  .dashboard-sidebar {
    display: none !important;
  }

  .dashboard-main {
    padding: 14px !important;
  }

  .dashboard-main [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  .mobile-visual-shell,
  .mobile-visual-stage {
    min-height: 0;
  }

  .industries-map-metrics,
  .industries-orbit,
  .industry-lane {
    grid-template-columns: 1fr;
  }

  .industry-lane {
    gap: var(--space-3);
  }

  .industry-lane-index,
  .industry-lane-icon,
  .industry-lane-copy,
  .industry-lane-stat {
    grid-column: auto;
    justify-self: start;
  }

  .contact-info-item,
  .footer-contact-item {
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 576px) {
  :root {
    --container-padding: 0.875rem;
  }

  .header-inner {
    height: 66px;
  }

  .mobile-menu {
    top: 66px;
    height: calc(100dvh - 66px);
  }

  .site-logo .logo-icon {
    width: 38px;
    height: 38px;
  }

  .site-logo .logo-name {
    font-size: var(--text-lg);
  }

  .site-logo .logo-tagline {
    font-size: 0.52rem;
  }

  .hero-section {
    padding-top: 96px;
  }

  .hero-stats-inline .stat-card,
  .hero-stats-inner .stat-card {
    min-width: 0;
  }

  .erp-modules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-icon {
    width: 52px;
    height: 52px;
  }

  .process-step,
  .mobile-feature-item,
  .contact-info-item {
    padding: var(--space-4);
  }

  .footer-legal-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 380px) {
  .erp-modules-grid,
  .hero-stats-inline,
  .hero-stats-inner {
    grid-template-columns: 1fr;
  }

  .erp-modules-grid {
    display: grid;
  }

  .module-item {
    max-width: 170px;
  }

  .btn,
  .btn-book,
  .cta-button {
    width: 100%;
    justify-content: center;
  }
}

/* Final responsive production polish */
@media (max-width: 1180px) {
  .footer-inner {
    grid-template-columns: minmax(260px, 1.3fr) repeat(2, minmax(160px, 0.85fr));
  }

  .footer-col:last-child {
    grid-column: 1 / -1;
    max-width: 760px;
  }
}

@media (max-width: 920px) {
  .footer-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
    max-width: 520px;
  }

  .footer-col:last-child {
    grid-column: auto;
  }
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .footer-brand,
  .footer-col,
  .footer-links,
  .footer-contact-list {
    align-items: flex-start;
    text-align: left;
  }

  .footer-col-title::after {
    margin-left: 0;
    margin-right: auto;
  }

  .footer-bottom-inner {
    align-items: flex-start;
    text-align: left;
  }

  .footer-legal-links {
    justify-content: flex-start;
  }

  .cta-actions,
  .hero-actions,
  .premium-actions {
    gap: 0.75rem;
  }

  .btn.btn-primary.cta-button,
  a.btn.btn-primary.cta-button {
    width: auto;
    max-width: min(100%, 285px);
    min-height: 46px;
    flex: 0 1 auto;
    padding: 0.78rem 1.1rem;
    font-size: 0.9rem;
    line-height: 1.2;
    white-space: normal;
  }

  .mobile-phones-display {
    min-height: clamp(540px, 154vw, 650px);
    padding: 1.25rem 0 1.75rem;
    align-items: center;
  }

  .phone-mockup-sm,
  .phone-mockup-lg {
    display: none;
  }

  .phone-mockup.phone-mockup-md.new-phone-ui.new-phone-welcome {
    width: clamp(270px, 78vw, 320px);
    height: clamp(540px, 156vw, 640px);
    max-width: none;
    border-width: 9px;
    border-radius: 42px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(255, 255, 255, 0.08);
    transform: none;
  }

  .phone-mockup-md .phone-ui-content {
    padding: 24px 17px 18px;
    font-size: 1rem;
  }

  .phone-mockup-md .p-welcome-title {
    font-size: clamp(1.2rem, 5vw, 1.55rem);
    line-height: 1.08;
  }

  .phone-mockup-md .p-welcome-subtitle,
  .phone-mockup-md .p-stat-label,
  .phone-mockup-md .p-input-label {
    font-size: 0.72rem;
  }

  .phone-mockup-md .p-stat-value {
    font-size: 1.15rem;
  }

  .phone-mockup-md .p-input-group,
  .phone-mockup-md .p-login-btn {
    min-height: 44px;
  }
}

@media (max-width: 520px) {
  .footer-logo.site-logo {
    max-width: 100%;
  }

  .footer-logo.site-logo .logo-text {
    display: flex;
  }

  .social-links {
    flex-wrap: wrap;
  }

  .btn.btn-primary.cta-button,
  a.btn.btn-primary.cta-button {
    max-width: 265px;
    padding: 0.72rem 0.95rem;
    font-size: 0.86rem;
  }
}

@media (max-width: 380px) {
  .btn.btn-primary.cta-button,
  a.btn.btn-primary.cta-button {
    width: auto;
    max-width: 250px;
  }

  .phone-mockup.phone-mockup-md.new-phone-ui.new-phone-welcome {
    width: min(88vw, 292px);
    height: min(176vw, 584px);
    min-height: 514px;
    border-width: 8px;
    border-radius: 38px;
  }
}
