/* ============================================================
   ОБЁРТКА ТАБЛИЦЫ
   ============================================================ */
.grundek__table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  background: #fff;
  padding: 4px;
  scrollbar-width: thin;
}

.grundek__table-wrap::-webkit-scrollbar {
  height: 8px;
}
.grundek__table-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.grundek__table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

/* ============================================================
   ТАБЛИЦА
   ============================================================ */
.grundek__table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  color: #1a1a1a;
  font-family: inherit;
}

.grundek__table th,
.grundek__table td {
  padding: 14px 16px;
  text-align: center;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
  border-bottom: 1px solid #eef1f4;
}

/* ============================================================
   STICKY-ПЕРВАЯ-КОЛОНКА (важно для мобилки)
   ============================================================ */
.grundek__table th:first-child,
.grundek__table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.05);
  text-align: left;
  padding-left: 20px;
  font-weight: 700;
  color: #0d1b2a;
}

/* Полосатость первой колонки — сохраняем фон строки */
.grundek__table tbody tr:nth-child(even) td:first-child {
  background: #fafbfc;
}

/* ============================================================
   ЗАГОЛОВКИ СТОЛБЦОВ
   ============================================================ */
.grundek__table thead th {
  background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: .3px;
  padding: 16px 14px;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: none;
  white-space: normal;
  min-width: 90px;
}

/* Первая колонка в шапке — выше по z-index (пересечение двух sticky) */
.grundek__table thead th:first-child {
  background: linear-gradient(180deg, #1a252f 0%, #0f161c 100%);
  border-top-left-radius: 12px;
  z-index: 4;
}

.grundek__table thead th:last-child {
  border-top-right-radius: 12px;
}

.grundek__table thead th + th {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================================
   ТЕЛО ТАБЛИЦЫ
   ============================================================ */
.grundek__table tbody td {
  background: #fff;
  font-weight: 500;
  color: #2c3e50;
}

.grundek__table tbody tr:nth-child(even) td {
  background: #fafbfc;
}

/* ============================================================
   HOVER — КОНТРАСТНАЯ ПОДСВЕТКА СТРОКИ + СТОЛБЦА
   ============================================================ */
.grundek__table td,
.grundek__table th {
  cursor: pointer;
}

.grundek__table tr.is-hover-row > td {
  background-color: #cfe8ff !important;
  color: #000;
}

.grundek__table td.is-hover-col {
  background-color: #cfe8ff !important;
}

.grundek__table tr.is-hover-row > td.is-hover-col {
  background-color: #45a0ce !important;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

.grundek__table thead th.is-hover-col {
  background: linear-gradient(180deg, #45a0ce 0%, #2c7ba8 100%) !important;
  color: #fff;
}

/* Скругления внизу таблицы */
.grundek__table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 12px;
}
.grundek__table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}

.grundek__table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   МОДАЛКА — ФИКСИРОВАНА ОТНОСИТЕЛЬНО ЭКРАНА
   ============================================================ */
.grundek-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 20px !important;
  z-index: 2147483600 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform: none !important;
  will-change: auto;
  isolation: isolate;
}

.grundek-modal[hidden] { display: none !important; }

.grundek-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  animation: grundekFadeIn .2s ease;
}

.grundek-modal__dialog {
  position: relative;
  background: #fff;
  border-radius: 16px;
  max-width: 980px;
  width: 100%;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  animation: grundekSlideIn .25s cubic-bezier(.25, 1, .3, 1);
  overscroll-behavior: contain;
}

/* ============================================================
   ДВУХКОЛОНОЧНЫЙ GRID ВНУТРИ МОДАЛКИ
   ============================================================ */
.grundek-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.grundek-modal__col--form {
  order: 1;
}

.grundek-modal__col--specs {
  order: 2;
  background: #f7f9fb;
  border-radius: 12px;
  padding: 20px;
  max-height: calc(100vh - 130px);
  max-height: calc(100dvh - 130px);
  overflow-y: auto;
}

/* ============================================================
   ПРАВАЯ КОЛОНКА: ХАРАКТЕРИСТИКИ
   ============================================================ */
.grundek-modal__specs-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e9ef;
}

.grundek-modal__badge {
  display: inline-block;
  background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 6px;
}

.grundek-modal__size {
  font-size: 24px;
  color: #0d1b2a;
  font-weight: 700;
}

.grundek-modal__specs {
  margin: 0;
  transition: opacity .15s ease;
}

.grundek-modal__specs.is-updating {
  opacity: 0;
}

.grundek-modal__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed #e5e7eb;
  gap: 12px;
}
.grundek-modal__row:last-child { border-bottom: none; }
.grundek-modal__row dt {
  color: #6b7280;
  margin: 0;
  font-size: 13px;
  text-align: left;
}
.grundek-modal__row dd {
  margin: 0;
  font-weight: 700;
  color: #0d1b2a;
  font-size: 14px;
  white-space: nowrap;
}

.grundek-modal__empty {
  padding: 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

/* ============================================================
   ЛЕВАЯ КОЛОНКА: ФОРМА
   ============================================================ */
.grundek-modal__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: #0d1b2a;
}

.grundek-modal__sub {
  margin: 0 0 20px;
  color: #6b7280;
  font-size: 14px;
}

.grundek-modal__form .wpcf7 { margin: 0; }
.grundek-modal__form p { margin: 0 0 12px; }
.grundek-modal__form label {
  display: block;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
}

.grundek-modal__form input[type="text"],
.grundek-modal__form input[type="tel"],
.grundek-modal__form input[type="email"],
.grundek-modal__form textarea,
.grundek-modal__form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #0d1b2a;
  background: #fff;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.grundek-modal__form input:focus,
.grundek-modal__form textarea:focus,
.grundek-modal__form select:focus {
  outline: none;
  border-color: #45a0ce;
  box-shadow: 0 0 0 3px rgba(69, 160, 206, 0.15);
}

.grundek-modal__form input[type="submit"] {
  width: 100%;
  padding: 13px;
  background: linear-gradient(180deg, #ffcc00 0%, #f5a623 100%);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #0d1b2a;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 12px rgba(245, 166, 35, 0.35);
}

.grundek-modal__form input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(245, 166, 35, 0.5);
}

/* ============================================================
   КНОПКА ЗАКРЫТИЯ
   ============================================================ */
.grundek-modal__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: #f2f4f7;
  border: none;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease, transform .15s ease;
  z-index: 3;
}
.grundek-modal__close:hover {
  background: #e63946;
  color: #fff;
  transform: rotate(90deg);
}

@keyframes grundekFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes grundekSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   БЛОКИРОВКА СКРОЛЛА САЙТА
   ============================================================ */
body.grundek-modal-open {
  overflow: hidden !important;
  padding-right: var(--grundek-scrollbar-width, 0px);
}

/* ============================================================
   АДАПТИВ МОДАЛКИ: до 860px — форма сверху, характеристики снизу
   ============================================================ */
@media (max-width: 860px) {
  .grundek-modal {
    padding: 10px !important;
    align-items: flex-start;
  }
  .grundek-modal__dialog {
    padding: 20px;
    max-height: calc(100dvh - 20px);
    border-radius: 14px;
  }
  .grundek-modal__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .grundek-modal__col--form { order: 1; }
  .grundek-modal__col--specs {
    order: 2;
    max-height: none;
    overflow: visible;
  }
  .grundek-modal__size { font-size: 20px; }
}

/* ============================================================
   АДАПТИВ ТАБЛИЦЫ: до 720px — горизонтальный скролл + sticky-колонка
   ============================================================ */
@media (max-width: 720px) {

  .grundek__table-wrap {
    border-radius: 10px;
    padding: 2px;
    position: relative;
  }

  /* Таблица не сжимается — уходит в горизонтальный скролл */
  .grundek__table {
    min-width: 820px;
    font-size: 12.5px;
  }

  .grundek__table th,
  .grundek__table td {
    padding: 10px 10px;
    white-space: nowrap;
  }

  .grundek__table thead th {
    padding: 12px 10px;
    font-size: 11.5px;
    min-width: 80px;
  }

  /* Первую колонку сузим, чтобы не отъедала места */
  .grundek__table th:first-child,
  .grundek__table td:first-child {
    min-width: 76px;
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Отключаем crosshair на мобилке (hover не работает) */
  .grundek__table tr.is-hover-row > td,
  .grundek__table td.is-hover-col,
  .grundek__table tr.is-hover-row > td.is-hover-col {
    background: transparent !important;
    transform: none;
    box-shadow: none;
  }

  /* Восстанавливаем фон первой колонки и полосатости после сброса */
  .grundek__table tbody td:first-child {
    background: #fff !important;
  }
  .grundek__table tbody tr:nth-child(even) td:first-child {
    background: #fafbfc !important;
  }
}

.wpcf7-form-control{margin-top:5px}