:root {
  --bg: oklch(98% 0.005 85);
  --surface: oklch(100% 0 0);
  --fg: oklch(20% 0.02 240);
  --muted: oklch(54.4% 0.016 244.5);
  --border: oklch(90% 0.01 85);
  --accent: oklch(76.24% 0.17 141.56);
  --accent-dark: oklch(65% 0.15 141);
  --nav: oklch(30.6% 0.033 241.67);
  --soft: oklch(95% 0.05 142);
  --danger: #b4493f;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --radius: 4px;
  --pill: 100px;
  color-scheme: light;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

[hidden] {
  display: none !important;
}

[x-cloak] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding-bottom: 20px;
}

/* TOPBAR / RIBBON */
.site-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #f8f8f8;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.site-ribbon a {
  color: inherit;
  text-decoration: none;
}

.site-ribbon a:hover {
  color: var(--accent);
}

/* MAIN HEADER */
.main-header {
  padding: 20px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand-logo img {
  display: block;
  width: 180px;
  height: auto;
}

.search-form {
  flex: 1;
  min-width: 280px;
  position: relative;
  max-width: 600px;
}

.search-form input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: #fff;
  outline: none;
}

.search-form button {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: #a3a3a3;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  width: auto;
  border-radius: 0;
  transition: color 0.2s ease;
}

.search-form button:hover {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.cart-btn-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--nav);
  color: var(--nav);
  position: relative;
  transition: all 0.2s ease;
  background: var(--surface);
  text-decoration: none;
  cursor: pointer;
}

.cart-btn-circle:hover {
  background: var(--bg);
  transform: scale(1.05);
  box-shadow: var(--shadow);
}

.cart-btn-circle svg {
  width: 20px;
  height: 20px;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent);
  color: #fff;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1.5px solid var(--surface);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* NAVIGATION MENU */
.nav-box {
  background: var(--nav);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}

.category-nav-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  position: relative;
}

.nav-container {
  flex: 1;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.nav-container::-webkit-scrollbar {
  display: none;
}

.nav-scroll-btn {
  width: 44px;
  height: 44px;
  background: var(--nav);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border: none;
  cursor: pointer;
  opacity: 0.9;
  flex-shrink: 0;
}

.nav-scroll-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,0.15);
}

.nav-scroll-btn.prev {
  border-right: 1px solid rgba(255,255,255,0.1);
}

.nav-scroll-btn.next {
  border-left: 1px solid rgba(255,255,255,0.1);
}

.nav-item {
  padding: 12px 20px;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 500;
  font-size: 14px;
}

.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,0.1);
}

/* SUBCATEGORY STRIP */
.subcategory-shell {
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.subcategory-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  background: #f0f0f0;
  border-radius: var(--pill);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  /* Чип буває і <button>, і <a> (коли веде на ЧПУ-сторінку). У <a> браузерні
     стилі інші — прибираємо підкреслення, синій колір і рамку. */
  border: none;
  font-family: inherit;
  line-height: 1.3;
  white-space: nowrap;
  text-decoration: none;
  color: var(--fg);
  transition: background .18s ease, color .18s ease;
}

.chip:hover {
  background: #e2e2e2;
}

.chip.active {
  background: var(--accent);
  color: #fff;
}

.chip.active:hover {
  background: var(--accent-dark);
}

.chip.active {
  background: var(--accent);
  color: #fff;
}

/* CATALOG */
main {
  padding: 4px 12px;
}

.catalog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.catalog-head > div {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

/* ⚠️ У шаблонах трапляється і <h1>, і <h2> з id="catalogTitle"
   (category.php — h1, home.php — h2), тому покриваємо ОБИДВА.
   Раніше селектор був лише h2 — на сторінках категорій правило не діяло,
   і заголовок рендерився дефолтними 32px з відступами по 21px
   (через це рядок «Всього N товарів» був заввишки 100px). */
.catalog-head h1,
.catalog-head h2 {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.01em;
  margin: 0;
  white-space: nowrap;
}

.catalog-head p {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
}

.ghost-button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--pill);
  font-size: 11px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  grid-auto-rows: 1fr;
  gap: 12px;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.in-stock {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge.out-of-stock {
  background: #ffebee;
  color: #c62828;
}

.badge.preorder {
  background: #fff3e0;
  color: #e65100;
}

.onsale {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #ff6900;
  color: #fff;
  padding: 4px 12px;
  border-radius: var(--pill);
  font-size: 11px;
  font-weight: 700;
  z-index: 10;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease;
  height: 100%;
  /* Дозволяє картці стискатись в grid-колонці менше мінімальної ширини контенту */
  min-width: 0;
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.product-image-wrapper {
  width: 100%;
  height: 160px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Фото картки — це посилання на сторінку товару (міні-картки/шторки немає).
   Прибираємо браузерне підкреслення й синій колір. */
a.product-image-wrapper {
  text-decoration: none;
  color: inherit;
}
a.product-image-wrapper .product-image {
  transition: transform .22s ease;
}
a.product-image-wrapper:hover .product-image {
  transform: scale(1.04);
}

.product-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
  height: 2.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0 0 12px 0;
  cursor: pointer;
  /* Довгі слова переносяться, щоб не розширювати колонку за межі екрана */
  overflow-wrap: anywhere;
}

.product-name:hover {
  color: var(--accent);
}

.product-meta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  /* На вузьких екранах бейдж (напр. «Під замовлення») переноситься на новий рядок,
     а не розширює картку/сторінку */
  flex-wrap: wrap;
}

.product-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
  white-space: nowrap;
}

.description-btn {
  height: 32px;
  padding: 0 12px;
  background: #f5f5f5;
  color: var(--fg);
  border-radius: var(--pill);
  font-weight: 600;
  font-size: 12px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.description-btn:hover {
  background: #eee;
}

.buy-icon-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: var(--soft);
  color: var(--accent-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.buy-btn {
  flex: 1;
  height: 40px;
  /* Кнопка може бути як <button>, так і <a> (коли є affiliate_url).
     У <a> немає браузерного центрування тексту, тому центруємо самі. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  line-height: 1.2;
  padding: 0 20px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--pill);
  font-weight: 600;
  font-size: 14px;
  /* Посилання «Купити» веде на сайт-донора — не «світимо» його домен
     в рядку стану браузера при наведенні. Клік працює як звичайно. */
  -webkit-user-select: none;
  user-select: none;
}

.buy-btn:hover {
  background: var(--accent-dark);
}

.buy-btn:disabled {
  background: #c9c9c9;
  cursor: not-allowed;
}
.buy-btn:disabled:hover {
  background: #c9c9c9;
}

/* Артикул (сторінка товару / шторка / корзина) */
.detail-sku {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* Бейдж статусу на картці товару */
.product-card .badge {
  font-size: 9px;
  padding: 3px 8px;
  white-space: nowrap;
}

.detail-image-box {
  width: 100%;
  height: 320px;
  background: #fff;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.detail-image-box img {
  width: 320px;
  height: 320px;
  object-fit: contain;
}

.detail-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-description {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  white-space: pre-wrap;
  line-height: 1.6;
}

.detail-specs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.detail-specs-table tr {
  border-bottom: 1px solid var(--border);
}

.detail-specs-table tr:nth-child(even) {
  background: #f1f5f9;
}

.detail-specs-table td {
  padding: 10px 16px;
}

.detail-specs-table tr:last-child {
  border-bottom: none;
}

.detail-specs-table td:first-child {
  color: var(--muted);
  width: 40%;
  font-weight: 500;
  background: #f1f5f9;
}

.detail-specs-table td:last-child {
  font-weight: 600;
  text-align: right;
  color: var(--fg);
}

/* Вкладки «Опис» / «Характеристики» на сторінці товару */
.detail-more {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-dark);
  text-decoration: none;
}

.detail-more:hover {
  text-decoration: underline;
}

.detail-tabs {
  margin-top: 40px;
}

.detail-tabs-heading {
  font-size: 20px;
  margin: 0 0 12px 0;
}

.detail-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.detail-tab {
  padding: 10px 18px;
  margin-bottom: -1px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.detail-tab:hover {
  color: var(--fg);
}

.detail-tab.is-active {
  color: var(--fg);
  border-bottom-color: var(--accent-dark);
}

.detail-full-description {
  font-size: 14px;
  line-height: 1.7;
}

.detail-full-description p {
  margin: 0 0 16px 0;
}

.detail-full-description p:last-child {
  margin-bottom: 0;
}

.detail-tab-panel .detail-specs-table {
  margin: 0;
}

@media (max-width: 640px) {
  .detail-tabs-nav {
    gap: 0;
  }

  .detail-tab {
    flex: 1;
    padding: 10px 12px;
    text-align: center;
  }
}

/* CART */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.cart-item-info h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px 0;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qty-control {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border-radius: var(--pill);
  padding: 2px;
  gap: 6px;
}

.qty-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  font-size: 14px;
}

.qty-val {
  min-width: 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.cart-item-total {
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-dark);
}

.order-form {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-form label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.order-form input, .order-form textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  font-size: 14px;
}

.order-form input:focus {
  border-color: var(--accent);
}


.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.cart-total span {
  font-size: 14px;
  color: var(--muted);
}

.cart-total strong {
  font-size: 20px;
  font-weight: 800;
}

.add-to-cart-btn {
  width: 100%;
  height: 44px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--pill);
  font-weight: 700;
  font-size: 15px;
}

/* MOBILE OPTIMIZATIONS */
@media (max-width: 600px) {
  .header-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }

  .brand-logo {
    order: 1;
    flex: 0 1 auto;
  }

  .brand-logo img {
    width: 140px;
  }

  /* ⚠️ order обов'язковий: без нього .header-tools має order:0 і стає
     ПЕРЕД лого (у якого order:1) — лого з'їжджає вправо. */
  .header-tools {
    order: 2;
    flex: 0 0 auto;
    gap: 8px;
    margin-left: 0;
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0;
  }

  .main-header {
    padding: 12px 16px;
  }

  .catalog-head {
    flex-wrap: wrap;
  }
}

/* BREADCRUMBS */
.breadcrumbs {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
  padding: 8px 0;
}
.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}
.breadcrumbs a:hover {
  color: var(--accent);
}

/* PRODUCT DETAIL PAGE */
.product-detail-page {
  margin-top: 16px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 20px;
  /* Колонки однакової висоти: галерея не «звисає» нижче за блок з ціною */
  align-items: stretch;
}

/* ГАЛЕРЕЯ: велике фото + стрічка мініатюр знизу (як на оригіналі) */
.detail-gallery {
  min-width: 0;
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
}

.detail-main {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

/* Висоту задає права колонка: фото-бокс розтягується на вільне місце,
   стрічка мініатюр завжди притиснута до низу */
.detail-image-box--large {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 300px;
  aspect-ratio: auto;
  margin-bottom: 0;
  padding: 12px;
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
}

.detail-image-box--large .detail-main-img {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  object-fit: contain;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.25s ease;
}

.detail-image-box--large .detail-main-img.is-active {
  opacity: 1;
  visibility: visible;
}

/* Збільшення під курсором (як у Shopify-теми), тільки там, де є hover */
@media (hover: hover) and (pointer: fine) {
  .detail-image-box--large .detail-main-img.is-active:hover {
    transform: scale(1.8);
  }
}

/* Стрілки на головному фото — з'являються при наведенні */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease;
}

.detail-main:hover .gallery-arrow,
.gallery-arrow:focus-visible {
  opacity: 1;
}

.gallery-arrow:hover {
  background: #fff;
  color: var(--accent-dark);
}

.gallery-arrow--prev {
  left: 10px;
}

.gallery-arrow--next {
  right: 10px;
}

@media (hover: none) {
  .gallery-arrow {
    opacity: 1;
  }
}

/* Мініатюри — горизонтальна стрічка, активна підсвічується */
.detail-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}

.detail-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.detail-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.detail-thumb:hover {
  border-color: var(--accent);
}

.detail-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--accent) 35%, transparent);
}
.product-price--large {
  font-size: 28px;
}
.buy-btn--large {
  width: 100%;
  height: 48px;
  font-size: 16px;
  margin-top: 16px;
}
.detail-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}
.detail-actions .buy-btn--large {
  flex: 1;
  margin-top: 0;
}

/* --- Два джерела покупки: AliExpress + сайт виробника ---------------------
   Кнопки стоять в один рядок і ділять ширину навпіл. На вузьких екранах
   (< 420px) переносяться одна під одну, щоб текст не обрізався. */
.buy-row {
  display: flex;
  flex: 1;
  gap: 12px;
  align-items: stretch;
}
.buy-row .buy-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 48px;
  margin-top: 0;
  gap: 8px;
  padding: 0 14px;
  font-size: 15px;
  white-space: nowrap;
}
.buy-btn-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}
.buy-btn > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* AliExpress — фірмовий оранжевий; купон на нього НЕ діє. */
.buy-btn--ali {
  background: #ff6a00;
}
.buy-btn--ali:hover {
  background: #e35d00;
}

/* Сайт виробника — основний колір сайту; саме на цю кнопку діє купон. */
.buy-btn--donor {
  position: relative;
}
/* Мітка знижки на кнопці виробника — одразу видно, де шукати купон. */
.buy-btn-tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--pill);
  background: #fff;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

@media (max-width: 420px) {
  .buy-row {
    flex-direction: column;
    gap: 10px;
  }
  /* На телефоні кнопки стоять одна під одною, тому 48px виглядали тонкими.
     54px — помітно зручніше для пальця, але рядок не роздувається.
     Мінімум за гайдлайнами — 44px (Apple) / 48dp (Material), тож 54 із запасом.

     ⚠️ `flex: 0 0 auto` ОБОВ'ЯЗКОВИЙ. Базове правило `.buy-btn` має `flex: 1`,
     тобто `flex-basis: 0%`. У колонковому контейнері flex-basis визначає
     ВИСОТУ й перебиває `height` — без скидання кнопки стискались до ~20px
     (висота рядка тексту), і `height: 54px` нічого не давав. */
  .buy-row .buy-btn {
    flex: 0 0 auto;
    width: 100%;
    height: 54px;
    font-size: 16px;
    padding: 0 16px;
  }
  .buy-btn-icon {
    width: 20px;
    height: 20px;
  }
}

/* Промо-блок з купоном на сторінці товару (коли «Купити» веде на сайт-донора) */
.promo-coupon {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 2px dashed var(--accent-dark);
  background: linear-gradient(135deg, var(--soft) 0%, var(--surface) 72%);
  box-shadow: 0 6px 18px color-mix(in oklch, var(--accent) 30%, transparent);
}

.promo-coupon-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 46px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.promo-coupon-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.promo-coupon-title {
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--fg);
}

.promo-coupon-text {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

/* Купон прив'язаний САМЕ до кнопки виробника — виділяємо це стрілкою
   вгору та кольоровим рядком «куди діє». */
.promo-coupon--donor {
  position: relative;
}
.promo-coupon--donor::before {
  content: "";
  position: absolute;
  top: -9px;
  right: 25%;
  width: 16px;
  height: 16px;
  transform: rotate(45deg);
  background: var(--soft);
  border-left: 2px dashed var(--accent-dark);
  border-top: 2px dashed var(--accent-dark);
  border-top-left-radius: 3px;
}
.promo-coupon-where {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--accent-dark);
}

.promo-coupon-code {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 6px 12px;
  border-radius: var(--pill);
  border: 1.5px dashed var(--accent-dark);
  background: var(--surface);
  color: var(--accent-dark);
  transition: background 0.2s ease, transform 0.2s ease;
}

.promo-coupon-code:hover {
  background: var(--soft);
  transform: translateY(-1px);
}

.promo-coupon-code-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.promo-coupon-code-hint {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}

/* Блок переваг під кнопкою «Купити» на сторінці товару */
.detail-benefits {
  list-style: none;
  margin: 16px 0 0;
  padding: 16px;
  display: grid;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.detail-benefit {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.detail-benefit-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-dark);
}

.detail-benefit-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Знак євро — це текстовий гліф, а не SVG */
.detail-benefit-icon--glyph {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.detail-benefit-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.detail-benefit-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--fg);
}

.detail-benefit-text {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}
.buy-icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.detail-specs-section {
  margin-top: 24px;
}
.detail-specs-section h2 {
  font-size: 20px;
  margin-bottom: 12px;
}
@media (max-width: 768px) {
  .detail-layout {
    /* ⚠️ minmax(0, 1fr), а НЕ 1fr: у `1fr` мінімальний розмір = auto, тому
       колонка розпиралася вмістом (галерея ставала 413px при екрані 390px)
       і вся сторінка товару їхала горизонтально. */
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }

  /* На мобільному галерея не «прилипає» і займає менше висоти */
  .detail-gallery {
    position: static;
  }

  /* Лента мініатюр скролиться сама — вона не має розпирати колонку. */
  .detail-thumbs {
    min-width: 0;
    max-width: 100%;
  }

  /* Довгі назви/значення переносяться, а не тягнуть ширину. */
  .detail-title,
  .detail-info,
  .detail-description,
  .detail-specs-table td {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  /* Рядок «ціна + наявність + SKU» на вузькому екрані не вміщується в один
     рядок, а .detail-sku має white-space: nowrap — через це сторінка їхала
     на 10px. Дозволяємо перенос і самому рядку, і SKU. */
  .detail-meta {
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .detail-sku {
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 0;
  }

  /* У одну колонку висоти правої частини немає, тому бокс знову квадратний */
  .detail-main {
    flex: 0 0 auto;
    display: block;
  }

  .detail-image-box--large {
    flex: 0 0 auto;
    aspect-ratio: 1 / 1;
    min-height: 0;
    max-height: 78vw;
    margin-inline: auto;
    width: 100%;
  }

  .detail-thumb {
    width: 62px;
    height: 62px;
  }
}

/* FOOTER */
.site-footer {
  width: min(1200px, 100%);
  margin: 20px auto 20px auto;
  background-color: var(--accent);
  color: #fff;
  padding: 24px 32px;
  border-radius: var(--radius);
}

/* Перша строка футера: посилання на статичні сторінки + Viber */
.footer-links-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0;
  position: relative;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.footer-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.9);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.footer-link:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.footer-link:hover::after {
  transform: scaleX(1);
}

.footer-link-viber {
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--pill);
  padding: 7px 16px;
  gap: 7px;
}

.footer-link-viber:hover {
  background: rgba(255, 255, 255, 0.28);
}

.footer-link-viber::after {
  display: none;
}

.footer-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-inner a {
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.footer-inner a:hover {
  opacity: 0.8;
}

.footer-inner svg {
  margin-left: 8px;
}

/* FOOTER MENU */
.footer-menu {
  background: var(--nav);
  color: #fff;
  padding: 32px 16px 24px;
  margin-top: 40px;
  border-bottom: 3px solid var(--accent);
}

.footer-menu-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-menu-caption {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.footer-menu-all {
  color: var(--accent);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.footer-menu-all:hover {
  text-decoration: underline;
}

.footer-menu-head-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Google Translate widget */
.translate-widget .goog-te-gadget {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}
.translate-widget .goog-te-gadget-simple {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 4px 10px;
  color: #fff;
}
.translate-widget .goog-te-gadget-simple .goog-te-menu-value {
  color: #fff;
}

/* Language switcher (flags) */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.lang-link:hover {
  color: #fff;
  transform: translateY(-1px);
}

.flag {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  display: inline-block;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.flag-ua {
  background: linear-gradient(180deg, #0057b7 50%, #ffd700 50%);
}

.flag-ru {
  background: linear-gradient(180deg, #fff 33.3%, #0039a6 33.3%, #0039a6 66.6%, #d52b1e 66.6%);
}

/* Флаг для ENG — американский */
.flag-en {
  position: relative;
  overflow: hidden;
  background: repeating-linear-gradient(
    180deg,
    #b22234 0%,
    #b22234 7.69%,
    #ffffff 7.69%,
    #ffffff 15.38%
  );
}
.flag-en::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 53.85%;
  background-color: #3c3b6e;
  background-image:
    radial-gradient(circle at 15% 16%, #fff 8%, transparent 9%),
    radial-gradient(circle at 45% 16%, #fff 8%, transparent 9%),
    radial-gradient(circle at 75% 16%, #fff 8%, transparent 9%),
    radial-gradient(circle at 30% 38%, #fff 8%, transparent 9%),
    radial-gradient(circle at 60% 38%, #fff 8%, transparent 9%),
    radial-gradient(circle at 90% 38%, #fff 8%, transparent 9%),
    radial-gradient(circle at 15% 60%, #fff 8%, transparent 9%),
    radial-gradient(circle at 45% 60%, #fff 8%, transparent 9%),
    radial-gradient(circle at 75% 60%, #fff 8%, transparent 9%),
    radial-gradient(circle at 30% 82%, #fff 8%, transparent 9%),
    radial-gradient(circle at 60% 82%, #fff 8%, transparent 9%),
    radial-gradient(circle at 90% 82%, #fff 8%, transparent 9%);
}

/* Флаг Франции — вертикальные полосы синий/белый/красный */
.flag-fr {
  background: linear-gradient(
    90deg,
    #002395 0%, #002395 33.33%,
    #ffffff 33.33%, #ffffff 66.66%,
    #ed2939 66.66%, #ed2939 100%
  );
}

/* Флаг Германии — горизонтальные полосы чёрный/красный/золотой */
.flag-de {
  background: linear-gradient(
    180deg,
    #000000 0%, #000000 33.33%,
    #dd0000 33.33%, #dd0000 66.66%,
    #ffce00 66.66%, #ffce00 100%
  );
}

/* Флаг Польши — горизонтальные полосы белый/красный */
.flag-pl {
  background: linear-gradient(
    180deg,
    #ffffff 0%, #ffffff 50%,
    #dc143c 50%, #dc143c 100%
  );
}

/* SCROLL TO TOP */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, background 0.2s ease;
  z-index: 900;
}

.to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.to-top:active {
  transform: translateY(0) scale(0.96);
}

.footer-menu-columns {
  column-width: 220px;
  column-gap: 36px;
}

.footer-menu-col {
  break-inside: avoid;
  margin-bottom: 22px;
}

/* Подгруппы третьего уровня под заголовком раздела */
.footer-menu-sublist {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 1px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  margin-left: 2px;
}

/* Уровень брендов (первый уровень навигации) */
.brand-nav-wrapper {
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  margin-bottom: 4px;
  padding-bottom: 4px;
}

.brand-nav-item {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.footer-menu-title {
  display: inline-block;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-menu-title:hover {
  color: var(--accent);
}

.footer-menu-link {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.5;
  padding: 2px 0;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-menu-link:hover {
  color: var(--accent);
  padding-left: 4px;
}

/* 404 PAGE */
.not-found {
  text-align: center;
  padding: 80px 20px 60px;
}

.not-found-code {
  font-size: 96px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin: 0 0 8px 0;
}

.not-found-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 12px 0;
}

.not-found-text {
  color: var(--muted);
  max-width: 420px;
  margin: 0 auto 28px auto;
  font-size: 14px;
}

.not-found-actions .buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  height: 44px;
  text-decoration: none;
}

@media (max-width: 600px) {
  .footer-menu {
    padding: 24px 16px 20px;
    margin-top: 24px;
  }
  .footer-menu-columns {
    column-width: 140px;
    column-gap: 20px;
  }
  .footer-menu-caption {
    font-size: 15px;
  }
  .footer-menu-head-right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .lang-switcher {
    gap: 10px;
  }
  .lang-link span:last-child {
    display: none;
  }
  .site-footer {
    padding: 18px 16px;
  }
  .footer-links-row {
    gap: 6px 18px;
  }
  .not-found-code {
    font-size: 72px;
  }
}

/* ==========================================================================
   ШАПКА: іконки пошуку та фільтрів (26.09.2026)
   Поле пошуку прибрано з шапки — залишились дві іконки праворуч від лого.
   ========================================================================== */
.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.header-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: #fff;
  color: var(--fg);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, transform .18s ease, box-shadow .2s ease;
}
.header-icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px color-mix(in oklch, var(--accent) 26%, transparent);
}
.header-icon-btn:active {
  transform: translateY(0) scale(.96);
}

.header-icon-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--pill);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}

/* --- Спільні анімації появи --- */
@keyframes overlay-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.anim-panel {
  transition: opacity .3s cubic-bezier(.22, 1, .36, 1),
              transform .3s cubic-bezier(.22, 1, .36, 1);
}
.anim-panel--from { opacity: 0; transform: translateY(-18px) scale(.97); }
.anim-panel--to   { opacity: 1; transform: translateY(0) scale(1); }

.anim-drawer {
  transition: transform .36s cubic-bezier(.22, 1, .36, 1);
}
.anim-drawer--from { transform: translateX(102%); }
.anim-drawer--to   { transform: translateX(0); }

/* ==========================================================================
   ОВЕРЛЕЙ ПОШУКУ
   Головна: ввід одразу фільтрує сітку.
   Категорії / товар: випадають плитки-підказки (фото + назва + ціна).
   ========================================================================== */
/* ==========================================================================
   ПОШУК У ХЕДЕРІ (замість попапа на весь екран)
   ==========================================================================
   Хедер заливається СВОЇМ же кольором + легке розмиття: логотип і кнопки
   лишаються позаду розмитими й неактивними, дизайн не псується. Форма
   виїжджає з точки лупи. Закриття: Enter · Esc · клік по залитій області.

   ⚠️ Раніше тут був `.search-overlay { position: fixed; inset: 0 }` — попап
   на весь екран, а на мобільному ще й повноекранна шторка
   (`.search-panel { min-height: 100% }`). Власник попросив переробити,
   щоб пошук жив усередині хедера.
   ========================================================================== */
.main-header {
  position: relative;   /* оверлей позиціонується відносно хедера */
  z-index: 60;          /* випадаючий список має бути над контентом сторінки */
}

.header-search {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: 20px 16px;
  /* Той самий колір, що й у хедера — тому виглядає як «заливка», а не пляма. */
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.main-header.is-searching .header-search {
  opacity: 1;
  pointer-events: auto;
}

/* Згорнута — розмір іконки; при відкритті роз'їжджається на всю ширину. */
.header-search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 48px;
  height: 48px;
  margin-left: auto;          /* ростемо від правого краю — «з лупи» */
  padding: 0 6px 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: #fff;
  overflow: hidden;
  opacity: 0;
  transition: width .34s cubic-bezier(.22,.61,.36,1), opacity .18s ease,
              box-shadow .22s ease, border-color .22s ease;
}
.main-header.is-searching .header-search-form {
  width: 100%;
  opacity: 1;
  border-color: var(--accent);
  box-shadow: 0 12px 30px color-mix(in oklch, var(--accent) 22%, transparent);
}
.header-search-icon {
  flex: 0 0 auto;
  color: var(--accent-dark);
}
.header-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  font-family: inherit;
  color: var(--fg);
}
.header-search-input::placeholder { color: var(--muted); }
/* Ховаємо нативний «хрестик» type=search — свій малюємо нижче. */
.header-search-input::-webkit-search-cancel-button,
.header-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.header-search-clear {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 14%, transparent);
  color: var(--fg);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease;
}
.header-search-clear:hover {
  background: color-mix(in srgb, var(--muted) 26%, transparent);
}
.header-search-submit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: var(--pill);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background .18s ease, transform .16s ease;
}
.header-search-submit:hover  { background: var(--accent-dark); }
.header-search-submit:active { transform: scale(.94); }

/* Випадаючий список збігів — НИЖЧЕ хедера, з прокруткою (60vh). */
.header-search-results {
  position: absolute;
  z-index: 3;
  top: 100%;
  left: 16px;
  right: 16px;
  max-height: 60vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin-top: 8px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .16);
}
.header-search-empty {
  margin: 0;
  padding: 18px 10px;
  font-size: 14px;
  color: var(--muted);
}
.header-search-hit {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background .16s ease;
}
.header-search-hit:hover { background: var(--soft); }
.header-search-hit-img {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.header-search-hit-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.header-search-hit-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-search-hit-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-dark);
}

/* ==========================================================================
   ПАНЕЛЬ ФІЛЬТРІВ (виїжджає справа)
   ========================================================================== */
.filters-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
}
.filters-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 24, 32, .46);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: overlay-fade-in .25s ease both;
}
.filters-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(430px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: -18px 0 50px rgba(0, 0, 0, .24);
}

.filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.filters-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}
.filters-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}
.filters-close:hover {
  color: var(--fg);
  border-color: var(--fg);
}

.filters-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.facet {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.facet:last-child { border-bottom: none; }
.facet-title {
  margin: 0 0 12px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.facet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.facet-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: #fff;
  color: var(--fg);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .14s ease;
}
.facet-chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.facet-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.facet-chip-count {
  font-size: 11.5px;
  font-weight: 700;
  opacity: .6;
}
.facet-chip.active .facet-chip-count { opacity: .88; }

.sort-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* Випадаючий список сортування.
   Раніше тут було три кнопки в стовпчик — вони займали три рядки й роздували
   панель фільтрів. Тепер один селект заввишки як чип. */
.sort-select-wrap {
  position: relative;
  display: block;
}
.sort-select {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  /* Стрілку малюємо своїм SVG — нативна в різних браузерах виглядає по-різному. */
  background-image: none;
  transition: border-color .18s ease;
}
.sort-select:hover { border-color: var(--accent); }
.sort-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.sort-select-arrow {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.facet-switch {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  position: relative;
}
.facet-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.facet-switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  border-radius: var(--pill);
  background: #d5dade;
  transition: background .22s ease;
}
.facet-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .22s cubic-bezier(.22, 1, .36, 1);
}
.facet-switch input:checked + .facet-switch-track { background: var(--accent); }
.facet-switch input:checked + .facet-switch-track .facet-switch-thumb { transform: translateX(20px); }
.facet-switch input:focus-visible + .facet-switch-track {
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 40%, transparent);
}

.filters-foot {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.filters-reset {
  flex: 0 0 auto;
  height: 48px;
  padding: 0 20px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: #fff;
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .18s ease;
}
.filters-reset:hover { border-color: var(--fg); }
.filters-apply {
  flex: 1;
  height: 48px;
  border: none;
  border-radius: var(--pill);
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s ease;
}
.filters-apply:hover { background: var(--accent-dark); }

/* ==========================================================================
   ФУТЕР: бренди над колонками розділів
   ========================================================================== */
.footer-brands {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.footer-brands-caption {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-brands-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: #fff;
  text-decoration: none;
  color: var(--fg);
  transition: border-color .2s ease, transform .18s ease, box-shadow .2s ease;
}
.footer-brand:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .07);
}
.footer-brand-name {
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.footer-brand-count {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 600px) {
  .header-tools {
    gap: 8px;
  }
  .header-icon-btn {
    width: 42px;
    height: 42px;
  }
  /* Пошук у хедері на телефоні: той самий вигляд, просто тісніше.
     ⚠️ Раніше тут було `min-height: 100%` — повноекранна шторка. */
  .header-search {
    padding: 14px 12px;
  }
  .header-search-form {
    height: 46px;
  }
  .header-search-results {
    left: 12px;
    right: 12px;
  }
  .filters-panel {
    width: 100%;
  }
  .footer-brands {
    gap: 10px 12px;
  }
}
