/* ==========================================================================
   MISHREE ENGINEERS / ROLLER MFG - RESPONSIVE & ADAPTIVE STYLES
   File: assets/css/responsive.css
   Tested Viewports: 1440px, 1024px, 768px, 390px, 360px
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. LAPTOPS & DESKTOPS (< 1200px)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  :root {
    --container-max: 1080px;
  }

  .nav-menu {
    gap: 1.25rem;
  }

  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    gap: 2rem;
  }
}

/* --------------------------------------------------------------------------
   2. TABLETS & SMALL LAPTOPS (< 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .nav-menu,
  .nav-cta-group {
    display: none;
  }

  .mobile-nav-toggle {
    display: flex;
  }

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

  .hero-visual-card {
    max-width: 600px;
    margin: 0 auto;
  }

  .product-detail-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .product-gallery {
    position: static;
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }

  .cta-banner-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-search-box {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   3. TABLETS PORTRAIT (< 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  :root {
    --container-pad: 1.15rem;
  }

  .topbar {
    display: none; /* Hide topbar on mobile to save vertical viewport real estate */
  }

  .nav-container {
    height: 70px;
  }

  .brand-logo img {
    height: 44px;
  }

  .hero-home {
    padding: 3rem 0;
  }

  .hero-trust-indicators {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .hero-ctas {
    flex-direction: column;
    width: 100%;
  }

  .hero-ctas .btn {
    width: 100%;
  }

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

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

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

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-steel-100);
    border-radius: var(--radius-md);
  }

  .specs-table th {
    width: 45%;
  }

  .back-to-top {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 44px;
    height: 44px;
  }
}

/* --------------------------------------------------------------------------
   4. NARROW MOBILE (360px - 390px)
   -------------------------------------------------------------------------- */
@media (max-width: 390px) {
  :root {
    --container-pad: 0.95rem;
  }

  .brand-logo img {
    height: 38px;
  }

  .hero-content h1 {
    font-size: 1.75rem;
  }

  .product-card-body {
    padding: 1.15rem;
  }

  .product-card-title {
    font-size: 1.15rem;
  }

  .product-card-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .product-card-footer .btn {
    width: 100%;
  }

  .btn {
    padding: 0.75rem 1.15rem;
    font-size: 0.875rem;
  }

  .faq-header {
    padding: 1rem 1.15rem;
    font-size: 0.95rem;
  }

  .faq-body {
    padding: 0 1.15rem;
  }

  .faq-item.active .faq-body {
    padding: 0 1.15rem 1rem 1.15rem;
  }
}

/* --------------------------------------------------------------------------
   4b. HEADER, BREADCRUMB BANNER & SUB-PAGE LAYOUT
   -------------------------------------------------------------------------- */
/* Nav labels never wrap; below 1240px the full menu would crowd the logo and
   quote button, so the hamburger drawer takes over. */
.nav-link {
  white-space: nowrap;
}

@media (max-width: 1239px) {
  .nav-menu {
    display: none;
  }

  .mobile-nav-toggle {
    display: flex;
  }
}

@media (min-width: 1024px) and (max-width: 1239px) {
  .nav-cta-group {
    margin-left: auto;
    margin-right: 0.85rem;
  }
}

/* Drawer follows the real visible viewport on mobile browsers */
@supports (height: 100dvh) {
  .mobile-menu-drawer {
    height: 100dvh;
  }
}

@media (max-width: 1023px) {
  .subpage-hero .text-lead {
    max-width: 100%;
  }

  .process-steps {
    max-width: 100%;
  }
}

@media (max-width: 767px) {
  .btn {
    white-space: normal;
    text-align: center;
  }

  .subpage-hero {
    padding: 2.25rem 0 2.5rem;
  }

  .subpage-hero h1 {
    font-size: clamp(1.65rem, 7.2vw, 2rem);
  }

  .subpage-hero .text-lead {
    font-size: 1rem;
  }

  .breadcrumbs {
    font-size: 0.8rem;
    margin-bottom: 0.7rem;
  }

  .subpage-hero .badge-tag {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
  }

  .subpage-hero-actions {
    flex-direction: column;
    margin-top: 1.5rem;
  }

  .subpage-hero-actions .btn,
  .section--accent-bg .btn {
    width: 100%;
  }

  .card {
    padding: 1.25rem;
  }

  .process-step {
    flex-direction: column;
    gap: 0.85rem;
  }

  .form-card {
    padding: 1.25rem;
  }

  .map-container {
    height: 320px !important;
  }

  .spec-table th,
  .spec-table td {
    padding: 0.6rem 0.7rem;
    font-size: 0.85rem;
  }

  .spec-table tbody th {
    width: 42%;
  }

  .faq-header {
    padding: 1rem 1.15rem;
    font-size: 0.975rem;
  }

  .faq-body {
    padding: 0 1.15rem;
  }

  .faq-item.active .faq-body {
    padding: 0 1.15rem 1.15rem 1.15rem;
  }

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

@media (max-width: 390px) {
  .subpage-hero .badge-tag {
    white-space: normal;
  }

  .blog-card-body {
    padding: 1.15rem;
  }
}

/* --------------------------------------------------------------------------
   5. REDUCED MOTION PREFERENCES
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   6. HIGH CONTRAST & PRINT MEDIA
   -------------------------------------------------------------------------- */
@media print {
  .header,
  .topbar,
  .footer,
  .back-to-top,
  .btn,
  .filter-bar,
  .faq-header {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .product-card,
  .article-container {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}
