@charset "utf-8";

/* ══════════════════════════════════════════════
   КАТАЛОГ — СТОРІНКА ТОВАРУ
   Використовується разом із styles.css
   ══════════════════════════════════════════════ */

/* ──────────────────────────────────────────────
   ОБГОРТКА
   ────────────────────────────────────────────── */
.kp-wrap {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  max-width: 1200px;
  width: 100%;
  min-height: 600px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ──────────────────────────────────────────────
   ЛІВА КОЛОНКА — галерея прикладів
   ────────────────────────────────────────────── */
.kp-gallery {
  width: 220px;
  flex-shrink: 0;
  background: #f0e9dc;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 25px 0 25px;
  box-sizing: border-box;
}

.kp-gallery h3 {
  margin: 0 0 6px;
  font-size: inherit;
}

.kp-gallery-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex: unset; /* Меняем с 1 на unset, чтобы блок не растягивался на всю высоту принудительно */
  justify-content: flex-start; /* на ПК — з верху, щоб скрол починався зверху */
  gap: 4px; /* Задает фиксированный аккуратный вертикальный отступ между рядами картинок */
  /* ── вертикальна прокрутка для ПК ── */
  max-height: 600px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #a0855a #f0e8df;
}
.kp-gallery-grid::-webkit-scrollbar {
  width: 5px;
}
.kp-gallery-grid::-webkit-scrollbar-track {
  background: #f0e8df;
  border-radius: 3px;
}
.kp-gallery-grid::-webkit-scrollbar-thumb {
  background: #a0855a;
  border-radius: 3px;
}
.kp-gallery-grid::-webkit-scrollbar-thumb:hover {
  background: #7a6040;
}
.kp-gallery-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
}

.kp-gallery-row a {
  display: inline-block;
  line-height: 0;
}

.kp-gallery-row img {
  margin: 4px;
  display: block;
}

/* ──────────────────────────────────────────────
   ЦЕНТРАЛЬНА КОЛОНКА — велике фото
   ────────────────────────────────────────────── */
.kp-photo {
  width: 350px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
}

.kp-photo img {
  display: block;
}

/* ──────────────────────────────────────────────
   ПРАВА КОЛОНКА — контент
   ────────────────────────────────────────────── */
.kp-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

/* Заголовок + опис */
.kp-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 10px;
  width: 100%;
  min-height: 180px;
}

.kp-title h1 {
  margin-top: 10px !important;
}

/* Мітка «Схожі моделі» */
.kp-similar-label {
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Ряд схожих моделей */
.kp-similar-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  flex-wrap: nowrap;
  width: 100%;
}

.kp-similar-row a {
  display: block;
  width: 82px;
  text-align: center;
}

/* Кнопка */
.kp-btn {
  width: auto;
  text-align: center;
  margin: 6px auto;
  white-space: nowrap;
}

/* ──────────────────────────────────────────────
   БЛОК ЦІН
   ────────────────────────────────────────────── */
.kp-prices {
  width: 100%;
  padding: 0 10px 10px;
  box-sizing: border-box;
}

.kp-prices-note {
  width: 100%;
  margin: 0 auto;
  padding: 10px 0;
  display: block;
}

/* Таблиця */
.kp-prices table,
#desk-prices-table-wrap table {
  width: 100%;
  max-width: 650px;
  margin: 0 auto;
  border: none !important;
  border-collapse: separate !important;
  border-spacing: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(59,42,26,0.13);
  font-size: 13px;
}

/* Рядок 1 — заголовок таблиці */
.kp-prices table tr:nth-child(1) td,
#desk-prices-table-wrap table tr:nth-child(1) td {
  background: var(--wood-dark);
  color: var(--cream-mid);
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  border: none !important;
  text-align: center;
}

/* Рядок 2 — породи дерева */
.kp-prices table tr:nth-child(2) td,
#desk-prices-table-wrap table tr:nth-child(2) td {
  background: var(--wood-mid);
  color: #fff;
  font-weight: 600;
  text-align: center;
  padding: 8px 10px;
  border: none !important;
  letter-spacing: 0.03em;
  font-size: 12px;
  text-transform: uppercase;
}

/* Рядки з цінами */
.kp-prices table tr:nth-child(n+3) td,
#desk-prices-table-wrap table tr:nth-child(n+3) td {
  border: none !important;
  padding: 9px 12px;
  text-align: center;
  vertical-align: middle;
  transition: background 0.15s;
}

/* Перша комірка — назва оздоблення */
.kp-prices table tr:nth-child(n+3) td:first-child,
#desk-prices-table-wrap table tr:nth-child(n+3) td:first-child {
  background: #f0e9dc !important;
  color: var(--wood-dark);
  font-weight: 600;
  text-align: center;
  padding-left: 14px;
  white-space: nowrap;
  border-right: 2px solid var(--wood-light) !important;
}

/* Зебра */
.kp-prices table tr:nth-child(odd):nth-child(n+3),
#desk-prices-table-wrap table tr:nth-child(odd):nth-child(n+3) {
  background: #faf7f2;
}

.kp-prices table tr:nth-child(even):nth-child(n+3),
#desk-prices-table-wrap table tr:nth-child(even):nth-child(n+3) {
  background: #fff;
}

/* Ховер */
.kp-prices table tr:nth-child(n+3):hover td:not(:first-child),
#desk-prices-table-wrap table tr:nth-child(n+3):hover td:not(:first-child) {
  background: #fdefd9 !important;
}

/* Значення ціни */
.price-val {
  font-weight: 600;
  color: var(--accent);
  font-size: 14px;
}

/* ══════════════════════════════════════════════
   МЕДІА — мобільний (≤ 768px)
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {

  .kp-wrap {
    flex-direction: column;
    min-height: unset;
    background: #faf7f2;
  }

  /* Порядок блоків на мобільному:
     1 — заголовок, 2 — фото, 3 — галерея,
     4 — ціни, 5 — мітка схожих, 6 — схожі, 7 — кнопка */
  .kp-gallery       { order: 3; }
  .kp-photo         { order: 2; }
  .kp-content       { display: contents; }
  .kp-title         { order: 1; }
  .kp-prices        { order: 4; }
  .kp-similar-label { order: 5; }
  .kp-similar-row   { order: 6; }
  .kp-btn           { order: 7; }

  /* Фото */
  .kp-photo {
    width: 100%;
    justify-content: center;
    padding: 8px 0;
  }
  .kp-photo img {
    max-width: 55vw;
    height: auto !important;
  }

  /* Заголовок */
  .kp-title {
    background: #faf7f2;
    padding: 12px 14px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
  }
  .kp-title h1 {
    font-size: 16px;
    text-align: center;
    margin: 0 0 8px !important;
    color: #3b2a1a;
  }
  .kp-title .kp-desc {
    font-size: 15px;
    text-align: justify;
  }

  /* Галерея */
  .kp-gallery {
    width: 100%;
    background: #f0e9dc;
    padding: 10px 0 10px 14px;
    justify-content: flex-start;
    align-items: flex-start;
  }
  .kp-gallery h3 {
    font-size: 13px;
    text-align: center;
    margin: 0 0 8px;
    color: #3b2a1a;
    width: 100%;
    padding-right: 14px;
  }
  .kp-gallery-grid {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    align-items: center;
    flex: unset;
    padding-bottom: 6px;
    width: 100%;
  }
  .kp-gallery-row {
    flex-shrink: 0;
  }
  .kp-gallery-row img {
    height: 110px !important;
    width: auto;
    margin: 2px !important;
  }

  /* Ціни */
  .kp-prices {
    width: 100%;
    padding: 12px 14px;
    box-sizing: border-box;
  }
  .kp-prices .price-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  .kp-prices table {
    min-width: 340px;
  }
  .kp-prices-note {
    font-size: 14px;
    text-align: center;
    background: #f0e9dc;
    padding: 8px;
    margin-top: 6px;
  }

  /* Схожі моделі */
  .kp-similar-label {
    height: unset;
    padding: 10px 14px 4px;
    width: 100%;
    box-sizing: border-box;
  }
  .kp-similar-row {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding: 0 0 6px 14px;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
  }
  .kp-similar-row a {
    display: inline-block;
    width: auto;
    flex-shrink: 0;
  }
  .kp-similar-row img {
    height: 120px;
    width: auto;
  }

  /* Кнопка */
  .kp-btn {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px 6px;
  }

}

/* Применяется только для экранов шириной от 1025px (компьютеры и ноутбуки) */
@media (min-width: 1025px) {
  .site-header {
    position: relative !important; /* Убирает фиксацию */
    top: auto !important;
  }
}}
