/* OCF — Фільтри товарів */
.ocf-content { width: 280px; flex-shrink: 0; background: var(--base); border-radius: var(--radius-12); border: 1px solid var(--border-color); box-shadow: var(--shadow-card); overflow: hidden; }
.ocf-content.filters { padding: 0; }
.ocf-clearfix::after { content: ''; display: table; clear: both; }
.ocf-header { display: flex; align-items: center; gap: 0.5rem; padding: 1rem 1.25rem; font-weight: 700; font-size: 1rem; border-bottom: 1px solid var(--border-color); background: var(--base); }
.ocf-header .ocf-close-mobile { display: none; margin-left: auto; }
.ocf-body { padding: 0 0 1rem;  overflow-y: auto; }
.ocf-filter-list { padding: 0; }
.ocf-filter { border-bottom: 1px solid var(--border-color); }
.ocf-filter:last-child { border-bottom: none; }
.ocf-filter-body { padding: 0; }
.ocf-filter-header { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem; padding: 0.75rem 1.25rem; cursor: pointer; font-size: 0.9rem; transition: background 0.15s; }
.ocf-filter-header:hover { background: var(--neutral-50, #f9fafb); }
.ocf-filter-name { font-weight: 600; flex: 1; min-width: 0; }
.ocf-active-label { font-size: 0.8rem; color: var(--pr-links, #2563eb); font-weight: 500; margin-right: 0.25rem; }
.ocf-filter-header-append { display: flex; align-items: center; gap: 0.25rem; }
.ocf-filter-discard { cursor: pointer; opacity: 0.6; padding: 0.2rem; }
.ocf-filter-discard:hover { opacity: 1; color: var(--red, #dc2626); }
.ocf-filter.ocf-active .ocf-filter-discard { opacity: 1; }
.ocf-filter-toggle { cursor: pointer; padding: 0.2rem; transition: transform 0.2s; }
.ocf-filter-toggle:hover { opacity: 0.8; }
.ocf-value-list { padding: 0 1.25rem 0.75rem; }
.ocf-value-list-body { display: flex; flex-direction: column; gap: 0.15rem; }
.ocf-value { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0; cursor: pointer; font-weight: 400; font-size: 0.9rem; border: none; background: none; width: 100%; text-align: left; }
.ocf-value.ocf-disabled { cursor: not-allowed; opacity: 0.5; }
.ocf-value:not(.ocf-disabled):hover { color: var(--pr-links); }
.ocf-value-input-checkbox { flex-shrink: 0; width: 16px; height: 16px; border: 2px solid var(--border-color); border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.ocf-value.ocf-selected .ocf-value-input-checkbox { background: var(--pr-links, #2563eb); border-color: var(--pr-links); }
.ocf-value.ocf-selected .ocf-value-input-checkbox::after { content: ''; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-bottom: 2px; }
.ocf-value-name { flex: 1; min-width: 0; }
.ocf-value-append { flex-shrink: 0; font-size: 0.8rem; color: var(--neutral-500); }
.ocf-value-input-hidden { position: absolute; opacity: 0; pointer-events: none; }

/* Icons */
.ocf-icon { display: inline-block; }
.ocf-icon-16 { width: 16px; height: 16px; }
.ocf-sliders { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cline x1='4' y1='21' x2='4' y2='14'/%3E%3Cline x1='4' y1='10' x2='4' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12' y2='3'/%3E%3Cline x1='20' y1='21' x2='20' y2='16'/%3E%3Cline x1='20' y1='12' x2='20' y2='3'/%3E%3Cline x1='1' y1='14' x2='7' y2='14'/%3E%3Cline x1='9' y1='8' x2='15' y2='8'/%3E%3Cline x1='17' y1='16' x2='23' y2='16'/%3E%3C/svg%3E") center/contain no-repeat; }
.ocf-times { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") center/contain no-repeat; }
.ocf-minus-circle { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='8' y1='12' x2='16' y2='12'/%3E%3C/svg%3E") center/contain no-repeat; }
.ocf-angle-right { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E") center/contain no-repeat; width: 12px; height: 12px; }
.ocf-angle-down { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat; width: 12px; height: 12px; display: inline-block; vertical-align: middle; }
.ocf-angle-up { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M18 15l-6-6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; width: 12px; height: 12px; display: inline-block; vertical-align: middle; }
.ocf-info-circle { width: 14px; height: 14px; display: inline-block; vertical-align: middle; margin-left: 0.25rem; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E") center/contain no-repeat; cursor: help; opacity: 0.7; }
.ocf-info-circle:hover { opacity: 1; }
.ocf-filter-info-trigger { cursor: pointer; display: inline-flex; align-items: center; }
.ocf-filter-info-popover { position: absolute; z-index: 1060; max-width: 420px; min-width: 260px; padding: 0.75rem 1rem; background: var(--base); border: 1px solid var(--border-color); border-radius: var(--radius-8); box-shadow: var(--shadow-card); font-size: 0.875rem; line-height: 1.5; }
.ocf-filter-info-popover .tooltip__desc { margin: 0; }
.ocf-filter-info-popover .tooltip__desc p { margin: 0 0 0.5em 0; }
.ocf-filter-info-popover .tooltip__desc p:last-child { margin-bottom: 0; }
.ocf-filter-info-popover .tooltip__desc-width { max-width: 100%; }

/* Price slider */
.ocf-slider-input-group { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.ocf-form-control { flex: 1; min-width: 0; padding: 0.5rem 0.75rem; border: 1px solid var(--border-color); border-radius: var(--radius-8); font-size: 0.9rem; }
.ocf-input-group-addon { color: var(--neutral-500); font-size: 0.9rem; }
.ocf-value-slider { padding: 0.5rem 0; }
.ocf-noUi-target { height: 6px; background: var(--neutral-200); border-radius: 3px; position: relative; }
.ocf-noUi-connect { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--pr-links, #2563eb); border-radius: 3px; }
.ocf-noUi-handle { position: absolute; top: 50%; width: 18px; height: 18px; margin-left: -9px; margin-top: -9px; background: #fff; border: 2px solid var(--pr-links); border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,0.2); cursor: grab; z-index: 2; }
.ocf-noUi-handle:active { cursor: grabbing; }
.ocf-noUi-handle::before { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 8px; height: 8px; background: var(--pr-links); border-radius: 50%; }
.ocf-noUi-handle-lower { left: 0; }
.ocf-noUi-handle-upper { left: 100%; margin-left: -9px; }

/* Collapse */
.ocf-collapse-value { display: none; }
.ocf-collapse-value.ocf-show { display: flex; flex-direction: column; gap: 0.15rem; }
.ocf-btn-show-values { font-size: 0.85rem; color: var(--pr-links); padding: 0.35rem 0; margin-top: 0.25rem; }
.ocf-btn-show-values .ocf-hide-expand-0 { display: none; }
.ocf-btn-show-values[aria-expanded="true"] .ocf-hide-expand-1 { display: none; }
.ocf-btn-show-values[aria-expanded="true"] .ocf-hide-expand-0 { display: inline; }

/* Footer */
.ocf-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border-color); background: var(--neutral-50, #f9fafb); }
.ocf-btn-reset-mobile {
  display: none;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--neutral-100, #f3f4f6);
  color: var(--neutral-700, #374151);
  font-size: 0.85rem;
  font-weight: 500;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: background 0.2s;
}
.ocf-btn-reset-mobile:hover { background: var(--neutral-200, #e5e7eb); }
@media (max-width: 991px) {
  .ocf-btn-reset-mobile { display: flex; }
}
.ocf-between { display: flex; align-items: center; gap: 0.75rem; }
.ocf-btn { border: none; background: none; cursor: pointer; font-size: 0.9rem; }
.ocf-btn-link { color: var(--pr-links); display: inline-flex; align-items: center; gap: 0.35rem; }
.ocf-btn-link:hover { text-decoration: underline; }
.ocf-btn-block { flex: 1; padding: 0.6rem 1rem; background: var(--pr-links, #2563eb); color: #fff; font-weight: 600; border-radius: var(--radius-8); text-align: center; }
.ocf-btn-block:hover { opacity: 0.9; }
.ocf-search-btn-static { min-width: 140px; }

/* noUiSlider overrides */
.ocf-value-slider .noUi-target { height: 6px; border: none; background: var(--neutral-200,#e5e7eb); border-radius: 3px; }
.ocf-value-slider .noUi-connect { background: var(--pr-links,#2563eb); border-radius: 3px; }
.ocf-value-slider .noUi-handle { width: 18px; height: 18px; top: -7px; right: -9px; border: 2px solid var(--pr-links); border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.ocf-value-slider .noUi-handle::before, .ocf-value-slider .noUi-handle::after { display: none; }

/* Кнопка «Показати N» — зʼявляється біля фільтра, на який натиснули */
.catalog-filter-apply-wrapper { margin-top: 0.75rem; }
.catalog-filter-apply-wrapper .catalog-filter-apply-btn { width: 100%; }

/* Мобільна панель фільтрів: кнопка + виїжджаюча панель зліва */
@media (max-width: 991px) {
  .ocf-filter-info-trigger { display: none !important; }
  .catalog-layout { flex-direction: column; }
  .ocf-header .ocf-close-mobile { display: flex; align-items: center; margin-left: auto; }
  .ocf-mobile { display: none !important; }
  .ocf-header .ocf-close-mobile { display: flex !important; }

  /* Кнопка «Фільтр товарів» — тільки на мобільних */
  .catalog-filter-mobile-btn { display: flex !important; align-items: center; justify-content: center; }
  .catalog-filter-mobile-btn .pr-btn-text { margin-left: 0.25rem; }

  /* Overlay */
  .catalog-filters-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }
  .catalog-layout.catalog-filters-open .catalog-filters-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Панель фільтрів — fixed, виїжджає зліва */
  .catalog-filters-panel.ocf-content.filters {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(320px, 85vw);
    max-width: 320px;
    height: 100vh;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-radius: 0;
    border-left: none;
    border-top: none;
    border-bottom: none;
    display: flex;
    flex-direction: column;
  }
  .catalog-filters-panel.ocf-content.filters .ocf-header { flex-shrink: 0; }
  .catalog-filters-panel.ocf-content.filters form {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .catalog-filters-panel.ocf-content.filters .ocf-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
  }
  .catalog-filters-panel.ocf-content.filters .ocf-footer,
  .catalog-filters-panel.ocf-content.filters .catalog-filter-apply-wrapper { flex-shrink: 0; }
  .catalog-layout.catalog-filters-open .catalog-filters-panel {
    transform: translateX(0);
  }

  /* Ховаємо сайдбар з потоку на мобільних — він тільки в overlay */
  .catalog-layout .catalog-filters-panel { display: flex; }
}

@media (min-width: 992px) {
  .catalog-filter-mobile-btn { display: none !important; }
  .catalog-filters-overlay { display: none !important; }
}

.noUi-horizontal .noUi-handle {
  width: 24px !important;
  height: 24px !important;
  right: -17px !important;
  top: -9px !important;
}

/* Каталог: код і наявність в один рядок (десктоп) */
.pr-category-products .pr-module-item.product-grid .pr-module-item-info {
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.5rem !important;
  min-width: 0;
}
/* Сортування — стиль як в акціях */
.catalog-main .pr-category-sort-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.catalog-main .pr-category-sort-select {
  min-width: 180px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--neutral-500, #6b7280);
}
.catalog-main .pr-category-sort-select.form-select {
  border-width: 2px;
  padding: 0.5rem 2rem 0.5rem 1rem;
}
@media (max-width: 480px) {
  .catalog-main .pr-category-sort-select { min-width: 140px; }
}

.pr-category-products .pr-module-item.product-grid .pr-module-item-info .pr-stock-sticker {
  flex-shrink: 0;
}
/* Шильдик «В магазині» — оранжева плашка з білим текстом */
.pr-category-products .pr-stock-sticker.in-store,
.pr-stock-sticker.in-store {
  background: #E85D04;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 100px;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
}
.pr-stock-sticker.in-store i {
  color: #fff;
}
.pr-category-products .pr-module-item.product-grid .pr-module-item-info .pr-module-item-info-code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Мобільна: код товару на новий рядок (перевизначає base для каталогу) */
@media (max-width: 991px) {
  .pr-category-products .pr-module-item.product-grid .pr-module-item-info {
    flex-wrap: wrap !important;
  }
  .pr-category-products .pr-module-item.product-grid .pr-module-item-info .pr-module-item-info-code {
    flex: 1 1 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
}

/* Каталог: характеристики при ховері без дёргання картки */
.pr-category-products .pr-module-item.product-grid {
  position: relative;
  overflow: visible;
}
.pr-category-products .pr-module-item.product-grid:hover {
  overflow: visible;
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}
.pr-category-products .pr-module-item.product-grid .pr-module-attributes {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 10;
  margin: 0rem;
  padding: 0 1rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease, visibility 0.2s ease, padding 0.2s ease, box-shadow 0.2s ease;
  background: var(--pr-white-color, #fff);
  border-radius: 0 0 0.75rem 0.75rem;
}
.pr-category-products .pr-module-item.product-grid:hover .pr-module-attributes {
  max-height: 200px;
  overflow: visible;
  opacity: 1;
  visibility: visible;
  padding: 0.75rem 1rem 1rem;
  box-shadow: 0 2px 4px rgba(40,41,61,.04), 0 4px 16px hsla(233,4%,45%,.02);
}
/* Обмеження довгих значень атрибутів у картках товарів (каталог, акції, пошук) */
.pr-module-item.product-grid .pr-module-attributes-item {
  min-width: 0;
  overflow: hidden;
}
.pr-module-item.product-grid .pr-module-attributes-item > span:last-child {
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Свачі кольорів варіантів у картці товару */
.pr-module-item-variant-colors.variant-attr-options .variant-attr-btn.variant-attr-color {
  width: 22px;
  height: 22px;
  padding: 0;
  min-width: 22px;
}
.pr-module-item-variant-colors.variant-attr-options .variant-attr-btn.variant-attr-color .variant-color-swatch {
  width: 22px;
  height: 18px;
  border-radius: 4px;
}

/* ── Обрані фільтри: чипи над списком ─────────────────────────────────── */
.ocf-chosen {
  padding: 0.75rem 1.25rem 0.9rem;
  border-bottom: 1px solid var(--neutral-200, #e5e7eb);
  background: var(--neutral-50, #f9fafb);
}
.ocf-chosen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.ocf-chosen-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--neutral-600, #4b5563);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.ocf-chosen-clear {
  border: 0;
  background: none;
  padding: 0;
  font-size: 0.78rem;
  color: var(--pr-links, #2563eb);
  cursor: pointer;
  white-space: nowrap;
}
.ocf-chosen-clear:hover { text-decoration: underline; }
.ocf-chosen-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ocf-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.28rem 0.5rem 0.28rem 0.6rem;
  border: 1px solid var(--pr-links, #2563eb);
  border-radius: 999px;
  background: #fff;
  color: var(--pr-links, #2563eb);
  font-size: 0.78rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ocf-chip:hover { background: var(--pr-links, #2563eb); color: #fff; }
.ocf-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 15rem;
}
.ocf-chip-x { font-size: 1rem; line-height: 1; opacity: 0.7; }
.ocf-chip:hover .ocf-chip-x { opacity: 1; }

/* Лічильник обраних значень у заголовку секції — замість довгого переліку,
   який налазив на назву фільтра. */
.ocf-active-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--pr-links, #2563eb);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  flex: 0 0 auto;
  order: 2;
}
.ocf-filter-name { order: 1; }
.ocf-filter-header-append { order: 3; }
/* Ціна й наявність показують коротке значення — лишаємо, але не даємо
   йому розсувати заголовок. */
.ocf-active-label {
  order: 2;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
