/* ─── LARGE DESKTOP (1400px+) ────────────────────────────── */
@media (min-width: 1400px) {
  .container-rsl {
    max-width: 1400px;
  }
}

/* ─── DESKTOP (1200px - 1399px) ──────────────────────────── */
@media (max-width: 1199px) {
  :root {
    --section-py: 80px;
  }

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

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
  }

  .footer-grid > *:last-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

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

  .stat-item:first-child {
    border-radius: var(--radius-lg) 0 0 0;
  }
  .stat-item:nth-child(2) {
    border-radius: 0 var(--radius-lg) 0 0;
  }
  .stat-item:nth-child(3) {
    border-radius: 0 0 0 var(--radius-lg);
  }
  .stat-item:last-child {
    border-radius: 0 0 var(--radius-lg) 0;
  }

  .about-img-badge {
    right: 16px;
    bottom: 16px;
  }

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

  .why-us-floating-card.card-1 {
    left: -16px;
  }
  .why-us-floating-card.card-2 {
    right: -16px;
  }

  .service-full-card {
    grid-template-columns: 180px 1fr;
  }
}

/* ─── TABLET (768px - 991px) ─────────────────────────────── */
@media (max-width: 991px) {
  .core-values-grid {
    grid-template-columns: 1fr !important; /* Drops to a single, full-width column layout */
    gap: 20px !important; /* Optimizes vertical breathing room between rows */
  }
  :root {
    --section-py: 64px;
    --section-py-sm: 48px;
  }
  @media (max-width: 991px) {
    /* Forces the mobile side panel to be hidden on the right by default */
    .mobile-nav {
      position: fixed !important;
      top: 0 !important;
      right: -100% !important;
      width: min(300px, 80vw) !important;
      height: 100vh !important;
      z-index: 9999 !important;
      transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
  }
  /* Navbar */
  .navbar-nav,
  .navbar-cta {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  /* Hero */
  .hero-stats {
    position: relative;
    bottom: auto;
    right: auto;
    margin-top: 40px;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hero-stat-card:first-child,
  .hero-stat-card:last-child {
    border-radius: var(--radius-md);
  }

  /* About */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-img-main {
    height: 380px;
  }

  .about-img-badge {
    right: 24px;
  }

  .about-content {
    padding-left: 0;
  }

  /* Services */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* Why Us */
  .why-us-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .why-us-visual {
    order: -1;
  }

  .why-us-img {
    height: 380px;
  }

  .why-us-floating-card {
    display: none;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Industries */
  .industries-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Testimonials */
  .testimonial-card {
    min-width: 320px;
    max-width: 320px;
  }

  /* Fleet */
  .fleet-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .fleet-item:first-child {
    border-radius: var(--radius-lg) 0 0 0;
  }
  .fleet-item:nth-child(2) {
    border-radius: 0 var(--radius-lg) 0 0;
  }
  .fleet-item:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    grid-column: 1 / -1;
  }

  .fleet-item img {
    height: 240px;
  }

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

  .footer-grid > *:first-child {
    grid-column: 1 / -1;
  }

  /* CTA Banner */
  .cta-banner-inner {
    flex-direction: column;
    text-align: center;
  }

  .cta-banner-actions {
    justify-content: center;
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-info-card {
    position: relative;
    top: auto;
  }

  /* Services page */
  .services-full-grid {
    grid-template-columns: 1fr;
  }

  .service-full-card {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .service-full-img {
    height: 200px;
    width: 100%;
  }

  /* Service detail */
  .service-detail-grid {
    grid-template-columns: 1fr;
  }

  .service-sidebar {
    position: relative;
    top: auto;
    order: -1;
  }

  /* About */
  .mission-vision-grid {
    grid-template-columns: 1fr;
  }

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

  /* About highlights */
  .about-highlights {
    grid-template-columns: 1fr;
  }
}

/* ─── MOBILE (576px - 767px) ─────────────────────────────── */
@media (max-width: 767px) {
  /* ─── SERVICES CARGO TYPES 2X3 MOBILE GRID ──────────────── */
  .cargo-types-grid {
    display: grid !important;
    grid-template-columns: repeat(
      2,
      1fr
    ) !important; /* Perfectly builds a 2-column layout width balance */
    gap: 12px !important; /* Clean spacing margins between rows and columns */
  }

  .cargo-types-grid > div {
    min-width: 0 !important; /* Bypasses the inline 160px restriction so cards scale down evenly */
    width: 100% !important; /* Forces every box cell container to fill 100% of its grid split */
    padding: 20px 12px !important; /* Optimizes internal breathing padding spaces on smaller viewports */
  }
  :root {
    --section-py: 56px;
    --section-py-sm: 40px;
  }

  /* Container */
  .container-rsl {
    padding: 0 16px;
  }

  /* Typography */
  .display-xl {
    font-size: clamp(2.2rem, 8vw, 3rem);
  }
  .display-lg {
    font-size: clamp(1.8rem, 6vw, 2.4rem);
  }
  .display-md {
    font-size: clamp(1.5rem, 5vw, 1.9rem);
  }

  /* Navbar */
  .navbar-inner {
    padding: 0 16px;
  }

  .navbar-brand-text {
    display: none;
  }

  /* Hero */
  .hero-content {
    padding-top: 140px;
  }

  /* Fixes the Visakhapatnam box so it stays strictly on one line */
  .hero-eyebrow {
    white-space: nowrap !important;
    font-size: clamp(0.55rem, 2.5vw, 0.7rem) !important;
    letter-spacing: 0.12em !important;
    padding: 6px 14px !important;
  }

  /* Lowers the fluid baseline size so long text doesn't cut off on the right edge */
  .hero-title {
    font-size: clamp(1.7rem, 7.8vw, 2.7rem) !important;
  }

  /* Forces the top stats into a perfect 2x2 grid matching the bottom stats */
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 2px;
    margin-bottom: 48px; /* Adds the blue breathing room before the ticker */
  }

  .hero-stat-card {
    padding: 24px 16px;
  }

  /* Perfectly rounds only the outer corners of the new 2x2 grid */
  .hero-stat-card:first-child {
    border-radius: var(--radius-md) 0 0 0;
  }
  .hero-stat-card:nth-child(2) {
    border-radius: 0 var(--radius-md) 0 0;
  }
  .hero-stat-card:nth-child(3) {
    border-radius: 0 0 0 var(--radius-md);
  }
  .hero-stat-card:last-child {
    border-radius: 0 0 var(--radius-md) 0;
  }

  .stat-number {
    font-size: 1.4rem;
  }

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

  .service-card {
    padding: 28px 24px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    width: 100% !important;
    gap: 4px !important;
  }

  .stat-item {
    padding: 24px 12px !important;
    box-sizing: border-box !important;
  }

  .stat-count {
    font-size: clamp(1.6rem, 6.5vw, 2.2rem) !important;
    line-height: 1 !important;
    margin-bottom: 6px !important;
  }

  .stat-item-label {
    font-size: 0.65rem !important;
    letter-spacing: 0.06em !important;
    line-height: 1.4 !important;
    white-space: normal !important;
  }

  .stat-item:first-child {
    border-radius: var(--radius-md) 0 0 0;
  }
  .stat-item:nth-child(2) {
    border-radius: 0 var(--radius-md) 0 0;
  }
  .stat-item:nth-child(3) {
    border-radius: 0 0 0 var(--radius-md);
  }
  .stat-item:last-child {
    border-radius: 0 0 var(--radius-md) 0;
  }

  /* Industries */
  .industries-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Testimonials */
  .testimonial-card {
    min-width: calc(100vw - 48px);
    max-width: calc(100vw - 48px);
  }

  /* Fleet */
  .fleet-grid {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .fleet-item:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .fleet-item:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    grid-column: auto;
  }
  .fleet-item:nth-child(2) {
    border-radius: 0;
  }

  .fleet-item img {
    height: 220px;
  }

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

  /* Reset the 3-column desktop rule so it stacks normally on phones */
  .footer-grid > *:last-child {
    grid-column: auto;
    display: block;
  }

  .footer-desc {
    max-width: 100%;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  /* About */
  .about-img-badge {
    right: 8px;
    bottom: 8px;
    padding: 14px 16px;
  }

  .badge-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  /* CTA Banner */
  .cta-banner-inner {
    gap: 28px;
  }

  /* Contact */
  .form-row {
    grid-template-columns: 1fr;
  }

  .contact-form-card {
    padding: 28px 20px;
  }

  /* Buttons */
  .btn-lg {
    padding: 15px 32px;
    font-size: 0.85rem;
  }

  /* Hero CTAs & Pills Fix */
  .hero-action-area {
    width: 100%;
  }

  .hero-cta-group {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

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

  /* Stacks and centers the pills without stretching them */
  .hero-trust-pills {
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0 auto;
  }

  .trust-pill {
    flex: none; /* Stops the pill from stretching to the edges */
    width: 240px; /* Locks them to a uniform, compact size */
    max-width: 100%;
    justify-content: center;
  }

  /* Teams */
  .team-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── SMALL MOBILE (max 480px) ───────────────────────────── */
@media (max-width: 480px) {
  .industries-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-highlights {
    grid-template-columns: 1fr;
  }

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

  .page-hero {
    padding: 120px 0 60px;
  }
  .page-hero-title {
    font-size: clamp(1.8rem, 7vw, 2.4rem);
  }
}

/* ─── ULTRAWIDE (1600px+) ────────────────────────────────── */
@media (min-width: 1600px) {
  .container-rsl {
    max-width: 1500px;
  }

  :root {
    --section-py: 120px;
  }

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

/* ─── PRINT ──────────────────────────────────────────────── */
@media print {
  .navbar-rsl,
  #backToTop,
  #preloader,
  .mobile-nav,
  .mobile-nav-overlay,
  .ticker-section {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .container-rsl {
    max-width: 100%;
  }

  #hero {
    min-height: auto;
    padding: 40px 0;
    background: none;
  }

  .hero-bg,
  .hero-overlay,
  .hero-overlay-grid {
    display: none;
  }

  .hero-title,
  .hero-subtitle {
    color: black;
  }
}

/* ─── REDUCED MOTION ACCESSIBILITY ──────────────────────────*/
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-bg {
    transform: none !important;
  }
  .ticker-inner {
    animation: none;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ─── HIGH CONTRAST MODE ─────────────────────────────────── */
@media (prefers-contrast: high) {
  :root {
    --glass-white: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.5);
  }
}

/* ─── MOBILE SWIPEABLE COMPONENT BUTTONS ─────────────────── */
@media (max-width: 767px) {
  .services-swipe-ribbon {
    display: flex !important;
    flex-wrap: nowrap !important; /* Blocks buttons from dropping to multi-lines */
    overflow-x: auto !important; /* Unlocks mobile sliding touch track scrolling */
    justify-content: flex-start !important; /* Starts scroll layout strictly from first choice left edge */
    -webkit-overflow-scrolling: touch !important; /* Ensures smooth touch physics scroll on devices */

    padding: 10px 16px !important; /* Adds edge breathing room buffer */
    gap: 12px !important; /* Cleaner gap alignment spacing */

    /* Suppress mobile trackbars while maintaining swipe engine */
    scrollbar-width: none !important; /* Firefox layout support */
  }

  /* Suppress browser trackbar lines for Chrome, Safari, and new Edge builds */
  .services-swipe-ribbon::-webkit-scrollbar {
    display: none !important;
  }

  /* Forces ALL standard option tabs inside to stay completely equal in size */
  .services-swipe-ribbon a {
    flex: 0 0 180px !important; /* Fixed rigid sizing prevents cards from warping or shrinking */
    text-align: center !important;
    white-space: nowrap !important; /* Locks your title descriptions strictly on a single line */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}
