/* Общие правила для экранов любого размера */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
}

button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

.order-dialog {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.tariff-table-wrap {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  scrollbar-color: #8b98aa #eef2f5;
  scrollbar-width: thin;
}

.faq-item button span {
  min-width: 0;
  padding-right: 16px;
}

.faq-item button i {
  flex: 0 0 24px;
}

/* Большие мониторы и телевизоры */
@media (min-width: 1440px) {
  .container {
    width: min(1320px, calc(100% - 80px));
  }

  .header-inner {
    gap: 48px;
  }

  .desktop-nav {
    gap: 32px;
  }

  .desktop-nav a {
    font-size: 14px;
  }

  .hero {
    padding-top: 105px;
  }

  .hero-layout {
    gap: 90px;
  }

  .hero-visual {
    max-width: 650px;
    justify-self: end;
    width: 100%;
  }

  .route-map {
    height: 380px;
  }

  .service-grid {
    gap: 20px;
  }

  .service-card,
  .service-card:hover {
    min-height: 520px;
  }

  .service-details {
    min-height: 168px;
  }

}

@media (min-width: 1920px) {
  body {
    font-size: 18px;
  }

  .container {
    width: min(1600px, calc(100% - 120px));
  }

  .site-header {
    height: 96px;
  }

  .desktop-nav a {
    font-size: 15px;
  }

  .header-phone b {
    font-size: 16px;
  }

  h1 {
    max-width: 820px;
    font-size: 92px;
  }

  .hero-lead,
  .section-head > p {
    font-size: 16px;
  }

  .hero-layout {
    gap: 120px;
  }

  .hero-visual {
    max-width: 760px;
  }

  .route-map {
    height: 430px;
  }

  .section {
    padding-top: 112px;
    padding-bottom: 112px;
  }

  .service-card,
  .service-card:hover {
    min-height: 590px;
  }

  .service-details {
    min-height: 180px;
    padding: 22px 76px 22px 22px;
  }

  .service-card .service-copy h3 {
    font-size: 23px;
  }

  .service-card .service-details p,
  .service-featured .service-details p,
  .tariff-table td {
    font-size: 14px;
  }

}

/* Небольшие ноутбуки: компактная шапка с меню */
@media (max-width: 1120px) {
  .desktop-nav {
    display: none;
  }

  .header-inner {
    justify-content: space-between;
  }

  .header-phone {
    margin-left: auto;
  }

  .menu-toggle {
    display: block;
  }

  .mobile-menu {
    display: flex;
    position: absolute;
    top: 88px;
    left: 0;
    right: 0;
    max-height: calc(100dvh - 88px);
    overflow-y: auto;
    background: #0c2143;
    flex-direction: column;
    padding: 15px max(20px, calc((100% - 1160px) / 2)) 25px;
    transform: translateY(-130%);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: .25s;
  }

  .mobile-menu.open {
    transform: none;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu a {
    padding: 13px 0;
    border-bottom: 1px solid #23395a;
  }
}

/* Планшеты */
@media (max-width: 980px) {
  .hero {
    padding-top: 72px;
  }

  .hero-layout {
    gap: 58px;
  }

  .hero-visual {
    max-width: 680px;
  }

  .section-head {
    align-items: flex-start;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 42px 64px;
  }

  .footer-grid > div:last-child {
    display: flex;
  }
}

@media (max-width: 900px) {
  .section-head {
    display: block;
  }

  .section-head > p {
    max-width: 680px;
    margin-top: 20px;
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 48px;
  }

  .steps::before {
    display: none;
  }

  .step {
    padding-right: 20px;
  }

  .step-dot {
    margin: 20px 0 22px;
  }

}

@media (max-width: 820px) {
  .faq-layout {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .faq-intro > p:not(.kicker) {
    max-width: 620px;
  }
}

/* Телефоны */
@media (max-width: 720px) {
  .container {
    width: min(100% - 28px, 680px);
  }

  .mobile-menu {
    top: 72px;
    max-height: calc(100dvh - 72px);
  }

  h1 {
    font-size: clamp(40px, 12vw, 47px);
  }

  .section-head h2,
  .faq-intro h2 {
    font-size: clamp(32px, 9vw, 42px);
  }

  .section-head > p {
    max-width: 100%;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .steps::before {
    display: block;
  }

  .step {
    padding: 0 0 35px 40px;
  }

  .step-dot {
    margin: 0;
  }

  .tariff-table-wrap {
    max-width: calc(100vw - 14px);
  }

  .footer-grid > div:last-child {
    display: flex;
  }

  .order-dialog {
    width: min(650px, calc(100% - 20px));
    max-height: calc(100dvh - 16px);
  }

  .mobile-actions {
    height: calc(68px + env(safe-area-inset-bottom));
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 560px) {
  .hero {
    padding-top: 48px;
  }

  .hero-layout {
    gap: 38px;
  }

  .dispatch-top,
  .dispatch-bottom {
    padding-left: 16px;
    padding-right: 16px;
  }

  .dispatch-bottom {
    gap: 16px;
  }

  .floating-badge {
    left: -2px;
  }

  .service-card,
  .service-card:hover {
    min-height: 430px;
  }

  .service-details {
    min-height: 148px;
    padding: 15px 58px 15px 15px;
  }

  .tariff-heading h3 {
    overflow-wrap: anywhere;
  }

  .tariff-table {
    min-width: 560px;
  }

  .route-table {
    min-width: 520px;
  }

  .tariff-table th,
  .tariff-table td {
    padding: 10px 12px;
  }

  .cta-card {
    padding: 34px 22px;
  }

  .cta-card h2 {
    font-size: clamp(29px, 9vw, 38px);
  }

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

  .footer-grid > div:first-child {
    grid-column: auto;
  }

  .footer-bottom {
    margin-top: 38px;
  }

}

@media (max-width: 440px) {
  .container {
    width: calc(100% - 24px);
  }

  .brand-copy b {
    font-size: 14px;
  }

  .brand-copy small {
    font-size: 8px;
  }

  .hero-copy .eyebrow {
    font-size: 9px;
    letter-spacing: .12em;
  }

  h1 {
    font-size: clamp(36px, 11.5vw, 43px);
  }

  .hero-lead {
    line-height: 1.65;
  }

  .route-map {
    height: 225px;
  }

  .eta {
    top: 14px;
    right: 12px;
    padding: 9px 10px;
  }

  .dispatch-bottom {
    gap: 10px;
  }

  .dispatch-bottom small {
    letter-spacing: .08em;
  }

  .floating-badge {
    padding: 11px 13px;
  }

  .floating-badge b {
    font-size: 25px;
  }

  .trust-row {
    margin-top: 44px;
    gap: 18px;
  }

  .section,
  .faq {
    padding-top: 54px;
    padding-bottom: 54px;
  }

  .service-card,
  .service-card:hover {
    min-height: 410px;
  }

  .service-card .service-copy h3 {
    font-size: 18px;
  }

  .service-details {
    min-height: 145px;
  }

  .service-card .card-arrow,
  .service-featured .card-arrow {
    right: 22px;
    bottom: 24px;
  }

  .faq-item button {
    padding: 20px 0;
    font-size: 13px;
  }

  .cta-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }

  .round-button {
    align-self: flex-end;
  }

  .dialog-shell {
    padding: 34px 16px 20px;
  }

  .dialog-shell h2 {
    padding-right: 32px;
    font-size: 27px;
  }

  .form-grid input,
  .form-grid select,
  .form-grid textarea {
    font-size: 16px;
  }

}

@media (max-width: 360px) {
  .brand-mark {
    width: 37px;
    height: 37px;
  }

  .hero-actions .button {
    padding-left: 16px;
    padding-right: 16px;
  }

  .dispatch-bottom div:nth-child(2) {
    display: none;
  }

  .service-details {
    padding-right: 54px;
  }

  .mobile-actions a {
    font-size: 11px;
  }
}

/* Невысокие экраны в альбомной ориентации */
@media (max-width: 980px) and (max-height: 600px) and (orientation: landscape) {
  .order-dialog {
    max-height: calc(100dvh - 8px);
  }

  .dialog-shell {
    padding-top: 28px;
  }

  .mobile-menu {
    max-height: calc(100dvh - 72px);
  }
}

/* На сенсорных устройствах не оставляем зависшие hover-эффекты */
@media (hover: none) {
  .service-card:hover,
  .button:hover {
    transform: none;
  }
}
