/* ==========================================================================
   price-table.css — оформление страницы прайс-листа
   Работает поверх разметки, которую генерирует update_price.py:
   саму таблицу править не нужно, всё навешивается стилями и price-table.js
   ========================================================================== */

.service-details {
  --pt-red: #de2c2c;
  --pt-ink: #241e2f;
  --pt-soft: #6b6478;
  --pt-line: #ebe8ef;
  --pt-bg: #f7f6f9;
}

/* ------------------------- полоса с ключевыми фактами --------------------- */

.price-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 50px;
  padding: 0;
  list-style: none;
}

.price-stats li {
  padding: 22px 24px;
  border: 1px solid var(--pt-line);
  border-radius: 16px;
  background: #fff;
  transition: border-color 0.25s ease, transform 0.25s ease,
    box-shadow 0.25s ease;
}

.price-stats li:hover {
  border-color: rgba(222, 44, 44, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(36, 30, 47, 0.08);
}

.price-stats b {
  display: block;
  margin-bottom: 4px;
  font-family: "Jost", "Inter", sans-serif;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
  color: var(--pt-red);
}

.price-stats span {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  color: var(--pt-soft);
}

/* ------------------------------ панель поиска ---------------------------- */

.price-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.price-toolbar__search {
  position: relative;
  flex: 1 1 320px;
  max-width: 420px;
}

.price-toolbar__search input {
  width: 100%;
  height: 54px;
  padding: 0 46px 0 20px;
  border: 1px solid var(--pt-line);
  border-radius: 100px;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  color: var(--pt-ink);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.price-toolbar__search input::placeholder {
  color: #a49dae;
}

.price-toolbar__search input:focus {
  outline: none;
  border-color: var(--pt-red);
  box-shadow: 0 0 0 4px rgba(222, 44, 44, 0.12);
}

.price-toolbar__search svg {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: #a49dae;
  pointer-events: none;
}

.price-toolbar__count {
  font-size: 14px;
  color: var(--pt-soft);
}

.price-toolbar__count b {
  color: var(--pt-ink);
  font-weight: 700;
}

.price-toolbar__hint {
  display: none;
  width: 100%;
  font-size: 13px;
  color: var(--pt-soft);
}

/* --------------------------------- таблица ------------------------------- */

.price-table-wrapper {
  margin: 0 0 30px;
  border: 1px solid var(--pt-line);
  border-radius: 18px;
  overflow: auto;
  max-height: 70vh;
  box-shadow: 0 20px 44px rgba(36, 30, 47, 0.06);
  scrollbar-width: thin;
}

.price-table {
  min-width: 720px;
}

.price-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--pt-ink);
  color: #fff !important;
  font-family: "Jost", "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

.price-table-thead-tr {
  border-bottom: 0 !important;
}

.price-table tbody tr {
  transition: background-color 0.18s ease;
}

.price-table tbody tr:hover:not(.price-table-group) {
  background-color: #fdf3f3 !important;
}

.price-table td {
  font-size: 15px;
  vertical-align: middle;
}

.price-table td:first-child {
  font-weight: 600;
  color: var(--pt-ink) !important;
}

/* строка-разделитель категории («ОРИГИНАЛ» и т.п.) */
.price-table tr.price-table-group td {
  padding-top: 8px;
  padding-bottom: 8px;
  height: auto;
  background: var(--pt-ink);
  color: #fff !important;
  font-family: "Jost", "Inter", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* бейджи сорта и страны */
.pt-badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.pt-badge--sort {
  background: var(--pt-bg);
  border: 1px solid var(--pt-line);
  color: var(--pt-ink);
}

.pt-badge--sort.is-1 {
  background: #fdecec;
  border-color: rgba(222, 44, 44, 0.28);
  color: #b01f1f;
}

.pt-badge--sort.is-2 {
  background: #fff4e8;
  border-color: rgba(214, 132, 32, 0.3);
  color: #a4620f;
}

.pt-badge--sort.is-3 {
  background: #eef3fb;
  border-color: rgba(52, 96, 168, 0.25);
  color: #3460a8;
}

.pt-badge--country {
  background: transparent;
  border: 1px dashed var(--pt-line);
  color: var(--pt-soft);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* цена */
.price-table td.is-price {
  font-family: "Jost", "Inter", sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: var(--pt-red) !important;
  white-space: nowrap;
}

/* ничего не найдено */
.price-table tr.pt-empty td {
  padding: 34px 20px;
  height: auto;
  text-align: center;
  color: var(--pt-soft) !important;
  font-size: 15px;
}

/* ширины колонок: название — главное, остальное компактно */
.price-table th:nth-child(1), .price-table td:nth-child(1) { width: 32%; }
.price-table th:nth-child(2), .price-table td:nth-child(2) { width: 13%; }
.price-table th:nth-child(3), .price-table td:nth-child(3) { width: 21%; }
.price-table th:nth-child(4), .price-table td:nth-child(4) { width: 12%; }
.price-table th:nth-child(5), .price-table td:nth-child(5) { width: 11%; }
.price-table th:nth-child(6), .price-table td:nth-child(6) { width: 11%; }

@media only screen and (max-width: 767px) {
  .price-table th:nth-child(n), .price-table td:nth-child(n) { width: auto; }
}

/* ------------------------- блок «нужна консультация» ---------------------- */

.price-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin: 0 0 70px;
  padding: 38px 42px;
  border-radius: 20px;
  background: linear-gradient(135deg, #241e2f 0%, #37304a 100%);
  color: #fff;
}

.price-cta__text {
  flex: 1 1 340px;
}

.price-cta__eyebrow {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #ff7b7b;
}

.price-cta h3 {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.28;
  font-weight: 700;
  color: #fff;
}

.price-cta p {
  margin: 0;
  max-width: 520px;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.72);
}

.price-cta__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.price-cta__actions .theme-btn-one {
  background: var(--pt-red);
  box-shadow: 0 16px 30px rgba(222, 44, 44, 0.3);
}

.price-cta__mail {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.72) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  transition: color 0.25s ease, border-color 0.25s ease;
}

.price-cta__mail:hover {
  color: #fff !important;
  border-color: #fff;
}

/* -------------------------------- адаптив -------------------------------- */

@media only screen and (max-width: 991px) {
  .price-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .price-cta {
    padding: 30px 26px;
  }

  .price-cta h3 {
    font-size: 22px;
  }
}

@media only screen and (max-width: 767px) {
  .price-toolbar__hint {
    display: block;
  }

  .price-table-wrapper {
    max-height: none;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  /* на телефоне таблица превращается в карточки */
  .price-table {
    min-width: 0;
    display: block;
  }

  .price-table thead {
    display: none;
  }

  .price-table tbody,
  .price-table tbody tr,
  .price-table td {
    display: block;
    width: 100%;
  }

  .price-table tbody tr {
    margin-bottom: 12px;
    padding: 6px 0;
    border: 1px solid var(--pt-line) !important;
    border-radius: 14px;
    background: #fff !important;
    overflow: hidden;
  }

  .price-table tbody tr:hover:not(.price-table-group) {
    background: #fff !important;
  }

  .price-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: auto !important;
    padding: 9px 16px !important;
    text-align: right;
  }

  .price-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--pt-soft);
    text-align: left;
  }

  .price-table td:first-child {
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    background: var(--pt-bg);
    font-size: 16px;
  }

  .price-table td:first-child::before {
    display: none;
  }

  .price-table td:empty {
    display: none;
  }

  .price-table tr.price-table-group {
    border: 0 !important;
    border-radius: 10px;
  }

  .price-table tr.price-table-group td {
    justify-content: center;
    background: var(--pt-ink);
  }

  .price-table tr.price-table-group td::before {
    display: none;
  }

  .price-cta__actions {
    width: 100%;
  }
}

@media only screen and (max-width: 599px) {
  .price-stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .price-stats li {
    padding: 18px 20px;
  }

  .price-stats b {
    font-size: 24px;
  }
}
