/* 📦 Общие стили для всех страниц */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: sans-serif;
}

/* 🔷 Обёртка для всей шапки */
.header-container {
  aspect-ratio: 50 / 2;
  display: flex;
  justify-content: center;
  width: 100%;
  position: sticky;                /* ✅ Фиксируем шапку */
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;                  /* Поверх всего */
  background-color: white;       /* Белый фон, чтобы перекрывал */
}

/* 🔷 Внутренняя сетка хедера */
.header-inner {
  display: flex;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

.bottom-inner {
  display: flex;
  width: 100%;
  height: 100%;
}

/* 🔷 Общий стиль для блоков (1–4) */
.block {
  flex-grow: 1;
  flex-basis: 0;
  border: 0px dashed gray;
  padding: 0px;
  color: #28565e;
}

/* 🔷 Плавное скрытие блоков 1 и 4 */
.block-1,
.block-4 {
  border-bottom: 3px solid red;
  transition: all 0.3s ease;
}

/* 🔷 Блок-обёртка для блоков 2 и 3 (жёстко 1048px при нормальной ширине) */
.block-2-3-wrapper {
  display: flex;
  width: 1048px;
  flex-shrink: 0;
  transition: width 0.3s ease;
  border-bottom: 3px solid red;
}

/* 🔷 Сами блоки 2 и 3 */
.block-2 {
  align-items: center;
  flex: 1;
  min-width: 0;
  padding: 0px;
  position: relative;
  overflow: visible;
  z-index: 1;
  display: flex;
}

.block-2-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  gap: 0px;
}

.block-3 {
  flex: 1;
  min-width: 0;
  padding: 0px;
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

/* 🔷 Внутри блока 2 — две колонки */
.column-left {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  top: clamp(10px, 2vw, 50px);
  width: 49%;
  height: auto;
  max-height: 120px;
  background-color: white;
  border: 0px solid #888;
  border-radius: 5px;
  padding: 10px;
  margin-left: 15px;
  position: relative;
}

.logo-img {
  max-height: 100px;
  height: auto;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.column-right {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 0px;
  border: 0px solid #888;
}

.contact-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  font-size: clamp(6px, 1vw, 16px);
}

/* 🔷 Защищённые элементы телефона и email */
.secure-phone,
.secure-email {
  display: flex;
  direction: ltr;
  unicode-bidi: plaintext;
  white-space: nowrap;
}

/* 🔷 Стили для кнопок внутри блока 3 */
.block-3 a {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  border: 0px solid lightgray;
  font-size: clamp(4px, 1.4vw, 16px);
  color: #28565e;
  white-space: nowrap;
  overflow: hidden;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* выпуклость */
  transition: box-shadow 0.2s, transform 0.2s;
}

/* 🔷 Вдавленная кнопка (активная страница) */
.block-3 a.active {
  background-color: #f0f0f0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2); /* вдавленность */
  transform: translateY(1px);
  font-weight: bold;
}

/* 🔷 Нижняя строка — обёртка блоков 5–8 */
.bottom-row {
  display: flex;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

/* 🔷 Нижние блоки 5–8 */
.block-5,
.block-6,
.block-7,
.block-8 {
  flex-grow: 1;
  flex-basis: 0;
  border: 0px dashed #aaa;
  padding: 0px;
  text-align: center;
  border-bottom: 3px solid red;        /* 🔴 нижняя граница красного цвета */
}

/* 🔷 Сами блоки 6 и 7 */
.block-6,
.block-7 {
  flex: 1;             /* равная ширина */
  min-width: 0;        /* чтобы сжимались одинаково */
  padding: 10px;
}

/* 🔷 Обёртка для блоков 6 и 7 (жёстко 1048px при нормальной ширине) */
.block-6-7-wrapper {
  display: flex;
  width: 1048px;
  flex-shrink: 0;
  transition: width 0.3s ease;
}

/* 🔷 Нижний наложенный текст */
.bottom-overlay-text {
  position: absolute;
  bottom: clamp(5px, 3vw, 55px);
  left: 50%;
  transform: translateX(-50%);
  color: white;
  text-align: center;
  font-weight: bold;
  white-space: nowrap;
  font-size: clamp(12px, 2.5vw, 36px);
  pointer-events: none;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.8),
    0 2px 4px rgba(0, 0, 0, 0.6);
  max-width: 95%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 🔷 Обёртка нижней части с фоном */
.bottom-wrapper {
  position: relative;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  background-image: url('/images/background1.png');      /* твой фон */
  background-size: 100% auto;                            /* весь фон помещается внутрь блока */
  background-repeat: no-repeat;
  background-position: center;
  aspect-ratio: 1600 / 400;                              /* 👉 ширина и высота исходного изображения */
  display: flex;
  flex-direction: column;
}

/* 🔷 Фон для страницы 2 */
body.page-2 .bottom-wrapper {
  background-image: url('/images/background2.png');
}

/* 🔷 Фон для страницы 3 */
html.page-3 .bottom-wrapper {
  background-image: url('/images/background3.png');
}

/* 🔷 Фон для страницы 4 */
body.page-4 .bottom-wrapper {
  background-image: url('/images/background4.png');
}

/* 🔷 Все блоки 5–8 растягиваются на всю высоту фона */
.block-5,
.block-6,
.block-7,
.block-8 {
  height: 100%;
}

/* 🔷 Общий стиль для блоков 9–12 */
.block-9,
.block-10,
.block-11,
.block-12 {
  border: 0px dashed gray;
  flex-grow: 1;
  flex-basis: 0;
  padding: 0px;
  text-align: center;
  border-bottom: 3px solid red;     /* 🔴 нижняя граница красного цвета */
}

/* 🔷 Обёртка для блоков 10 и 11 */
.block-10-11-wrapper {
  font-size: clamp(10px, 1.8vw, 14px); /* 🔹 адаптивный шрифт */
  display: flex;
  width: 1048px;
  flex-shrink: 1;
  transition: width 0.3s ease;
}

.block-heading {
  font-weight: bold;
  margin: 8px 0 4px;
  text-align: left;
  color: #28565e;
}

.block-heading-2 {
  font-size: clamp(10px, 1.5vw, 16px); /* 🔹 адаптивный шрифт */
  font-weight: bold;
  margin: 8px 0 4px;
  text-align: left;
  color: #28565e;
}

.block-10 {
  padding: 15px;
  flex: 0 0 66.8%; /* 700 / 1048 ≈ 66.8% */
}

.block-11 {
  padding: 15px;
  flex: 0 0 33.2%; /* 348 / 1048 ≈ 33.2% */
  background-color: #d3d3d3;
}

/* 🔷 Страницы 2 и 4: блок-10 уже, блок-11 шире */
body.page-2 .block-10,
body.page-4 .block-10 {
  padding: 0px;
  flex: 0 0 0%; /* 348 / 1048 */
}

body.page-2 .block-11,
body.page-4 .block-11 {
  padding: 0px;
  flex: 0 0 100%; /* 700 / 1048 */
}

body.page-3 .button-pressed {
  background-color: #dcdcdc !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
  transform: translateY(1px);
  font-weight: bold;
}

.block-10,
.block-11 {
  text-align: justify;
}

/* 🔷 Общий стиль для блоков (13–15) */
.block-13,
.block-14,
.block-15 {
  border: 0px dashed gray;
  flex-grow: 1;
  flex-basis: 0;
  padding: 0px;
  text-align: center;
  background-color: #28565e;
  color: white;
}

/* Новая обёртка для 14 */
.block-14-wrapper {
  display: flex;
  width: 1048px;
  flex-shrink: 1;
  transition: width 0.3s ease;
  font-size: clamp(8px, 1.5vw, 14px); /* 🔹 адаптивный шрифт */
  text-align: center;
  padding: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background-color: #28565e;
}

html.page-3 {
  scroll-padding-top: 220px;
}

/* 🔻 Адаптация для маленьких экранов */
@media (max-width: 1047px) {
  /* ❌ скрываем блоки 1 и 4 */
  .block-1,
  .block-4,
  .block-5,
  .block-8,
  .block-9,
  .block-12,
  .block-13,
  .block-15 {
    display: none;
  }

  /* 📏 растягиваем обёртку 2+3 на 100% */
  .block-2-3-wrapper {
    width: 100%;
    flex-shrink: 1;
  }

  /* 📏 растягиваем обёртку 10+11 на 100% */
  .block-10-11-wrapper {
  font-size: clamp(10px, 1.9vw, 16px); /* 🔹 адаптивный шрифт */
    width: 100%;
  }

  /* 📏 растягиваем обёртку 6+7 на 100% */
  .block-6-7-wrapper {
    width: 100%;
    flex-shrink: 1;
  }

  /* 🔠 уменьшаем шрифт кнопок ещё сильнее */
  .block-3 a {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    border: 0px solid lightgray;
    font-size: clamp(4px, 1.4vw, 16px);
    white-space: nowrap;
    overflow: hidden;
  }
}

/* 🔷 Обёртка кнопки на стр. 3 */
.page-3 .overlay-wrapper {
  position: absolute;
  bottom: clamp(5px, 3vw, 55px);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

/* 🔷 Текст */
.page-3 .overlay-text {
  color: white;
  font-weight: bold;
  font-size: clamp(12px, 2.5vw, 32px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  margin-bottom: clamp(10px, 2vw, 30px);
}

/* 🔷 Кнопка */
.page-3 .overlay-button {
  display: inline-block;
  background-color: #28565e;
  color: white;
  padding: 12px 24px;
  font-size: clamp(10px, 1.5vw, 20px);
  text-decoration: none;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease;
}

.page-3 .overlay-button:hover {
  background-color: #1f454b;
}

/* 🔔 Уведомление об успешной отправке */
.page-3 #success-alert {
  width: 100%;
  margin: 10px 0;
  padding: 10px;
  background-color: yellow;
  border: 1px solid #c3e6cb;
  color: #155724;
  border-radius: 4px;
  text-align: center;
  font-weight: bold;
  font-size: clamp(8px, 1.2vw, 16px);
}

/* Скрытая по умолчанию секция формы. Только на странице ЗАЯВКА */
html.page-3 #form-section {
  display: none;
}

/* Форма заявки с адаптивным флекс-расположением, только на странице ЗАЯВКА */
html.page-3 #request-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  width: 100%;
  max-width: 100%;
}

/* 🔷 Общая строка формы */
html.page-3 .form-line {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}

/* 🔷 Первая строка (только cargo_name) — без отступа сверху */
html.page-3 .form-line.first-line {
  margin-top: 10px;
}

/* 🔷 Метки */
html.page-3 .form-label {
  font-weight: bold;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 10px;
}

/* 🔷 Поля ввода */
html.page-3 .form-input {
  flex-grow: 1;
  min-width: 0;
  width: 100%;
  padding: 3px;
  font-size: clamp(6px, 1.5vw, 14px);
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* 🔷 Комментарий (textarea) */
html.page-3 .form-textarea {
  flex-grow: 1;
  min-width: 0;
  width: 100%;
  padding: 3px;
  font-size: clamp(6px, 1.5vw, 14px);
  font-family: inherit;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical; /* при необходимости */
}

/* 🔘 Кнопка отправки формы */
.form-submit-button {
  background-color: #28565e;
  color: white;
  padding: 10px 24px;
  font-size: clamp(10px, 1.2vw, 16px);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s, box-shadow 0.2s;
}

.form-submit-container {
  width: 100%;
  text-align: right;
  margin-top: 20px;
}

.service-table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 0px;
  table-layout: fixed; /* 📐 Выровнять строго по процентам */
}

.service-table td {
  border: none;
  padding: 0px 15px;
  vertical-align: top;
  font-size: clamp(10px, 1.5vw, 13px); /* 🔹 адаптивный шрифт */
}

.service-table td.first-column {
  width: 33.2%;
  background-color: white;
  font-size: clamp(10px, 1.8vw, 14px); /* 🔹 адаптивный шрифт */
}

.bin-text {
  color: white;
  font-weight: bold;
}
