/* ==========================================================================
   PRICE LIST & LIVE SEARCH STYLES
   СИТИЛАБ на Вятской (донлаб.рф)
   ========================================================================== */

/* Блок заголовка и навигации прайса */
body:not(.layout-admin) section.ml-price-header,
section.ml-price-header,
.ml-price-header {
  padding-top: 1.25rem !important;
  padding-bottom: 0.25rem !important;
  text-align: center;
}

body:not(.layout-admin) section.ml-price-section,
section.ml-price-section,
.ml-price-section {
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
}

.ml-price-title {
  font-weight: 800;
  color: var(--ml-blue-700, #0f3b73);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: 2rem;
  margin-top: 2rem;
}

.ml-price-subtitle {
  color: #556987;
  font-size: 1rem;
  max-width: 680px;
  margin: 0 auto 0.75rem;
  line-height: 1.45;
}

/* Кнопки быстрых категорий (навигационные пилюли) */
.price-categories-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 0.75rem;
}

.price-cat-pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #233a56;
  background: #ffffff;
  border: 1px solid #dce7f0;
  border-radius: 6px;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(15, 59, 115, 0.04);
  transition: all 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.price-cat-pill:hover,
.price-cat-pill.active {
  background: #4a73a8;
  color: #ffffff;
  border-color: #4a73a8;
  box-shadow: 0 4px 12px rgba(74, 115, 168, 0.24);
}

.price-cat-pill:hover {
  background: #355175;
  border-color: #355175;
}

/* Поле живого поиска */
.price-search-wrapper {
  max-width: 680px;
  margin: 0 auto 0.75rem;
  position: relative;
  width: 100%;
}

.price-search-input {
  width: 100%;
  border: 1.5px solid #c7d8e8;
  border-radius: 6px;
  padding: 11px 46px 11px 16px;
  font-size: 15px;
  font-family: inherit;
  color: #233a56;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(15, 59, 115, 0.05);
  outline: none;
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.price-search-input:focus {
  border-color: #4a73a8;
  box-shadow: 0 0 0 3px rgba(74, 115, 168, 0.18);
}

.price-search-input::placeholder {
  color: #94a3b8;
  font-size: 14.5px;
}

.price-search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #4a73a8;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.price-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: none;
  background: #e2e8f0;
  color: #475569;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  transition: all 0.2s ease;
}

.price-search-clear:hover {
  background: #355175;
  color: #ffffff;
}

.price-search-wrapper.has-query .price-search-clear {
  display: flex;
}

.price-search-wrapper.has-query .price-search-icon {
  display: none;
}

/* Статус поиска: сколько найдено */
.price-search-stats {
  text-align: center;
  font-size: 13.5px;
  color: #556987;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  display: none;
  font-weight: 500;
}

.price-search-stats.show {
  display: block;
}

/* Сообщение, если ничего не найдено */
.price-empty {
  text-align: center;
  color: #475569;
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 24px 20px;
  font-size: 15px;
  display: none;
  margin: 0.5rem auto 1rem;
  max-width: 650px;
  line-height: 1.5;
  box-shadow: 0 4px 14px rgba(15, 59, 115, 0.05);
}

.price-empty.show {
  display: block;
}

.price-empty-btn {
  margin-top: 10px;
}

/* Подсветка найденного текста */
.table-price mark.price-hit {
  background: #ffe69c;
  color: #664d03;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 700;
}

/* Блоки категорий */
.price-category-block {
  margin-bottom: 1.75rem;
  scroll-margin-top: 120px;
}

.price-category-block.price-hidden,
.table-price tr.price-hidden {
  display: none !important;
}

.price-category-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid rgba(74, 115, 168, 0.2);
  padding-bottom: 10px;
  margin-bottom: 1rem;
}

.price-category-title {
  font-weight: 800;
  color: var(--ml-blue-700, #0f3b73);
  font-size: 1.35rem;
  margin: 0;
}

/* Обертка для таблицы */
.price-table-card {
  background: #ffffff;
  border: 1px solid rgba(15, 59, 115, 0.1);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 59, 115, 0.05);
}

/* Таблица цен */
.table-price {
  width: 100%;
  margin-bottom: 0;
  background-color: #ffffff;
  border-collapse: collapse;
}

.table-price th {
  background-color: #f6f8fb;
  color: var(--ml-blue-700, #0f3b73);
  font-weight: 700;
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 14px 16px;
  border-bottom: 2px solid rgba(15, 59, 115, 0.12);
  vertical-align: middle;
}

.table-price .price-col-code {
  width: 120px;
  min-width: 110px;
  text-align: center;
}

.table-price .price-col-name {
  text-align: left;
}

.table-price .price-col-time {
  width: 115px;
  min-width: 100px;
  text-align: center;
}

.table-price .price-col-price {
  width: 135px;
  min-width: 120px;
  text-align: right;
}

.table-price td {
  padding: 13px 16px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(15, 59, 115, 0.07);
  font-size: 14.5px;
  line-height: 1.45;
  transition: background-color 0.15s ease;
}

.table-price tbody tr:last-child td {
  border-bottom: none;
}

.table-price tbody tr:hover td {
  background-color: #f8fafc;
}

.table-price .price-code {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

.table-price .price-name {
  color: #1e293b;
  font-weight: 500;
}

.table-price .price-time {
  text-align: center;
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
}

.table-price .price-cost {
  text-align: right;
  font-weight: 700;
  color: #4a73a8;
  white-space: nowrap;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* Адаптация шапки и отступов под мобильные экраны (меню фиксировано) */
@media (max-width: 991.98px) {
  body:not(.layout-admin) section.ml-price-header,
  section.ml-price-header,
  .ml-price-header {
    /* На мобильных фиксированное меню занимает ~123px: отступ предотвращает заезд заголовка под меню */
    padding-top: 138px !important;
    padding-bottom: 0.25rem !important;
  }
  .ml-price-title {
    font-size: 1.45rem;
    margin-bottom: 0.35rem;
  }
  .ml-price-subtitle {
    font-size: 0.92rem;
    margin-bottom: 0.65rem;
    line-height: 1.4;
  }
  .price-categories-nav {
    gap: 5px;
    margin-bottom: 0.65rem;
  }
  .price-cat-pill {
    padding: 5px 12px;
    font-size: 12.5px;
  }
  .price-search-wrapper {
    margin: 0 auto 0.5rem;
  }
  .price-search-input {
    padding: 10px 42px 10px 16px;
    font-size: 14px;
  }
  .price-category-block {
    margin-bottom: 1.25rem;
    scroll-margin-top: 130px;
  }
  .price-category-title {
    font-size: 1.2rem;
  }
}

/* Мобильная адаптация таблиц прейскуранта (от 360px) */
@media (max-width: 767.98px) {
  .table-price {
    display: table;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
  }

  .table-price thead {
    display: table-header-group;
  }

  .table-price thead tr {
    display: table-row;
  }

  .table-price thead th {
    display: table-cell;
    padding: 8px 4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    color: #1e293b;
    background-color: #f1f5f9;
    border-bottom: 2px solid #cbd5e1;
    vertical-align: middle;
    text-align: center;
  }

  .table-price thead th.price-col-code {
    width: 68px;
    text-align: center;
  }

  .table-price thead th.price-col-name {
    text-align: center;
    padding-left: 4px;
    padding-right: 4px;
  }

  .table-price thead th.price-col-time {
    width: 40px;
    text-align: center;
  }

  .table-price thead th.price-col-price {
    width: 66px;
    text-align: center;
    padding-right: 4px;
  }

  .table-price tbody {
    display: table-row-group;
  }

  .table-price tbody tr {
    display: table-row;
    padding: 0;
    border-bottom: 1px solid #e2e8f0;
  }

  .table-price tbody td {
    display: table-cell;
    padding: 8px 4px;
    vertical-align: middle;
  }

  .table-price .price-code {
    width: 68px;
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
    color: #64748b;
    font-weight: 600;
    padding: 8px 2px;
  }

  .table-price .price-name {
    font-size: 12.5px;
    line-height: 1.35;
    color: #1e293b;
    font-weight: 500;
    padding-left: 6px;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .table-price .price-time {
    display: table-cell;
    width: 40px;
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
    color: #64748b;
    padding: 8px 2px;
  }

  .table-price .price-cost {
    display: table-cell;
    width: 66px;
    font-size: 13px;
    text-align: right;
    white-space: nowrap;
    color: #4a73a8;
    font-weight: 700;
    padding-right: 6px;
  }

  .price-mobile-meta {
    display: none;
  }
}

/* Баннер обратного звонка / консультации внизу страницы */
.price-cta-box {
  background: linear-gradient(135deg, #0f3b73 0%, #1f6fd1 100%);
  border-radius: 16px;
  color: #ffffff;
  padding: 36px 24px;
  text-align: center;
  box-shadow: 0 14px 35px rgba(15, 59, 115, 0.18);
  margin-top: 2rem;
  margin-bottom: 3rem;
}

.price-cta-box h3 {
  color: #ffffff;
  font-weight: 800;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.price-cta-box p {
  color: rgba(255, 255, 255, 0.9);
  max-width: 600px;
  margin: 0 auto 1.5rem;
  font-size: 15px;
}

.price-cta-btn {
  background: #ffffff;
  color: #0f3b73;
  font-weight: 700;
  border-radius: 50px;
  padding: 10px 24px;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.price-cta-btn:hover {
  background: #f0f4f9;
  color: #0b2b52;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
