/**
 * TransBridge Logistics Pakistan (Pvt.) Ltd.
 * Master Mobile Responsive Stylesheet
 * 
 * Strict Intent:
 * 1. Mobile Header: fits screen width, proportional logo, collapsed hamburger navigation.
 * 2. Mobile Header: Hide 'CONTACT US' and 'GET A QUOTE' buttons.
 * 3. Mobile Header: Hide utility top bar to eliminate clutter.
 * 4. Floating Action: Exactly ONE WhatsApp floating button (no secondary chat/call button).
 * 5. Floating Position: Safe area-aware bottom-right corner.
 * 6. Hero Section: Mobile-first rebuild, readable dark overlay, no cramping.
 * 7. Hero CTAs: Clean primary Get a Quote CTA; no duplicate contact buttons.
 * 8. Responsive Typography: Dynamic scaling for H1, H2, H3, body, and buttons.
 * 9. Responsive Spacing: Balanced mobile margins, padding, and gaps.
 * 10. Images: Aspect ratio maintained, no horizontal overflow.
 * 11. Cards/Grids: Multi-column layouts cleanly collapse to 1-column (or 2-column where appropriate).
 * 12. Breakpoints tested: 320px, 360px, 375px, 390px, 414px, 430px, 768px.
 */

/* ==================================================
   GLOBAL OVERFLOW & VIEWPORT SAFEGUARDS
   ================================================== */
html, body {
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100vw;
  position: relative;
  -webkit-text-size-adjust: 100%;
}

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

img, video, canvas {
  max-width: 100%;
  height: auto;
}

svg {
  box-sizing: content-box;
}

table {
  max-width: 100%;
}

/* ==================================================
   1. LAPTOPS & TABLETS LANDSCAPE (<= 1024px)
   ================================================== */
@media (max-width: 1024px) {
  :root {
    --header-height: 70px;
  }

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

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

  .trust-strip-item:nth-child(4) {
    border-right: none;
  }

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

  .process-timeline::before {
    display: none;
  }

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

  .split-layout {
    gap: 36px;
  }

  .cta-banner .container {
    flex-direction: column;
    text-align: center;
    gap: 28px;
  }

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

/* ==================================================
   2. MOBILE / TABLET HEADER & NAVIGATION (<= 1279px)
   - Desktop nav switches to the hamburger drawer below 1280px so the
     full 10-item nav + complete company name + primary CTA always fit
     without overflow at every width
   - Keep top utility bar visible on mobile: Location (Karachi Head Office) & Timing (Mon-Fri 9:30 AM to 5:30 PM PST)
   - Sticky header system: Top bar sticks at top: 0, Header sticks at top: var(--topbar-height)
   - Hide header CTA buttons (clean minimalist mobile header)
   - Proportional logo and touch-friendly hamburger menu toggle
   ================================================== */
@media (max-width: 1279px) {
  :root {
    --header-height: 62px;
    --topbar-height: 32px;
  }

  /* MANDATORY USER INTENT:
     Do NOT hide the top-bar on phone/Android. Keep Location & Timing visible */
  .top-bar {
    display: block !important;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 920 !important;
    height: var(--topbar-height);
    background-color: var(--color-primary-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    overflow: hidden;
  }

  .top-bar .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px;
  }

  .top-bar-left {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    white-space: nowrap;
  }

  .top-bar-left::-webkit-scrollbar {
    display: none;
  }

  .top-bar-item {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    font-size: 0.71875rem;
    font-weight: 500;
    color: #e2e8f0;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .top-bar-item svg {
    width: 13px;
    height: 13px;
    color: var(--color-primary-red);
    flex-shrink: 0;
  }

  /* Hide duplicate right-side items on mobile top-bar so location & timing fit cleanly */
  .top-bar-right {
    display: none !important;
  }

  /* Sticky Mobile Header directly below Top Bar */
  .site-header {
    height: var(--header-height);
    background-color: #ffffff;
    border-bottom: 1px solid var(--color-border);
    position: sticky !important;
    top: var(--topbar-height) !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 910 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }

  .header-inner {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0;
  }

  /* Proportional Mobile Logo */
  .brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    max-width: calc(100% - 56px); /* Ensure room for hamburger toggle */
    min-width: 0;
  }

  .brand-logo-img {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    object-fit: contain;
  }

  .brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
  }

  .brand-title {
    font-size: 1.3125rem;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: var(--color-primary-navy);
    white-space: nowrap;
  }

  .brand-title span {
    color: var(--color-primary-accent);
  }

  .brand-subtitle {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    color: var(--color-primary-blue);
    white-space: nowrap;
    line-height: 1.25;
    margin-top: 2px;
  }

  /* Hide Desktop Nav Bar */
  .main-nav {
    display: none !important;
  }

  /* MANDATORY REQUIREMENTS 2 & 3:
     Hide "CONTACT US" and "GET A QUOTE" header buttons on mobile */
  .header-actions {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
  }

  .header-actions .btn,
  .header-actions a.btn {
    display: none !important;
  }

  /* Hamburger Menu Button */
  .mobile-nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--color-primary-navy);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
  }

  .mobile-nav-toggle:active,
  .mobile-nav-toggle:focus-visible {
    background-color: var(--color-bg-alt);
    color: var(--color-primary-accent);
  }

  .mobile-nav-toggle svg {
    width: 26px;
    height: 26px;
    stroke-width: 2.2;
  }
}

/* ==================================================
   3. TABLETS PORTRAIT & MOBILE (<= 768px)
   ================================================== */
@media (max-width: 768px) {
  /* Container Padding */
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Section Spacing */
  .section {
    padding: 44px 0;
  }

  .section-header {
    margin-bottom: 28px;
    text-align: left;
  }

  /* Typography Scaling */
  .section-subtitle {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
  }

  .section-title {
    font-size: clamp(1.375rem, 5vw, 1.75rem);
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
    word-break: normal;
  }

  .section-desc {
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 16px;
  }

  /* ==================================================
     HERO SECTION REBUILD (REQUIREMENTS 6 & 7)
     - High-contrast, mobile-optimized gradient overlay
     - Fluid typography
     - Single primary Get a Quote CTA
     - No duplicate Contact Us or WhatsApp inside hero
     ================================================== */
  .page-hero {
    padding: 40px 0 46px;
    position: relative;
    text-align: left;
  }

  .page-hero::before {
    background-image: 
      linear-gradient(180deg, rgba(7, 21, 39, 0.95) 0%, rgba(11, 31, 58, 0.92) 50%, rgba(7, 21, 39, 0.97) 100%),
      url('/assets/images/home/transbridge-sea-freight-container-vessel.jpg') !important;
    background-position: center 30% !important;
    background-size: cover !important;
  }

  .page-hero.hero-sea::before {
    background-image: linear-gradient(180deg, rgba(7, 21, 39, 0.95) 0%, rgba(11, 31, 58, 0.92) 50%, rgba(7, 21, 39, 0.97) 100%),
      url('/assets/images/services/transbridge-sea-freight-hero.jpg') !important;
  }

  .page-hero.hero-air::before {
    background-image: linear-gradient(180deg, rgba(7, 21, 39, 0.95) 0%, rgba(11, 31, 58, 0.92) 50%, rgba(7, 21, 39, 0.97) 100%),
      url('/assets/images/services/transbridge-air-freight-cargo-aircraft.jpg') !important;
  }

  .page-hero.hero-project::before {
    background-image: linear-gradient(180deg, rgba(7, 21, 39, 0.95) 0%, rgba(11, 31, 58, 0.92) 50%, rgba(7, 21, 39, 0.97) 100%),
      url('/assets/images/services/transbridge-project-cargo-heavy-lift.jpg') !important;
  }

  .page-hero.hero-warehouse::before {
    background-image: linear-gradient(180deg, rgba(7, 21, 39, 0.95) 0%, rgba(11, 31, 58, 0.92) 50%, rgba(7, 21, 39, 0.97) 100%),
      url('/assets/images/services/transbridge-warehousing-distribution-facility.jpg') !important;
  }

  .page-hero.hero-customs::before {
    background-image: linear-gradient(180deg, rgba(7, 21, 39, 0.95) 0%, rgba(11, 31, 58, 0.92) 50%, rgba(7, 21, 39, 0.97) 100%),
      url('/assets/images/services/transbridge-customs-trade-inspection.jpg') !important;
  }

  .page-hero-content {
    max-width: 100%;
  }

  .badge {
    font-size: 0.6875rem;
    padding: 4px 10px;
    margin-bottom: 12px;
    line-height: 1.3;
    white-space: normal;
    display: inline-block;
  }

  .page-title {
    font-size: clamp(1.625rem, 5.8vw, 2.125rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin-bottom: 14px;
    word-break: normal;
  }

  .page-lead {
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 22px;
    color: #cbd5e1;
  }

  /* Hero Button Hierarchy on Mobile */
  .hero-cta-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }

  .hero-cta-group .btn-primary {
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: var(--radius-sm);
  }

  /* Hide duplicate in-hero contact & whatsapp on mobile */
  .hero-cta-group .btn-outline-white,
  .hero-cta-group .btn-whatsapp {
    display: none !important;
  }

  /* Page Header (Subpages) */
  .page-header {
    padding: 36px 0 40px;
  }

  .page-header-title {
    font-size: clamp(1.5rem, 5vw, 2rem);
    line-height: 1.2;
  }

  .page-header-desc {
    font-size: 0.9375rem;
    line-height: 1.6;
  }

  /* ==================================================
     4 & 5. SINGLE WHATSAPP FLOATING BUTTON
     - Remove secondary chat buttons completely
     - Safe area aware bottom-right position
     ================================================== */
  .floating-actions-container,
  .float-btn-call,
  .float-tooltip {
    display: none !important;
  }

  .floating-whatsapp {
    width: 52px !important;
    height: 52px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: fixed !important;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    right: calc(18px + env(safe-area-inset-right, 0px)) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(37, 211, 102, 0.45) !important;
    z-index: 999 !important;
    border: none !important;
  }

  .floating-whatsapp .floating-whatsapp-label,
  .floating-whatsapp span {
    display: none !important;
  }

  .floating-whatsapp svg {
    width: 28px !important;
    height: 28px !important;
    fill: currentColor !important;
    margin: 0 !important;
  }

  /* ==================================================
     11. RESPONSIVE GRIDS COLLAPSE
     ================================================== */
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .split-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .split-image-wrap {
    height: 220px;
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .split-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Cards & Boxes */
  .service-card {
    padding: 0;
  }

  .service-card-body {
    padding: 20px 18px;
  }

  .service-card-title {
    font-size: 1.125rem;
    line-height: 1.3;
    margin-bottom: 8px;
  }

  .service-card-desc {
    font-size: 0.875rem;
    line-height: 1.6;
  }

  .service-card-media {
    height: 175px;
    width: 100%;
  }

  .service-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Trust Strip Grid: 2 Columns on Mobile with clean borders */
  .trust-strip-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-strip-item {
    padding: 14px 10px;
    font-size: 0.75rem;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
  }

  .trust-strip-item:nth-child(2n) {
    border-right: none;
  }

  .trust-strip-item:nth-last-child(1),
  .trust-strip-item:nth-last-child(2) {
    border-bottom: none;
  }

  /* Process Timeline: 1-Column Sequential on Mobile */
  .process-timeline {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .process-step {
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .step-number {
    font-size: 1.25rem;
    margin-bottom: 4px;
  }

  .step-title {
    font-size: 1.0625rem;
  }

  .step-desc {
    font-size: 0.875rem;
    line-height: 1.55;
  }

  /* FAQ Items */
  .faq-accordion {
    gap: 10px;
  }

  .faq-question {
    padding: 16px 18px;
    font-size: 0.9375rem;
    line-height: 1.4;
  }

  .faq-answer {
    padding: 0 18px 18px;
    font-size: 0.875rem;
    line-height: 1.6;
  }

  /* CTA Banner */
  .cta-banner {
    padding: 44px 0;
  }

  .cta-title {
    font-size: clamp(1.375rem, 5vw, 1.75rem);
    line-height: 1.25;
    margin-bottom: 10px;
  }

  .cta-desc {
    font-size: 0.9375rem;
    line-height: 1.6;
  }

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

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

  /* Forms & Interactive Controls */
  .form-row, .form-row-3 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .form-input, .form-select, .form-textarea {
    font-size: 1rem; /* Prevents auto-zoom on iOS Safari */
    min-height: 44px;
    padding: 10px 14px;
  }

  .form-textarea {
    min-height: 96px;
  }

  .btn {
    min-height: 44px;
    font-size: 0.9375rem;
  }

  .quote-form-container {
    padding: 20px 16px;
  }

  /* Footer */
  .site-footer {
    padding: 48px 0 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: 36px;
  }

  .footer-col-title {
    margin-bottom: 14px;
    font-size: 0.875rem;
  }

  .footer-links {
    gap: 8px;
  }

  .footer-links a {
    padding: 4px 0;
    display: inline-block;
  }

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

  .footer-bottom-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
  }

  /* Trade Lanes */
  .trade-lane-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px;
  }

  .trade-modes {
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* ==================================================
   4. SMALL MOBILE SCREENS (<= 480px)
   ================================================== */
@media (max-width: 480px) {
  :root {
    --header-height: 58px;
    --topbar-height: 28px;
  }

  .top-bar {
    height: var(--topbar-height);
  }

  .top-bar .container {
    padding-left: 8px;
    padding-right: 8px;
  }

  .top-bar-left {
    gap: 8px;
  }

  .top-bar-item {
    font-size: 0.65625rem;
    gap: 4px;
  }

  .top-bar-item svg {
    width: 11px;
    height: 11px;
  }

  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .section {
    padding: 38px 0;
  }

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

  .brand-title {
    font-size: 1.1875rem;
  }

  .brand-subtitle {
    font-size: 0.625rem;
    letter-spacing: 0.035em;
  }

  .page-title {
    font-size: clamp(1.5rem, 6vw, 1.875rem);
  }

  .page-hero {
    padding: 36px 0 40px;
  }

  .service-card-body {
    padding: 16px 14px;
  }

  .modal-container {
    padding: 24px 18px;
    max-width: 95%;
  }
}

/* ==================================================
   5. ULTRA-COMPACT MOBILE (320px - 375px)
   - Tested for iPhone SE, Galaxy Fold outer, etc.
   ================================================== */
@media (max-width: 375px) {
  :root {
    --header-height: 54px;
    --topbar-height: 26px;
  }

  .top-bar {
    height: var(--topbar-height);
  }

  .top-bar .container {
    padding-left: 6px;
    padding-right: 6px;
  }

  .top-bar-left {
    gap: 6px;
  }

  .top-bar-item {
    font-size: 0.59375rem;
    gap: 3px;
  }

  .top-bar-item svg {
    width: 10px;
    height: 10px;
  }

  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .brand-logo {
    gap: 8px;
  }

  .brand-logo-img {
    width: 34px;
    height: 34px;
  }

  .brand-title {
    font-size: 1.125rem;
  }

  .brand-subtitle {
    font-size: 0.625rem;
    letter-spacing: 0.03em;
  }

  .footer-brand .brand-title {
    font-size: 1rem;
  }

  .footer-brand .brand-subtitle {
    font-size: 0.5625rem;
    letter-spacing: 0.02em;
  }

  .mobile-nav-toggle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .mobile-nav-toggle svg {
    width: 22px;
    height: 22px;
  }

  .page-title {
    font-size: 1.4375rem;
  }

  .page-lead {
    font-size: 0.875rem;
  }

  .floating-whatsapp {
    width: 48px !important;
    height: 48px !important;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    right: calc(14px + env(safe-area-inset-right, 0px)) !important;
  }

  .floating-whatsapp svg {
    width: 24px !important;
    height: 24px !important;
  }
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS FOR REDESIGNED QUOTATION & CONTACT
   ========================================================================== */
@media (max-width: 991px) {
  .split-layout {
    flex-direction: column !important;
    gap: 32px !important;
  }
  .split-layout > div {
    width: 100% !important;
    flex: 1 1 100% !important;
  }
  .contact-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .checkbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .quote-form-card {
    padding: 24px 20px !important;
  }
  .form-actions-dual {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .btn-action-email,
  .btn-action-whatsapp {
    height: 48px;
    font-size: 0.875rem;
  }
  .contact-company-header-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 24px;
    gap: 20px;
  }
  .company-official-name {
    font-size: 1.375rem;
  }
  .contact-cards-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .location-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .contact-location-card {
    padding: 28px 20px;
  }
  .location-map-frame {
    height: 240px;
  }
  .contact-quote-cta-banner {
    flex-direction: column;
    text-align: center;
    padding: 32px 24px;
    gap: 24px;
  }
  .contact-quote-cta-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .quote-form-card {
    padding: 20px 16px !important;
  }
  .checkbox-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .checkbox-card {
    padding: 10px 12px;
    font-size: 0.8125rem;
  }
  .form-control {
    height: 44px;
    padding: 8px 12px;
    font-size: 0.875rem;
  }
  select.form-control {
    background-position: right 10px center;
  }
  .form-section-title {
    font-size: 0.9375rem;
  }
  .form-section-number {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }
  .contact-company-header-card {
    padding: 20px 16px;
  }
  .company-official-name {
    font-size: 1.1875rem;
  }
  .company-official-address {
    font-size: 0.875rem;
  }
  .contact-card-premium {
    padding: 28px 18px;
  }
  .contact-card-headline {
    font-size: 1.125rem;
  }
  .contact-quote-cta-banner {
    padding: 28px 18px;
  }
  .contact-quote-cta-title {
    font-size: 1.3125rem;
  }
}

@media (max-width: 360px) {
  .quote-form-card {
    padding: 16px 12px !important;
  }
  .btn-action-email,
  .btn-action-whatsapp {
    font-size: 0.8125rem;
    padding: 0 12px;
  }
}

