/* MJM theme — catalog page (категорія, пошук, акції, бренд). Значення — з mockups_html/Catalog.html */
.mjm-cat { display: flex; flex-direction: column; gap: 20px; width: 100%; }
.mjm-cat .mjm-grow { flex-grow: 1; }

/* ---------- заголовок ---------- */
.mjm-cat__head { display: flex; align-items: flex-end; gap: 14px; min-width: 0; }
.mjm-cat__head h1 { margin: 0; font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: 800; letter-spacing: -0.025em; min-width: 0; overflow-wrap: anywhere; }
.mjm-cat__count { font-size: 14px; color: var(--muted); margin-bottom: 6px; white-space: nowrap; }
.mjm-cat__quick { display: flex; gap: 6px; margin: 0 0 2px auto; flex-wrap: wrap; justify-content: flex-end; }
.mjm-cat__qchip { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1.5px solid var(--border-2); border-radius: var(--r-pill); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; flex-shrink: 0; transition: border-color var(--t-fast) ease, color var(--t-fast) ease; }
.mjm-cat__qchip:hover { border-color: var(--ink); color: var(--ink); }

.mjm-cat__subs { display: flex; gap: 8px; flex-wrap: wrap; }
.mjm-cat__subs .mjm-chip { border-width: 1px; }
.mjm-cat__subs .mjm-count { font-size: 11.5px; }

/* ---------- двоколонковий layout ---------- */
.mjm-cat__layout { display: flex; gap: 32px; align-items: flex-start; }
.mjm-cat__aside { width: 264px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; }
.mjm-cat__main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* ---------- фільтри ---------- */
.mjm-filters { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.mjm-filters__head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 6px; }
.mjm-filters__head strong { font-size: 15px; font-weight: 700; }
.mjm-filters__head .mjm-pill { font-size: 11.5px; }
.mjm-filters__reset { font-size: 12.5px; color: var(--muted); transition: color var(--t-fast) ease; }
.mjm-filters__reset:hover { color: var(--brand); }
.mjm-filters__close { display: none; width: 44px; height: 44px; margin-right: -10px; border: 0; border-radius: var(--r-btn); background: transparent; align-items: center; justify-content: center; color: var(--ink); }
.mjm-filters__body { display: flex; flex-direction: column; gap: 10px; }
.mjm-filters__foot { display: none; }

.mjm-fsec { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.mjm-fsec h3 { margin: 0 0 2px; font-size: 13.5px; font-weight: 600; line-height: 18px; }
.mjm-fopt { display: flex; width: 100%; font-size: 13.5px; line-height: 18px; color: var(--text-2); min-height: 18px; }
.mjm-fopt__label { flex-grow: 1; min-width: 0; overflow-wrap: anywhere; transition: color var(--t-fast) ease; }
.mjm-fopt:hover .mjm-fopt__label { color: var(--ink); }
.mjm-fopt:hover .mjm-box { border-color: var(--ink); }
.mjm-fopt input:checked ~ .mjm-fopt__label { color: var(--ink); }
.mjm-fopt input:checked + .mjm-box { border-color: var(--brand); }
.mjm-fopt__count { font-size: 12px; color: var(--muted-2); flex-shrink: 0; }
.mjm-fopt.is-zero { cursor: default; }
.mjm-fopt.is-zero .mjm-fopt__label, .mjm-fopt.is-zero .mjm-fopt__count { color: var(--muted-2); }
.mjm-fopt.is-zero .mjm-box { background: var(--surface-2); border-color: var(--border-2); }
.mjm-fsec .is-extra { display: none; }
.mjm-fsec.is-open .is-extra { display: flex; }
.mjm-fsec__more { align-self: flex-start; padding: 0; border: 0; background: none; font-size: 12.5px; font-weight: 500; color: var(--brand); white-space: nowrap; }
.mjm-fsec__more:hover { color: var(--ink); }

/* ціна */
.mjm-fprice { display: flex; gap: 8px; }
.mjm-fprice label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: 9px; background: var(--surface-2); font-size: 13px; transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease, background var(--t-fast) ease; }
.mjm-fprice label:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); background: var(--surface); }
.mjm-fprice span { color: var(--muted-2); }
.mjm-fprice input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; padding: 0; -moz-appearance: textfield; }
.mjm-fprice input::-webkit-outer-spin-button, .mjm-fprice input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mjm-frange { position: relative; height: 18px; display: flex; align-items: center; margin: 0 2px; }
.mjm-frange__track, .mjm-frange__fill { position: absolute; left: 0; right: 0; height: 4px; border-radius: var(--r-pill); background: var(--surface-3); }
.mjm-frange__fill { background: var(--brand); }
.mjm-frange input { position: absolute; left: -8px; right: -8px; width: calc(100% + 16px); height: 18px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.mjm-frange input:focus { outline: 0; }
.mjm-frange input::-webkit-slider-runnable-track { background: none; border: 0; height: 18px; }
.mjm-frange input::-moz-range-track { background: none; border: 0; }
.mjm-frange input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 16px; height: 16px; margin-top: 1px; border-radius: 999px; background: #fff; border: 2px solid var(--brand); box-sizing: border-box; cursor: grab; transition: transform var(--t-fast) ease, box-shadow var(--t-fast) ease; }
.mjm-frange input::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 999px; background: #fff; border: 2px solid var(--brand); box-sizing: border-box; cursor: grab; }
.mjm-frange input:active::-webkit-slider-thumb { transform: scale(1.15); cursor: grabbing; }
.mjm-frange input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--brand-tint); }
.mjm-frange input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--brand-tint); }

/* підказка в Telegram */
.mjm-help { border-radius: var(--r-card); background: var(--ink); color: #fff; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.mjm-help strong { font-size: 14px; font-weight: 600; }
.mjm-help span { font-size: 12.5px; line-height: 18px; color: #B9B6AC; }
.mjm-help__btn { margin-top: 4px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; transition: filter var(--t-fast) ease, transform var(--t-fast) ease; }
.mjm-help__btn:hover { color: #fff; filter: brightness(1.1); transform: translateY(-1px); }

/* ---------- панель: активні фільтри + сортування ---------- */
.mjm-cat__mbar { display: none; }
.mjm-cat__bar { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.mjm-cat__chips { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.mjm-cat__chips .mjm-chip--filter { height: 32px; padding: 0 8px 0 12px; border-radius: 9px; font-size: 12.5px; }
.mjm-cat__sortlabel { font-size: 13px; color: var(--muted); white-space: nowrap; }
.mjm-cat__sort { border-radius: 11px; }
.mjm-cat__sort > a { height: 30px; padding: 0 12px; font-size: 12.5px; color: var(--text-2); }
.mjm-cat__sort > a:hover { color: var(--ink); }

/* ---------- сітка + скелетон ---------- */
.mjm-cat__grid .mjm-card { min-width: 0; }
.mjm-cat__grid.is-loading .mjm-card { pointer-events: none; }
.mjm-cat__grid.is-loading .mjm-card::after { content: ''; position: absolute; inset: 0; z-index: 3; background: linear-gradient(90deg, rgba(255,255,255,.55), rgba(255,255,255,.85), rgba(255,255,255,.55)); background-size: 200% 100%; animation: mjm-cat-skel 1.1s linear infinite; }
@keyframes mjm-cat-skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.mjm-cat__new { animation: mjm-rv var(--t-reveal) var(--ease) both; opacity: 0; transform: translateY(12px); }

/* ---------- низ: показано, ще, пагінація ---------- */
.mjm-cat__foot { display: flex; align-items: center; gap: 12px; padding-top: 8px; flex-wrap: wrap; }
.mjm-cat__shown { font-size: 13px; color: var(--muted); }
.mjm-cat__more { position: relative; display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 22px; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; transition: background var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-fast) ease; }
.mjm-cat__more:hover { background: var(--ink); color: #fff; transform: translateY(-1px); }
.mjm-cat__more.is-loading { pointer-events: none; }
.mjm-cat__more.is-loading span { visibility: hidden; }
.mjm-cat__more.is-loading::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 999px; border: 2px solid currentColor; border-right-color: transparent; animation: mjm-spin .7s linear infinite; }
.mjm-cat__foot .mjm-pagination { gap: 4px; }
.mjm-cat__foot .mjm-pagination a, .mjm-cat__foot .mjm-pagination span { border-width: 1px; font-weight: 500; }
.mjm-cat__foot .mjm-pagination .is-active { font-weight: 600; }
.mjm-cat__foot .mjm-pagination .mjm-pagination__gap { border: 0; background: none; min-width: 20px; padding: 0; color: var(--muted); }

/* ---------- порожній результат ---------- */
.mjm-cat__empty { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-tile); padding: 48px 24px 52px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.mjm-cat__empty svg { margin-bottom: 8px; }
.mjm-cat__empty h2 { margin: 0; font-size: var(--fs-h3); font-weight: 700; letter-spacing: -0.01em; }
.mjm-cat__empty p { margin: 0 0 8px; max-width: 380px; font-size: 14px; line-height: 21px; color: var(--muted); }

/* ---------- SEO-блок ---------- */
.mjm-cat__seo { margin-top: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.mjm-cat__seo-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mjm-cat__seo h2 { margin: 0; font-size: 18px; line-height: 24px; font-weight: 700; letter-spacing: -0.01em; }
.mjm-cat__guide { font-size: 13.5px; line-height: 21px; color: var(--text-2); max-height: 84px; overflow: hidden; }
.mjm-cat__guide.is-open { max-height: none; }
.mjm-cat__guide p { margin: 0 0 8px; }
.mjm-cat__guide h2, .mjm-cat__guide h3 { font-size: 15px; margin: 12px 0 6px; }
.mjm-cat__guide a { color: var(--brand); }
.mjm-cat__guide-toggle { align-self: flex-start; padding: 0; border: 0; background: none; font-size: 13.5px; font-weight: 600; color: var(--brand); white-space: nowrap; transition: color var(--t-fast) ease; }
.mjm-cat__guide-toggle:hover { color: var(--ink); }
.mjm-cat__tips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.mjm-cat__tip { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 3px; border: 1px solid transparent; transition: border-color var(--t-fast) ease, background var(--t-fast) ease; }
.mjm-cat__tip:hover { border-color: var(--border-3); background: var(--surface); }
.mjm-cat__tip strong { font-size: 13.5px; font-weight: 600; }
.mjm-cat__tip span { font-size: 12.5px; color: var(--muted); }

/* ---------- bottom-sheet (мобільний) ---------- */
.mjm-sheet { display: none; }
.mjm-cat__backdrop { display: none; }

/* ---------- планшет ---------- */
@media (max-width: 1199px) {
  .mjm-cat__layout { gap: 24px; }
  .mjm-cat__aside { width: 240px; }
  .mjm-cat__quick { display: none; }
  .mjm-cat__bar { flex-wrap: wrap; }
}
@media (max-width: 991px) {
  .mjm-cat__sortlabel { display: none; }
  .mjm-cat__seo { grid-template-columns: 1fr; gap: 20px; }
}

/* ---------- телефон ---------- */
@media (max-width: 767px) {
  .mjm-cat { gap: 14px; }
  .mjm-cat__head { gap: 10px; flex-wrap: wrap; }
  .mjm-cat__head h1 { font-size: 24px; line-height: 30px; }
  .mjm-cat__count { margin-bottom: 3px; font-size: 13px; }
  .mjm-cat__subs { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--page-x) * -1); padding: 0 var(--page-x); scrollbar-width: none; }
  .mjm-cat__subs::-webkit-scrollbar { display: none; }
  .mjm-cat__layout { flex-direction: column; gap: 16px; align-items: stretch; }
  /* reveal-анімація створює stacking context — тоді шторка опиняється під backdrop і нижньою навігацією */
  .mjm-cat__layout.mjm-rv { animation: none; opacity: 1; transform: none; }
  .mjm-cat__aside { width: auto; order: 2; }
  .mjm-cat__main { gap: 12px; }

  .mjm-cat__mbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .mjm-cat__mbar--single { grid-template-columns: 1fr; }
  .mjm-cat__mbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 12px; border: 1.5px solid var(--border-2); border-radius: var(--r-btn); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; min-width: 0; transition: border-color var(--t-fast) ease; }
  .mjm-cat__mbtn:active { border-color: var(--ink); }
  .mjm-cat__mbtn-text { overflow: hidden; text-overflow: ellipsis; }
  .mjm-cat__bar { min-height: 0; }
  .mjm-cat__bar:not(:has(.mjm-cat__chips)) { display: none; }
  .mjm-cat__sortlabel, .mjm-cat__sort { display: none; }
  .mjm-cat__chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--page-x) * -1); padding: 0 var(--page-x); scrollbar-width: none; }
  .mjm-cat__chips::-webkit-scrollbar { display: none; }

  .mjm-cat__foot { flex-direction: column; align-items: stretch; gap: 12px; padding-top: 4px; }
  .mjm-cat__foot .mjm-grow { display: none; }
  .mjm-cat__shown { text-align: center; order: 2; }
  .mjm-cat__more { height: 44px; order: 1; }
  .mjm-cat__foot .mjm-pagination { justify-content: center; order: 3; }
  .mjm-cat__foot .mjm-pagination a, .mjm-cat__foot .mjm-pagination span { min-width: 40px; height: 40px; }

  .mjm-cat__seo { padding: 20px; border-radius: var(--r-card); margin-top: 4px; }
  .mjm-cat__tips { grid-template-columns: 1fr 1fr; }
  .mjm-cat__empty { padding: 36px 20px 40px; }

  /* фільтри → bottom-sheet */
  .mjm-filters, .mjm-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; max-height: 88vh; display: flex; flex-direction: column; gap: 0; background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: 0 -18px 40px -24px rgba(17,17,17,.4); transform: translateY(100%); visibility: hidden; transition: transform 320ms var(--ease), visibility 0s linear 320ms; }
  .mjm-filters.is-open, .mjm-sheet.is-open { transform: none; visibility: visible; transition: transform 320ms var(--ease), visibility 0s; }
  .mjm-filters::before, .mjm-sheet::before { content: ''; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 999px; background: var(--border-3); }
  .mjm-filters__head { flex-shrink: 0; height: 60px; padding: 8px 16px 0; border-bottom: 1px solid var(--row-sep); }
  .mjm-filters__head strong { font-size: 17px; }
  .mjm-filters__head .mjm-filters__reset { display: none; }
  .mjm-filters__close { display: inline-flex; }
  .mjm-filters__body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; gap: 0; padding: 0 16px; }
  .mjm-filters .mjm-fsec { border: 0; border-bottom: 1px solid var(--row-sep); border-radius: 0; padding: 16px 0; gap: 4px; }
  .mjm-filters .mjm-fsec:last-child { border-bottom: 0; }
  .mjm-filters .mjm-fsec h3 { font-size: 14.5px; margin-bottom: 6px; }
  .mjm-filters .mjm-fopt { min-height: 44px; align-items: center; font-size: 14.5px; }
  .mjm-filters .mjm-fsec__more { min-height: 44px; font-size: 13.5px; }
  .mjm-filters .mjm-fprice label { height: 44px; font-size: 14.5px; }
  .mjm-filters .mjm-frange { height: 36px; margin-top: 4px; }
  .mjm-frange input, .mjm-frange input::-webkit-slider-runnable-track { height: 36px; }
  .mjm-frange input::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: 6px; }
  .mjm-frange input::-moz-range-thumb { width: 24px; height: 24px; }
  .mjm-frange input { left: -12px; right: -12px; width: calc(100% + 24px); }
  .mjm-filters__foot { display: flex; gap: 8px; flex-shrink: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
  .mjm-filters__foot .mjm-btn { height: 48px; }
  .mjm-sheet__list { display: flex; flex-direction: column; padding: 4px 16px calc(16px + env(safe-area-inset-bottom)); }
  .mjm-sheet__list a { display: flex; align-items: center; justify-content: space-between; min-height: 52px; font-size: 15px; font-weight: 500; color: var(--text-2); border-bottom: 1px solid var(--row-sep); }
  .mjm-sheet__list a:last-child { border-bottom: 0; }
  .mjm-sheet__list a.is-active { color: var(--brand); font-weight: 600; }
  .mjm-cat__backdrop { display: block; position: fixed; inset: 0; z-index: 79; background: rgba(17,17,17,.4); opacity: 0; pointer-events: none; transition: opacity 320ms var(--ease); }
  .mjm-cat__backdrop.is-open { opacity: 1; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .mjm-filters, .mjm-sheet, .mjm-cat__backdrop, .mjm-frange input::-webkit-slider-thumb { transition: none !important; }
  .mjm-cat__new { animation: none; opacity: 1; transform: none; }
  .mjm-cat__grid.is-loading .mjm-card::after { animation: none; }
}

/* ===== сторінки під популярні запити (посадочні розділу) ===== */
.mjm-cat__queries { margin-top: 12px; padding-top: 24px; border-top: 1px solid var(--border-2); }
.mjm-cat__queries h2 { margin: 0 0 12px; font-size: 18px; line-height: 24px; font-weight: 700; letter-spacing: -0.01em; }
.mjm-cat__queries ul { list-style: none; margin: 0; padding: 0; columns: 4 220px; column-gap: 32px; font-size: 13.5px; line-height: 20px; color: var(--text-2); }
.mjm-cat__queries li { break-inside: avoid; padding: 3px 0; }
.mjm-cat__queries ul.is-long:not(.is-open) li:nth-child(n+13) { display: none; }
.mjm-cat__queries a { transition: color var(--t-fast) ease; }
.mjm-cat__queries a:hover { color: var(--brand); }
.mjm-cat__queries-more { margin-top: 8px; padding: 0; border: 0; background: none; font-size: 13.5px; font-weight: 600; color: var(--brand); transition: color var(--t-fast) ease; }
.mjm-cat__queries-more:hover { color: var(--ink); }
@media (max-width: 760px) {
  .mjm-cat__queries ul { columns: 1; font-size: 14.5px; line-height: 22px; }
  .mjm-cat__queries li { padding: 5px 0; }
}
