/* ==========================================================================
   STELLAR PIPES - COMPREHENSIVE RESPONSIVE STYLES
   File: css/responsive.css
   Coverage: Mobile (360px-480px), Phablet (481px-600px),
             Tablet Portrait (601px-768px), Tablet Landscape (769px-1080px),
             Desktop & High-Resolution Displays (1081px+)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESKTOP SCREENS ONLY (Min Width: 1081px)
   -------------------------------------------------------------------------- */
@media (min-width: 1081px) {
  /* Strictly enforce desktop navigation and hide mobile drawer elements */
  .mobile-nav-drawer {
    display: none !important;
    visibility: hidden !important;
  }

  .menu-toggle {
    display: none !important;
  }

  .main-nav {
    display: flex !important;
  }

  .mobile-action-bar {
    display: none !important;
  }

  /* Compact spacing for 1081px - 1240px screens to prevent link wrapping */
  @media (max-width: 1240px) {
    .nav-list {
      gap: 10px;
    }

    .nav-link {
      font-size: 0.84rem;
      padding: 6px 2px;
    }

    .header-actions .btn-sm {
      padding: 8px 16px;
      font-size: 0.84rem;
    }
  }
}

/* --------------------------------------------------------------------------
   2. TABLET LANDSCAPE & SMALL LAPTOPS (Max Width: 1080px)
   Navigation switches cleanly to mobile hamburger drawer
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  /* Hide desktop horizontal menu and activate hamburger button */
  .main-nav {
    display: none !important;
  }

  .menu-toggle {
    display: flex !important;
  }

  /* Full-Height Slide-in Mobile Menu Drawer */
  .mobile-nav-drawer {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: #FFFFFF;
    z-index: 998;
    padding: 28px 24px;
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform var(--transition-normal), visibility var(--transition-normal);
    overflow-y: auto;
    border-top: 1px solid var(--line);
    box-shadow: -8px 0 24px rgba(10, 37, 64, 0.1);
  }

  .mobile-nav-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-nav-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .mobile-nav-link {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--navy);
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    transition: color var(--transition-fast);
  }

  .mobile-nav-link:hover,
  .mobile-nav-link.active {
    color: var(--blue);
  }

  .mobile-nav-footer {
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* Top announcement bar adjustments */
  .announcement-text {
    font-size: 0.8rem;
  }

  @media (max-width: 960px) {
    .announcement-right .top-phone-link {
      display: none; /* Phone is already in left banner text */
    }
  }

  /* Hero Section Single Column */
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }

  .hero-content {
    margin: 0 auto;
    max-width: 720px;
  }

  .hero-badge-group,
  .hero-cta-group {
    justify-content: center;
  }

  .hero-sub {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-visual-wrap {
    max-width: 440px;
    margin: 0 auto;
  }

  /* Responsive Grid Overrides */
  .responsive-split-grid,
  .responsive-split-grid-top,
  .rfq-layout-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .selector-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .mfg-timeline-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .reviews-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .cta-banner-box {
    flex-direction: column;
    text-align: center;
    padding: 40px 32px;
  }

  .cta-banner-content p {
    margin-left: auto;
    margin-right: auto;
  }

  .cta-banner-actions {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 32px;
  }
}

/* --------------------------------------------------------------------------
   3. TABLET PORTRAIT & MEDIUM DEVICES (Max Width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  body {
    padding-bottom: 74px; /* Space for sticky bottom mobile action bar */
  }

  .section {
    padding: var(--section-pad-mobile);
  }

  /* Hide top announcement bar on phones to preserve viewport height */
  .announcement-bar {
    display: none !important;
  }

  /* Sticky Mobile Action Bar (Bottom 4 buttons) */
  .mobile-action-bar {
    display: block !important;
  }

  /* Keep header clean with Logo + Hamburger toggle on <= 768px.
     Quote is immediately accessible on sticky bottom action bar. */
  .header-actions .btn-safety {
    display: none !important;
  }

  /* Float WhatsApp button safely above sticky mobile action bar */
  .floating-whatsapp {
    bottom: 84px !important;
    right: 16px !important;
    width: 52px !important;
    height: 52px !important;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
  }

  .floating-whatsapp svg {
    width: 28px;
    height: 28px;
  }

  /* Trust strip metrics 2x2 grid */
  .trust-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .metric-item {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 12px 6px;
  }

  .metric-item:nth-child(3),
  .metric-item:nth-child(4) {
    border-bottom: none;
  }

  .metric-num {
    font-size: 2.3rem;
  }

  /* Application Highlights */
  .app-highlight-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 20px;
  }

  /* Gallery Grid */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  /* Reviews & Testimonials */
  .reviews-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

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

  /* Form & Modal */
  .form-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .modal-card {
    padding: 24px 18px;
    max-height: 90vh;
  }

  .cta-banner-actions {
    flex-direction: column;
    width: 100%;
  }

  .cta-banner-actions .btn {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   4. PHABLETS & LARGE SMARTPHONES (Max Width: 600px)
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .mfg-timeline-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

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

  .gallery-item {
    height: 220px;
  }

  .about-stats-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .responsive-auto-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 24px 18px !important;
    max-width: 100%;
    min-width: 0;
  }

  .product-item-wrap {
    min-width: 0;
    max-width: 100%;
  }

  .product-real-showcase {
    flex-direction: column;
    align-items: stretch !important;
  }

  .product-real-showcase > div {
    flex: 1 1 auto !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .app-tab-btn {
    font-size: 0.85rem;
    padding: 9px 16px;
  }
}

/* --------------------------------------------------------------------------
   5. STANDARD & SMALL SMARTPHONES (Max Width: 480px)
   Optimized for 360px - 480px viewports (Galaxy S, iPhones, Pixels)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .card {
    padding: 20px 14px !important;
  }

  .btn {
    white-space: normal !important;
    text-align: center;
    max-width: 100%;
  }

  .radio-group-wrap {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  /* Header Brand & Layout */
  .brand-name {
    font-size: 1.15rem;
  }

  .brand-tagline {
    font-size: 0.65rem;
  }

  .logo-icon-svg {
    width: 36px;
    height: 36px;
  }

  /* Hide header quote button on phones to give Logo & Hamburger breathing room.
     User has the sticky mobile action bar 'Quote' button at all times. */
  .header-actions .btn-safety {
    display: none !important;
  }

  /* Hero Typography & CTAs */
  .hero-title {
    font-size: clamp(1.75rem, 6.8vw, 2.1rem);
    line-height: 1.22;
  }

  .hero-chip-group {
    gap: 6px;
  }

  .hero-chip {
    font-size: 0.76rem;
    padding: 5px 10px;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .hero-cta-group .btn {
    width: 100%;
    justify-content: center;
  }

  /* Product Card Actions */
  .product-card-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

  /* Manufacturing Timeline */
  .mfg-timeline-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .timeline-step {
    padding: 16px 14px;
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 14px;
  }

  .timeline-step .step-num {
    margin: 0;
    flex-shrink: 0;
  }

  /* Selector Tool */
  .selector-tool-box {
    padding: 20px 14px;
  }

  .selector-result-card {
    padding: 18px 14px;
  }

  .result-rec-title {
    font-size: 1.2rem;
  }

  /* Map Container Height on Small Screens */
  .factory-visit-map-wrap {
    height: 260px !important;
  }

  /* Modal Card */
  .modal-card {
    padding: 20px 14px;
    border-radius: var(--radius);
  }

  .modal-title {
    font-size: 1.3rem;
  }

  /* Sticky Mobile Action Bar Item Sizing */
  .mobile-action-btn {
    font-size: 0.68rem;
    padding: 5px 2px;
  }

  .mobile-action-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* --------------------------------------------------------------------------
   6. TAMIL LANGUAGE ADJUSTMENTS (All Screen Sizes)
   -------------------------------------------------------------------------- */
body.tamil-lang .nav-list {
  gap: 8px;
}

body.tamil-lang .nav-link {
  font-size: 0.81rem;
  padding: 6px 2px;
  letter-spacing: 0;
}

body.tamil-lang .header-actions .btn-sm {
  padding: 8px 14px;
  font-size: 0.82rem;
}

body.tamil-lang .mobile-nav-link {
  font-size: 1.1rem;
}

body.tamil-lang .mobile-action-btn {
  font-size: 0.65rem;
}

/* Hide floating WhatsApp button when mobile drawer is open */
body:has(.mobile-nav-drawer.is-open) .floating-whatsapp {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
