/* ============================================
   Jai Bharat Engineers — Responsive Styles
   ============================================ */

/* Large Desktop */
@media (min-width: 1400px) {
  .container { max-width: 1280px; }
}

/* Laptop / Small Desktop */
@media (max-width: 1200px) {
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .industries-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; gap: 36px; }
  .footer-grid > :last-child { grid-column: 1 / -1; }
  .services-page-layout { grid-template-columns: 240px 1fr; }
  .sd-capabilities { grid-template-columns: repeat(2, 1fr); }
  .hero-content { gap: 40px; }
  .fc-2 { right: -4%; }
}

/* Tablet */
@media (max-width: 992px) {
  :root { --header-h: 70px; }

  .section { padding: 80px 0; }

  .topbar-inner { padding: 0 20px; gap: 12px; }
  .topbar-left .topbar-item { max-width: 36vw; font-size: 0.72rem; }
  .topbar-right { gap: 12px; }
  .topbar-right .topbar-hide-sm { display: none; }
  .topbar-divider.topbar-hide-sm { display: none; }

  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: min(340px, 90vw);
    height: 100vh;
    height: 100dvh;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    gap: 0;
    box-shadow: -12px 0 40px rgba(0, 40, 80, 0.18);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    z-index: 1200;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(105%);
    visibility: hidden;
    pointer-events: none;
  }

  .nav-menu.active {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 22px 20px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    margin: 0;
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .mobile-nav-brand {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.05rem;
    color: #fff;
    line-height: 1.2;
    display: flex;
    align-items: center;
  }

  .mobile-nav-brand .logo-img-mobile {
    height: 44px;
    max-width: 160px;
  }

  .mobile-nav-brand span {
    display: block;
    color: var(--secondary);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
  }

  .mobile-nav-close {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.25s ease;
  }

  .mobile-nav-close:hover {
    background: rgba(255, 255, 255, 0.22);
  }

  .mobile-nav-close svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.25;
    stroke-linecap: round;
  }

  .nav-menu > li:not(.mobile-nav-header):not(.nav-cta):not(.mobile-nav-contacts) {
    margin: 0 12px;
  }

  .nav-menu > .mobile-nav-header + li {
    margin-top: 12px;
  }

  .nav-menu > .mobile-nav-contacts {
    margin-top: auto;
  }

  .nav-link {
    color: var(--text) !important;
    padding: 13px 16px;
    font-size: 0.95rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 3px solid transparent;
    background: transparent;
  }

  .nav-link::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 2px solid #cbd5e1;
    border-top: 2px solid #cbd5e1;
    transform: rotate(45deg);
    opacity: 0.7;
    flex-shrink: 0;
  }

  .nav-link:hover,
  .nav-link.active {
    background: rgba(0, 59, 115, 0.06) !important;
    color: var(--primary) !important;
    border-left-color: var(--secondary);
  }

  .nav-link.active {
    font-weight: 700;
  }

  .nav-link.active::after {
    border-color: var(--secondary);
    opacity: 1;
  }

  .mobile-nav-contacts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: auto 16px 0;
    padding: 18px 12px 8px;
    border-top: 1px solid var(--border);
  }

  .mobile-nav-contacts a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--light-gray);
    transition: color 0.25s ease, background 0.25s ease;
  }

  .mobile-nav-contacts a:hover {
    color: var(--primary);
    background: #e8eef5;
  }

  .mobile-nav-contacts svg {
    width: 16px;
    height: 16px;
    stroke: var(--secondary);
    fill: none;
    stroke-width: 1.75;
    flex-shrink: 0;
  }

  .nav-cta {
    margin: 8px 16px 24px;
    padding: 0;
  }

  .nav-cta .btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 0.95rem;
    box-shadow: 0 8px 22px rgba(245, 124, 0, 0.35);
  }

  .hamburger { display: flex; }
  .hamburger.active span { background: var(--primary) !important; }

  .header .logo-text { color: var(--white); }
  .header.scrolled .logo-text { color: var(--primary); }
  .header:not(.scrolled) .hamburger span { background: var(--white); }
  .header.scrolled .hamburger span { background: var(--primary); }

  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 30, 55, 0.55);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.nav-open .header {
    z-index: 1201;
  }

  body.nav-open .hamburger {
    z-index: 1202;
  }

  body.nav-open .topbar {
    z-index: 1190;
  }

  .hero { min-height: auto; padding: calc(var(--topbar-h) + var(--header-h) + 40px) 0 60px; }
  .hero-content {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
    width: 100%;
    max-width: 100%;
  }
  .hero-text { max-width: 100%; overflow-wrap: anywhere; }
  .hero-text p { margin-left: auto; margin-right: auto; }
  .hero-btns { justify-content: center; }
  .hero-visual {
    min-height: 360px;
    max-width: 100%;
    overflow: hidden;
  }
  .hero-glow,
  .hero-shape { display: none; }
  .floating-card { display: none !important; }
  .fc-1, .fc-2 { left: auto; right: auto; }

  .trust-bar { margin-top: -24px; overflow: hidden; }
  .trust-inner {
    grid-template-columns: repeat(2, 1fr);
    padding: 32px;
    max-width: 100%;
  }
  .trust-item:nth-child(2)::after { display: none; }

  .about-preview {
    grid-template-columns: 1fr;
    gap: 48px;
    overflow: hidden;
  }
  .about-images { overflow: hidden; max-width: 100%; }
  .about-img-float {
    right: 12px;
    bottom: -16px;
    width: 140px;
    height: 110px;
  }
  .about-badge { left: 8px; }

  .cta-banner { overflow: hidden; }
  .cta-banner::before,
  .cta-banner::after { display: none; }

  .section,
  .container,
  .container-wide {
    max-width: 100%;
  }
  .container,
  .container-wide {
    overflow-x: clip;
  }

  .services-grid { grid-template-columns: repeat(2, 1fr); }

  .why-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .why-visual { max-width: 480px; margin: 0 auto; aspect-ratio: 16/10; }

  .industries-grid { grid-template-columns: repeat(2, 1fr); }

  .process-timeline {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding-left: 20px;
  }
  .process-line {
    top: 0;
    bottom: 0;
    left: 27px;
    right: auto;
    width: 3px;
    height: auto;
  }
  .process-step {
    flex-direction: row;
    text-align: left;
    gap: 20px;
    padding-bottom: 36px;
    width: 100%;
  }
  .process-num { margin-bottom: 0; flex-shrink: 0; }
  .process-step p { max-width: none; }

  .quality-grid { grid-template-columns: repeat(2, 1fr); }

  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-item.tall { grid-row: span 1; }

  .contact-grid { grid-template-columns: 1fr; }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }

  .services-page-layout { grid-template-columns: 1fr; }
  .services-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .values-grid { grid-template-columns: repeat(2, 1fr); }
  .infra-grid { grid-template-columns: repeat(2, 1fr); }
  .machine-fleet { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .sd-capabilities { grid-template-columns: repeat(2, 1fr); }
  .sdc-meta { grid-template-columns: 1fr; }

  .founders-grid { gap: 28px; }

  .page-hero { padding: calc(var(--topbar-h) + var(--header-h) + 50px) 0 80px; }
}

/* Mobile */
@media (max-width: 768px) {
  .section { padding: 60px 0; }
  .section-header { margin-bottom: 40px; }

  .btn { padding: 12px 24px; font-size: 0.875rem; }
  .btn-lg { padding: 14px 28px; }

  .trust-inner {
    grid-template-columns: 1fr 1fr;
    padding: 24px 16px;
    gap: 8px;
  }
  .trust-item::after { display: none !important; }
  .trust-number { font-size: 1.8rem; }
  .trust-label { font-size: 0.8rem; }

  .services-grid { grid-template-columns: 1fr; gap: 20px; }
  .service-card { padding: 28px 24px; }

  .why-features { grid-template-columns: 1fr; }

  .industries-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .industry-card { padding: 28px 16px; }
  .industry-icon { width: 56px; height: 56px; }

  .quality-grid { grid-template-columns: 1fr; }

  .gallery-grid { grid-template-columns: 1fr; gap: 16px; }

  .testimonial-card { padding: 32px 24px; }
  .testimonial-card blockquote { font-size: 1rem; }

  .form-row { grid-template-columns: 1fr; }
  .contact-form-wrap { padding: 28px 20px; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .founders-grid { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: 1fr; }
  .infra-grid { grid-template-columns: 1fr; }
  .machine-fleet { grid-template-columns: 1fr; }
  .machine-fleet-img { height: 220px; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 16px; }
  .sd-capabilities { grid-template-columns: 1fr; }

  .services-sidebar { grid-template-columns: 1fr; }
  .sdc-header { flex-direction: column; text-align: center; padding: 24px; }
  .sdc-body { padding: 24px; }

  .mvv-grid { grid-template-columns: 1fr; }

  .about-img-float {
    width: 140px;
    height: 110px;
    right: 10px;
    bottom: -20px;
  }

  .hero-visual { min-height: 280px; }
  .floating-card { display: none !important; }

  .cta-banner { padding: 60px 0; }

  .sticky-cta { display: flex; }
  body { padding-bottom: 70px; }

  .float-whatsapp,
  .float-top {
    bottom: 84px;
    width: 48px;
    height: 48px;
  }
  .float-whatsapp { left: 16px; }
  .float-top { right: 16px; }

  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  .lightbox-close { top: -50px; right: 10px; }

  .page-hero { padding: calc(var(--topbar-h) + var(--header-h) + 36px) 0 70px; }
  .page-hero::after { height: 40px; }

  .topbar { font-size: 0.72rem; }
  .topbar-inner { padding: 0 16px; }
  .topbar-left .topbar-item { max-width: 42vw; }
  .topbar-right { gap: 10px; }
  .topbar-item span.topbar-label { display: none; }

  .milestone-timeline { padding-left: 32px; }
  .milestone-dot { left: -40px; width: 14px; height: 14px; }
}

/* Small Mobile */
@media (max-width: 480px) {
  .container, .container-wide { padding: 0 16px; }
  .nav { padding: 0 16px; }

  .topbar-left { display: none; }
  .topbar-right {
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
    overflow: hidden;
  }
  .topbar-item { max-width: 100%; }
  .topbar-item .topbar-label { display: inline; font-size: 0.7rem; }

  .logo-img { height: 44px; max-width: 160px; }
  .logo-text { font-size: 1.1rem; }
  .logo-text span { font-size: 0.6rem; }

  .hero-text h1 { font-size: 1.9rem; }
  .hero-visual { min-height: 220px; }
  .hero-illustration { max-width: 100%; }
  .hero-btns { flex-direction: column; align-items: stretch; }
  .hero-btns .btn { width: 100%; max-width: 100%; }

  .trust-number { font-size: 1.5rem; }

  .industries-grid { grid-template-columns: 1fr; }

  .stats-row { grid-template-columns: 1fr; }

  .gallery-filters { gap: 6px; }
  .filter-btn { padding: 8px 16px; font-size: 0.8rem; }

  .float-whatsapp,
  .float-top {
    bottom: 84px;
  }
}

/* Print */
@media print {
  .header, .hamburger, .sticky-cta, .cta-banner, .footer-social { display: none !important; }
  body { padding: 0; color: #000; }
  .section { padding: 30px 0; }
}
