/**
 * Cross-page responsive fixes (mobile + tablet only).
 * Desktop layouts are not modified above 1024px.
 */

/* Prevent horizontal overflow from wide content */
img,
video,
svg,
iframe {
  max-width: 100%;
  height: auto;
}

/* Consistent text alignment on small screens */
@media screen and (max-width: 1024px) {
  .section-heading,
  .section-body,
  .h2,
  .lead,
  .leadw,
  .hero-sub,
  .hero-p {
    text-align: left;
  }

  .section-body {
    max-width: 100%;
  }

  /* Form fields full width */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea {
    max-width: 100%;
    width: 100%;
  }

  /* Button stacks */
  .hero-btns,
  .cta-btns,
  .bd-cta-row,
  .gs-btns {
    flex-wrap: wrap;
  }
}

@media screen and (max-width: 767px) {
  /* Section padding consistency */
  .section,
  section[id] {
    padding-left: 0;
    padding-right: 0;
  }

  /* Prevent text clipping in cards */
  .svc-card,
  .prob-card,
  .why-card,
  .testi-card,
  .route-card,
  .story-card,
  .market-card,
  .ops-card,
  .val-card {
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  /* Legal pages */
  .legal-hero h1,
  .legal-section h2,
  .legal-section p {
    text-align: left;
  }

  .toc-link {
    text-align: left;
  }
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
  /* Tablet: balanced grid gaps */
  .footer-grid,
  .foot-grid {
    gap: 24px !important;
  }

  .hero-h1,
  .h2,
  .section-heading {
    letter-spacing: -0.5px;
  }

  .container,
  .wrap {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  .timeline-items {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .form-row,
  .f-row2 {
    grid-template-columns: 1fr 1fr !important;
  }

  #sticky-bar-html,
  #sticky-bar {
    padding: 10px 24px !important;
    flex-wrap: wrap;
    gap: 10px;
  }

  #sticky-bar-html span,
  #sticky-bar .sb-text {
    font-size: 12px !important;
  }
}

@media screen and (max-width: 767px) {
  #sticky-bar-html,
  #sticky-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 10px 20px !important;
    gap: 10px !important;
  }

  #sticky-bar .sb-text--desktop,
  #sticky-bar-html .sb-text--desktop {
    display: none !important;
  }

  #sticky-bar .sb-text--mobile,
  #sticky-bar-html .sb-text--mobile {
    display: block !important;
    text-align: center;
    font-size: 12px;
    line-height: 1.45;
  }

  #sticky-bar-html > span,
  #sticky-bar-html .sb-text {
    font-size: 12px !important;
    line-height: 1.45;
    text-align: center;
  }

  #sticky-bar-html > div,
  #sticky-bar .sb-actions {
    width: 100%;
    display: flex !important;
    gap: 8px;
  }

  #sticky-bar-html a,
  #sticky-bar .sb-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 12px !important;
    padding: 9px 10px !important;
    white-space: nowrap;
  }

  #wa-float {
    bottom: 118px !important;
  }
}

@media screen and (max-width: 479px) {
  .container,
  .wrap {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .nav-inner,
  .nav-in {
    height: 56px !important;
  }

  #sticky-bar-html {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 10px 20px !important;
  }

  #sticky-bar-html > div {
    width: 100%;
  }

  #sticky-bar-html a {
    flex: 1;
    justify-content: center;
  }

  #sticky-bar .sb-text--mobile,
  #sticky-bar-html .sb-text--mobile {
    font-size: 11px;
  }

  #wa-float {
    bottom: 108px !important;
  }
}

/* Inner footer layout - tablet + mobile (China, About, BD inner layout) */
@media screen and (max-width: 991px) {
  footer .wrap {
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
  }

  footer .foot-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 28px 20px !important;
    margin-bottom: 36px !important;
    text-align: center !important;
  }

  footer .foot-grid > div:first-child {
    grid-column: 1 / -1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding-bottom: 24px !important;
    margin-bottom: 4px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  }

  footer .foot-grid > .foot-col:last-child {
    grid-column: 1 / -1 !important;
    padding-top: 8px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  }

  footer .foot-logo-row {
    justify-content: center !important;
  }

  footer .footer-logo-img {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 14px !important;
  }

  footer .foot-desc {
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  footer .foot-socials {
    justify-content: center !important;
  }

  footer .foot-col h5 {
    text-align: center !important;
  }

  footer .foot-col a {
    text-align: center !important;
  }

  footer .foot-bottom {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 14px !important;
  }

  footer .foot-pills,
  footer .footer-badges {
    justify-content: center !important;
    flex-wrap: wrap !important;
  }
}

@media screen and (max-width: 767px) {
  footer {
    padding: 44px 0 112px !important;
  }

  footer.legal-site-footer {
    padding: 36px 0 24px !important;
  }

  footer .wrap {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  footer .foot-grid {
    gap: 24px 16px !important;
    margin-bottom: 28px !important;
  }

  footer .foot-grid > div:first-child {
    padding-bottom: 20px !important;
  }

  /* Long warehouse address - hide on mobile; contact column keeps key links */
  footer .foot-address {
    display: none !important;
  }

  footer .foot-desc {
    font-size: 14px !important;
    line-height: 1.72 !important;
    margin-bottom: 18px !important;
    color: rgba(255, 255, 255, 0.42) !important;
  }

  footer .foot-socials {
    gap: 10px !important;
    margin-top: 2px !important;
  }

  footer .soc,
  footer .social-btn {
    width: 38px !important;
    height: 38px !important;
  }

  footer .foot-col h5 {
    font-size: 10.5px !important;
    margin-bottom: 12px !important;
    letter-spacing: 0.6px !important;
    color: rgba(255, 255, 255, 0.32) !important;
  }

  footer .foot-col a {
    font-size: 13.5px !important;
    margin-bottom: 9px !important;
    line-height: 1.4 !important;
    color: rgba(255, 255, 255, 0.55) !important;
  }

  footer .foot-col a:last-child {
    margin-bottom: 0 !important;
  }

  footer .foot-bottom {
    padding-top: 22px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  }

  footer .foot-bottom p {
    font-size: 11.5px !important;
    line-height: 1.5 !important;
    width: 100% !important;
    color: rgba(255, 255, 255, 0.28) !important;
  }

  footer .foot-pills,
  footer .footer-badges {
    gap: 8px !important;
    width: 100% !important;
  }

  footer .foot-pill,
  footer .foot-badge {
    font-size: 10px !important;
    padding: 5px 10px !important;
  }
}

@media screen and (max-width: 479px) {
  footer {
    padding: 40px 0 108px !important;
  }

  footer.legal-site-footer {
    padding: 32px 0 24px !important;
  }

  footer .foot-grid {
    grid-template-columns: 1fr !important;
    gap: 22px !important;
  }

  footer .foot-grid > .foot-col:not(:last-child) {
    padding-bottom: 18px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  }

  footer .foot-grid > .foot-col:last-child {
    border-top: none !important;
    padding-top: 0 !important;
  }

  footer .foot-desc {
    font-size: 13.5px !important;
  }

  footer .foot-col a {
    font-size: 13px !important;
  }
}
