/* Live-contour fixes: fit the viewport, no page overflow-x, complete last rows. */

html {
  overflow-x: clip;
  overflow-y: auto;
}

body {
  overflow-x: clip;
  max-width: 100%;
}

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

.hero-grid > *,
.booking-bar-row > *,
.controls-grid > *,
.routes-grid > *,
.long-haul-grid > *,
.drivers-grid > *,
.benefits-grid > *,
.reviews-grid > *,
.faq-columns > *,
.cta-banner > *,
.footer-grid > *,
.cta-contact-cards > * {
  min-width: 0;
  max-width: 100%;
}

section[id] {
  scroll-margin-top: 128px;
}

.btn {
  white-space: normal;
  max-width: 100%;
}

.header-top,
.header-contacts,
.phone-group,
.nav-list,
.hero-cta-row,
.hero-badges-strip,
.route-footer,
.footer-bottom {
  min-width: 0;
  max-width: 100%;
}

.header-top,
.header-contacts,
.hero-cta-row,
.amenities-chip-group {
  flex-wrap: wrap;
}

.header-contacts {
  justify-content: flex-end;
}

.brand-logo,
.brand-text,
.brand-name {
  min-width: 0;
  max-width: 100%;
}

.brand-name,
.phone-link,
.nav-link,
.route-title,
.long-route-name,
.price-val,
.long-price,
.hero-h1,
.section-h2 {
  overflow-wrap: anywhere;
}

.hero-kicker {
  display: flex;
  flex-wrap: wrap;
  max-width: 100%;
  white-space: normal;
  height: auto;
}

.nav-list {
  flex-wrap: wrap;
  gap: 10px 18px;
  max-width: 100%;
}

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

.dropdown-menu {
  max-width: min(280px, calc(100% - 8px));
}

.booking-bar-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.booking-bar-row > .btn {
  grid-column: 1 / -1;
  justify-self: start;
}

.field-select,
.control-input,
.control-select {
  max-width: 100%;
  min-width: 0;
}

.hero-image-card,
.driver-img-wrap {
  background-color: #132A42;
}

.hero-image-card picture,
.driver-img-wrap picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-badges-strip,
.amenities-chip-group {
  min-width: 0;
}

.route-footer {
  flex-wrap: wrap;
  align-items: flex-end;
}

.long-price {
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
}

.long-card .route-btn {
  width: 100%;
  margin-top: 12px;
}

.driver-body .btn {
  align-self: flex-start;
  max-width: 100%;
}

.header-phones-bar {
  display: none;
}

.modal-window {
  max-height: min(640px, calc(100dvh - 32px));
  overflow-y: auto;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 1200px) {
  .long-haul-grid,
  .benefits-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .drivers-grid .driver-card:last-child:nth-child(odd),
  .reviews-grid .review-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .phone-group {
    display: none;
  }

  .header-phones-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 0 0 10px;
    max-width: 100%;
  }

  .header-phones-bar a {
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--text-primary);
  }

  .header-cta-btn {
    display: none;
  }

  .brand-sub {
    display: none;
  }
}

@media (max-width: 768px) {
  section[id] {
    scroll-margin-top: 88px;
  }

  .header-nav-bar.open .nav-list {
    align-items: stretch;
    width: 100%;
  }

  .header-nav-bar.open .nav-link {
    white-space: normal;
  }

  .dropdown-menu {
    max-width: 100%;
    width: 100%;
  }

  .long-haul-grid,
  .benefits-grid,
  .routes-grid,
  .drivers-grid,
  .reviews-grid,
  .faq-columns,
  .footer-grid,
  .cta-contact-cards,
  .controls-grid,
  .booking-bar-row {
    grid-template-columns: 1fr;
  }

  .drivers-grid .driver-card:last-child:nth-child(odd),
  .reviews-grid .review-card:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }

  .booking-bar-row > .btn,
  .cta-banner .btn {
    justify-self: stretch;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .msg-icon {
    width: 34px;
    height: 34px;
  }

  .brand-name {
    font-size: 0.92rem;
  }

  .hero-section {
    padding: 22px 0 28px;
  }

  .social-proof-chip {
    width: 100%;
  }
}
