/* ===========================
   Категорія з фільтрами (templates/store/store.html, filters.html), префікс cp-
   Картки товарів — home.css, вигляд чекбоксів — filters-modern.css
   =========================== */

/* Шапка */
.cp-head { padding-top: 16px; padding-bottom: 4px; display: grid; gap: 10px; }
.cp-crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13.5px; color: #8a8ea6; }
.cp-crumbs a { color: #8a8ea6; text-decoration: none; }
.cp-crumbs a:hover { color: #4f5bd5; }
.cp-crumbs span { color: #c7c9d6; }
.cp-crumbs b { font-weight: 500; color: #4b4f66; }
.cp-h-row h1 { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-size: 36px; line-height: 1.15; color: #1f2133; text-wrap: balance; }
.cp-h-row h1 small { margin-left: 8px; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 16px; font-weight: 600; color: #8a8ea6; white-space: nowrap; }
.cp-types { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cp-types::-webkit-scrollbar { display: none; }
.cp-type { flex: none; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid #e6e8f0; font-weight: 700; font-size: 14px; color: #1f2133; text-decoration: none; transition: border-color .15s; }
.cp-type:hover { border-color: #c7cdf5; color: #1f2133; text-decoration: none; }
.cp-type small { margin-left: 2px; font-size: 12.5px; font-weight: 600; color: #8a8ea6; }
.cp-type.is-on { color: #fff; border-color: transparent; background: linear-gradient(120deg, #667eea, #764ba2); }
.cp-type.is-on small { color: rgba(255, 255, 255, .8); }

/* Розкладка: фільтри зліва, товари справа */
.cp-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 14px; }
.cp-main { min-width: 0; }
.cp-side { position: sticky; top: 88px; flex-direction: column; max-height: calc(100vh - 110px); border-radius: 20px; background: #fff; border: 1px solid #eceef5; overflow: hidden; }
.cp-side-in { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px; }
/* Кнопка застосування: схована, доки фільтри не змінили; потім прилипає до низу екрана під колонкою (JS ставить left/width) */
.cp-side-go { display: none; }
.cp-side.is-dirty .cp-side-go { position: fixed; bottom: 16px; z-index: 900; display: grid; justify-items: center; gap: 6px; padding: 12px; border-radius: 18px; background: #fff; border: 1px solid #e6e8f0; box-shadow: 0 14px 34px rgba(30, 20, 80, .18); animation: cpGoIn .25s ease; }
.cp-side.is-dirty .cp-side-go .cp-reset { font-size: 13px; }
@keyframes cpGoIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.cp-go { width: 100%; height: 48px; border: 0; border-radius: 14px; color: #fff; font-weight: 900; font-size: 15.5px; background: linear-gradient(120deg, #667eea, #764ba2); box-shadow: 0 10px 22px rgba(102, 126, 234, .3); cursor: pointer; transition: opacity .15s, transform .15s; }
.cp-go:hover:not(:disabled) { transform: translateY(-1px); }
.cp-go.is-loading { opacity: .7; }
.cp-go:disabled { opacity: .5; cursor: default; box-shadow: none; }

/* Фільтри всередині колонки й панелі — без «карток» Bootstrap */
.cp-side .card, .cp-sheet .card { border: 0; background: none; box-shadow: none; }
.cp-side .filter-group, .cp-sheet .filter-group { border-bottom: 1px solid #f0f1f6; padding: 8px 0; margin: 0; }
.cp-side .filter-group:last-child, .cp-sheet .filter-group:last-child { border-bottom: 0; }
.cp-side .card-header, .cp-sheet .card-header { padding: 4px 0; background: none; border: 0; }
.cp-side .card-header .btn-link, .cp-sheet .card-header .btn-link { color: #1f2133 !important; text-align: left; gap: 8px; }
.cp-side .card-header .title, .cp-sheet .card-header .title { flex: 1; min-width: 0; font-size: 15px; font-weight: 800 !important; color: #1f2133; text-transform: none; letter-spacing: 0; text-align: left; }
.cp-side .card-header .icon-control, .cp-sheet .card-header .icon-control { font-size: 11px; color: #a3a7bd; }
.cp-side .card-body, .cp-sheet .card-body { padding: 6px 0 4px; }
.cp-side .toggle-btn, .cp-sheet .toggle-btn { padding: 4px 6px; font-weight: 700; font-size: 13.5px; color: #4f5bd5; text-decoration: none; }
.cp-fsearch { width: 100%; height: 38px; margin-bottom: 6px; padding: 0 12px; border-radius: 10px; border: 1.5px solid #e2e5f0; background: #f6f7fb; font-size: 14px; color: #1f2133; }
.cp-fsearch:focus { outline: none; border-color: #667eea; background: #fff; }
/* Пошук бренду ховає зайві пункти; правило сильніше за «.form-check { display: flex !important }» з filters-modern.css */
.cp-hide,
#filters-form-desktop .form-check.cp-hide,
.filters-form-instance .form-check.cp-hide { display: none !important; }

/* Над товарами: обрані фільтри й сортування */
.cp-tools { margin-bottom: 14px; }
.cp-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.cp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.cp-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 10px 6px 12px; border-radius: 999px; background: #eef0ff; color: #4f5bd5; font-weight: 700; font-size: 13.5px; text-decoration: none; overflow-wrap: anywhere; }
.cp-chip:hover { background: #e0e4ff; color: #3f47a8; text-decoration: none; }
.cp-chip span { font-size: 11px; }
.cp-reset { color: #8a8ea6; font-size: 13.5px; font-weight: 700; text-decoration: underline; }
.cp-reset:hover { color: #dc2626; }
.cp-sort { align-items: center; gap: 6px; margin: 0 0 0 auto; padding: 0 4px 0 12px; height: 40px; border-radius: 12px; background: #fff; border: 1px solid #e6e8f0; font-size: 14px; color: #6b6f86; white-space: nowrap; }
.cp-sort select { height: 38px; border: 0; background: none; font-weight: 700; font-size: 14px; color: #1f2133; cursor: pointer; }
.cp-sort select:focus { outline: none; }

/* SEO-текст під товарами */
.cp-seo { margin-top: 28px; margin-bottom: 28px; }
.cp-seo-in { max-width: 860px; padding: 20px 22px; border-radius: 18px; background: #fff; border: 1px solid #eceef5; color: #4b4f66; font-size: 14.5px; line-height: 1.6; }

/* Телефон: панель «Фільтри | Сортування» */
.cp-mbar { position: sticky; top: 64px; z-index: 20; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; padding: 8px 0; background: #f6f7fb; transition: top .25s; }
body:has(.main-navbar.hidden) .cp-mbar { top: 0; }
.cp-mf, .cp-ms select { width: 100%; height: 42px; border-radius: 12px; border: 1px solid #e2e5f0; background: #fff; font-weight: 800; font-size: 14px; color: #1f2133; }
.cp-mf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.cp-ms { margin: 0; }
.cp-ms select { padding: 0 10px; text-align: center; text-align-last: center; -webkit-appearance: none; appearance: none; }
.cp-badge { place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; font-size: 11.5px; font-weight: 800; color: #fff; background: #667eea; }

/* Телефон: фільтри на весь екран */
.cp-sheet.mobile-filter-panel { display: flex; flex-direction: column; overflow: hidden; z-index: 2002; background: #fff; }
.cp-sheet-h { flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); border-bottom: 1px solid #eceef5; }
.cp-sheet-h b { flex: 1; font-size: 18px; color: #1f2133; }
.cp-sheet-x { width: 40px; height: 40px; border: 0; border-radius: 12px; background: #f2f3f8; font-size: 16px; color: #4b4f66; cursor: pointer; }
.cp-sheet-b { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 16px !important; }
.cp-sheet-f { flex: none; padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #eceef5; box-shadow: 0 -8px 18px rgba(30, 20, 80, .06); }

@media (max-width: 1199px) {
  .cp-grid { grid-template-columns: 250px minmax(0, 1fr); gap: 18px; }
}
@media (max-width: 991px) {
  .cp-head { padding-top: 52px; }  /* шапка на телефоні фіксована поверх сторінки */
}
@media (max-width: 767px) {
  .cp-grid { grid-template-columns: minmax(0, 1fr); margin-top: 8px; }
  .cp-side { display: none !important; }
  .cp-h-row h1 { font-size: 26px; }
  .cp-h-row h1 small { display: block; margin: 4px 0 0; font-size: 14px; }
  .cp-bar { gap: 8px; }
  .cp-chip { font-size: 13px; }
}
