/* mmsearch 1.2 – paieškos lango (views/blocks/mm_search_overlay.tpl, assets/js/mmsearch.js) ir rezultatų puslapio
   (tema page/search/search.tpl, blokas mm_search_services) papildomi stiliai.
   Įtraukia modulio blokas mm_search_overlay per oxstyle su ?mtime – visuose puslapiuose išvedama po temos mm.css / mm-ux.css
   (mm_search_services jį įtraukia tik kai langas išjungtas). Lango taisyklės dar ir su #mmSearch (specifiškumas 1-x-x), todėl nepriklauso nuo
   failų tvarkos – temos .mm-search__* taisyklės jų nenusveria; bendri temos CSS failai nekeičiami.
   Spalvos – tik temos :root žetonai (mm.css) arba žemiau apibrėžti --mm-search-*; tekstų CSS nėra (viskas – kalbos failai). */
:root {
  --mm-search-ph: #eef2f7;                 /* paveikslėlio vieta, kol kraunasi / jo nėra (kaip skeletų pagrindas mm.css) */
  --mm-search-bg: #fff;                    /* kortelių / mygtukų / lipnios apačios fonas (kaip mm.css) */
  --mm-search-on-accent: #fff;             /* tekstas ant --mm-blue (aktyvus filtras) */
  --mm-search-line: #d7dde6;               /* neutralūs rėmeliai (neseniai ieškota, filtrai) */
  --mm-search-aside-w: 300px;              /* šoninė kolona nuo 900 px: užbaigimai, kategorijos, paslaugos */
  --mm-search-thumb: 46px;                 /* eilutės paveikslėlio dėžutė */
  --mm-search-offer-img: 64px;             /* pasiūlymo kortelės paveikslėlio dėžutė */
  --mm-search-offer-img-sm: 56px;          /* tas pats ≤ 640 px (mm.css) */
  --mm-search-sk-chip-sm: 44px;            /* mygtuko aukštis ≤ 640 px (mm.css .mm-search__chip) – skeletas toks pat */
  --mm-search-offer-min-sm: 96px;          /* kortelės aukštis ≤ 640 px = skeleto aukštis (be šuolio) */
  --mm-search-footer-shadow: 0 -6px 14px rgba(15, 23, 42, .08);
  --mm-search-footer-h: 56px;             /* vieta lipniai „Rodyti visus“ apačiai (jos aukštis 49 px + tarpas): tiek #mmSearchBody palieka slenkant klaviatūra */
  --mm-search-tap: 44px;
  --mm-search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  --mm-search-icon-cat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E");
  --mm-search-icon-recent: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}

/* ---------- paveikslėliai: vieta iš karto (46×46 / 64×64), pilkas fonas kol kraunasi, klaida → ta pati vieta ---------- */
#mmSearch .mm-search__item img, #mmSearch .mm-search__item-noimg { flex: none; width: var(--mm-search-thumb); height: var(--mm-search-thumb); object-fit: contain; border-radius: 6px; background: var(--mm-search-ph); }
#mmSearch .mm-search__item-noimg { display: block; }
#mmSearch .mm-search__item img.is-ld { background: transparent; }
#mmSearch .mm-search__offer-media img { border-radius: 6px; background: var(--mm-search-ph); }
#mmSearch .mm-search__offer-media img.is-ld { background: transparent; }
#mmSearch .mm-search__offer-ph { display: block; width: 100%; height: 100%; border-radius: 6px; background: var(--mm-search-ph); }

/* ---------- rezultatai: užklausos žodžiai, pranešimas, lipni „Rodyti visus N“ ---------- */
#mmSearch mark.mm-search__hl { padding: 0; background: transparent; color: inherit; font-weight: 700; }
#mmSearch .mm-search__notice { display: block; margin-top: 2px; color: var(--mm-text); }
#mmSearch .mm-search__notice b, #mmSearch .mm-search__corrected b { font-weight: 700; }
/* aktyvi eilutė (rodyklės, aria-activedescendant) niekada nelieka po lipnia apačia: scrollIntoView({block:'nearest'}) paiso scroll-padding (WCAG 2.4.11) */
#mmSearch #mmSearchBody { scroll-padding-bottom: calc(var(--mm-search-footer-h) + env(safe-area-inset-bottom)); }
#mmSearch .mm-search__all { position: sticky; bottom: 0; z-index: 2; margin: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); background: var(--mm-search-bg); border-top: 1px solid var(--mm-border); box-shadow: var(--mm-search-footer-shadow); }

/* ---------- užbaigimai ir kategorijos (#mmSearchAside) ---------- */
#mmSearch .mm-search__aside[hidden] { display: none !important; }
#mmSearch .mm-search__item--sugg, #mmSearch .mm-search__item--cat { min-height: var(--mm-search-tap); padding-top: 8px; padding-bottom: 8px; }
#mmSearch .mm-search__item--sugg::before, #mmSearch .mm-search__item--cat::before { content: ""; flex: none; width: 16px; height: 16px; background: var(--mm-muted); -webkit-mask: var(--mm-search-icon) center / contain no-repeat; mask: var(--mm-search-icon) center / contain no-repeat; }
#mmSearch .mm-search__item--cat::before { -webkit-mask-image: var(--mm-search-icon-cat); mask-image: var(--mm-search-icon-cat); }
#mmSearch .mm-search__item--sugg .mm-search__item-title { color: var(--mm-text); }
#mmSearch .mm-search__item--sugg .mm-search__item-title b { font-weight: 700; }
#mmSearch .mm-search__item-n { flex: none; font-size: 13px; color: var(--mm-muted); white-space: nowrap; }
@media (min-width: 900px) {
  #mmSearch .mm-search__list--split { display: grid; grid-template-columns: var(--mm-search-aside-w) minmax(0, 1fr); align-items: stretch; }
  #mmSearch .mm-search__list--split > .mm-search__aside { min-width: 0; border-right: 1px solid var(--mm-border); }
  #mmSearch .mm-search__list--split > .mm-search__main { min-width: 0; }
  #mmSearch .mm-search__list--split > .mm-search__aside .mm-search__item { padding-left: 16px; padding-right: 16px; }
}

/* ---------- neseniai ieškota (#mmSearchRecent) ---------- */
#mmSearch .mm-search__col--recent .mm-search__h-row { margin-bottom: 6px; }
#mmSearch .mm-search__recent-clear { flex: none; display: inline-flex; align-items: center; min-height: var(--mm-search-tap); padding: 0 4px; border: 0; background: none; color: var(--mm-link); font-size: 13px; font-weight: 700; cursor: pointer; }
#mmSearch .mm-search__recent-clear:hover { text-decoration: underline; }
#mmSearch .mm-search__chip--recent { gap: 6px; border-color: var(--mm-search-line); color: var(--mm-text); }
#mmSearch .mm-search__chip--recent::before { content: ""; flex: none; width: 14px; height: 14px; background: var(--mm-muted); -webkit-mask: var(--mm-search-icon-recent) center / contain no-repeat; mask: var(--mm-search-icon-recent) center / contain no-repeat; }
#mmSearch .mm-search__chip--recent:hover { border-color: var(--mm-blue); color: var(--mm-blue); background: var(--mm-blue-50); }
@media (min-width: 1024px) {
  #mmSearch .mm-search__idle--recent:not(.mm-search__idle--single) { grid-template-rows: auto 1fr; row-gap: 24px; }
  #mmSearch .mm-search__idle--recent:not(.mm-search__idle--single) > .mm-search__col--recent { grid-column: 1; grid-row: 1; }
  #mmSearch .mm-search__idle--recent:not(.mm-search__idle--single) > .mm-search__col--trending { grid-column: 1; grid-row: 2; }
  #mmSearch .mm-search__idle--recent:not(.mm-search__idle--single) > .mm-search__col--offers { grid-column: 2; grid-row: 1 / span 2; }
}

/* ---------- nieko nerasta lange: patarimas, mygtukai, pasiūlymai, AI, telefonas ---------- */
#mmSearch .mm-search__none .mm-search__tip { max-width: 560px; margin: 8px auto 0; font-size: 14px; line-height: 1.45; color: var(--mm-muted); }
#mmSearch .mm-search__none .mm-search__none-h { margin: 22px 0 0; }
#mmSearch .mm-search__none h3.mm-search__none-h { font-size: 15px; }
#mmSearch .mm-search__none .mm-search__h-row.mm-search__none-h { max-width: 980px; margin: 22px auto 0; text-align: left; }
#mmSearch .mm-search__none .mm-search__none-h + .mm-search__chips { margin-top: 10px; }
#mmSearch .mm-search__offers--none { max-width: 980px; margin: 12px auto 0; text-align: left; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
#mmSearch .mm-search__none .mm-search__contact { margin: 18px 0 0; font-size: 14px; color: var(--mm-text); }
#mmSearch .mm-search__tel { font-weight: 700; white-space: nowrap; }

/* ---------- skeletas: tie patys matmenys kaip galutinių mygtukų / kortelių ---------- */
#mmSearch .mm-search__col--offers .mm-search__h-row { min-height: 22px; }   /* su „Visi pasiūlymai“ ir be jos (skeletas) – tas pats aukštis */
@media (max-width: 640px) {
  #mmSearch .mm-search__sk--chip { height: var(--mm-search-sk-chip-sm); }
  #mmSearch .mm-search__sk--offer { height: var(--mm-search-offer-min-sm); }
  #mmSearch .mm-search__offer { min-height: var(--mm-search-offer-min-sm); }
  #mmSearch .mm-search__col--recent .mm-search__chips { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; scroll-padding: 0 16px; }
  #mmSearch .mm-search__col--recent .mm-search__chips::-webkit-scrollbar { display: none; }
  #mmSearch .mm-search__offers--none { grid-template-columns: minmax(0, 1fr); }
  #mmSearch .mm-search__none { padding-left: 16px; padding-right: 16px; }
}

/* ============ rezultatų puslapis (page/search/search.tpl; naujos dalys tik su mmsearch 1.2) ============ */
.mm-snotice { clear: both; margin: 0 0 12px; font-size: 15px; line-height: 1.4; color: var(--mm-text); }
.mm-snotice b { font-weight: 700; }

/* kategorijų filtrai („Kategorijos: Visos kategorijos | Pavadinimas (n)“) */
.mm-sfacets { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.mm-sfacets__label { flex: none; font-size: 13px; font-weight: 700; color: var(--mm-blue-dark); }
.mm-sfacets__list { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.mm-sfacets__list > li { display: flex; flex: none; }
.mm-sfacets__chip { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px; border: 1px solid var(--mm-search-line); border-radius: 18px; background: var(--mm-search-bg); color: var(--mm-text); font-size: 14px; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.mm-sfacets__chip:hover, .mm-sfacets__chip:focus-visible { border-color: var(--mm-blue); color: var(--mm-blue); text-decoration: none; }
.mm-sfacets__chip.is-active { border-color: var(--mm-blue); background: var(--mm-blue); color: var(--mm-search-on-accent); }
.mm-sfacets__n { font-size: 13px; color: var(--mm-muted); }
.mm-sfacets__chip.is-active .mm-sfacets__n { color: inherit; }

/* 0 rezultatų: patarimas, populiarios paieškos, pasiūlymai, AI, telefonas */
.mm-szero { margin: 4px 0 28px; }
.mm-szero [hidden] { display: none !important; }
.mm-szero__tip { margin: 0 0 20px; font-size: 15px; line-height: 1.45; color: var(--mm-text); }
.mm-szero__sec { margin: 0 0 26px; }
.mm-szero__h { margin: 0 0 12px; font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--mm-blue-dark); }
.mm-szero__hrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.mm-szero__hrow .mm-szero__h { margin: 0; }
.mm-szero__more { font-size: 14px; font-weight: 700; color: var(--mm-link); white-space: nowrap; }
.mm-szero__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mm-szero__chips > li { display: flex; }
.mm-szero__chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--mm-blue); border-radius: 6px; background: var(--mm-search-bg); color: var(--mm-blue); font-size: 14px; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.mm-szero__chip:hover { background: var(--mm-blue-50); color: var(--mm-blue); text-decoration: none; }
.mm-szero__offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.mm-szero__offers > li { display: flex; min-width: 0; }
.mm-szero__offer { display: grid; grid-template-columns: var(--mm-search-offer-img) minmax(0, 1fr); gap: 14px; align-items: center; width: 100%; padding: 14px; border: 1px solid var(--mm-border); border-radius: 8px; background: var(--mm-search-bg); box-shadow: var(--mm-shadow); color: var(--mm-text); text-decoration: none; }
.mm-szero__offer:hover { border-color: var(--mm-blue-100); color: var(--mm-text); text-decoration: none; }
.mm-szero__offer--noimg { grid-template-columns: minmax(0, 1fr); }
.mm-szero__media { display: flex; align-items: center; justify-content: center; width: var(--mm-search-offer-img); height: var(--mm-search-offer-img); }
.mm-szero__media img { width: var(--mm-search-offer-img); height: var(--mm-search-offer-img); border-radius: 6px; object-fit: contain; }
.mm-szero__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mm-szero__title { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--mm-blue-dark); }
.mm-szero__price { font-size: 16px; line-height: 1.3; }
.mm-szero__price b { font-weight: 700; color: var(--mm-price); }
.mm-szero__price del { margin-left: 4px; font-size: 13px; color: var(--mm-muted); }
.mm-szero__text { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 13px; line-height: 1.35; color: var(--mm-muted); }
.mm-szero__help { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.mm-szero__ai { display: inline-flex; align-items: center; min-height: var(--mm-search-tap); padding: 0 18px; border: 1px solid var(--mm-blue); border-radius: 8px; background: var(--mm-search-bg); color: var(--mm-blue); font-size: 15px; font-weight: 700; cursor: pointer; }
.mm-szero__ai:hover { background: var(--mm-blue-50); }
.mm-szero__contact { margin: 0; font-size: 15px; color: var(--mm-text); }
.mm-szero__tel { font-weight: 700; white-space: nowrap; }

/* telefonas / planšetė: viršutinis puslapių sąrašas paslepiamas (apačioje lieka), „Puslapis X / Y“ + rikiavimas (+ kiekis) – viena eilutė */
@media (max-width: 900px) {
  .cl-search .mm-paging--top .mm-pager { display: none; }
  .cl-search .mm-listtop { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 0 0 10px; }
  .cl-search .mm-listtop .mm-paging--top { margin: 0; }
  .cl-search .mm-listtop .mm-paging--top .mm-paging__of { margin: 0; text-align: left; white-space: nowrap; }
  .cl-search .mm-listtop .mm-listtop__row { display: contents; }
  .cl-search .mm-listtop .mm-toolbar__sort { order: 1; width: auto; min-width: 0; }   /* mm.css ≤ 700 px – width:100% (atskira eilutė) */
  .cl-search .mm-listtop .mm-perpage { order: 2; margin: 0; }
  .cl-search .mm-listtop .mm-sort { margin: 0; }
  .cl-search .mm-listtop .mm-sort select { max-width: 170px; }
  .mm-sfacets { margin: 0 -20px 12px; padding: 0 20px; }
  .mm-sfacets__list { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
  .mm-sfacets__list::-webkit-scrollbar { display: none; }
  .mm-sfacets__chip { min-height: 40px; }
}
@media (max-width: 640px) {
  .cl-search #test_catTitle { font-size: 20px; line-height: 1.25; }
  .mm-snotice { font-size: 14px; }
  .cl-search .page-header { margin-bottom: 10px; padding-bottom: 6px; }
  .cl-search .mm-listtop .mm-perpage { display: none; }   /* telefone – tik apačioje (mm-listbottom) */
  .cl-search .mm-results-cat { font-size: 16px; }
  .cl-search .mm-results-cat:first-of-type { margin-top: 0; }
  .mm-sfacets__label { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  .mm-szero__offers { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .mm-szero__offer { grid-template-columns: var(--mm-search-offer-img-sm) minmax(0, 1fr); padding: 12px; }
  .mm-szero__offer--noimg { grid-template-columns: minmax(0, 1fr); }
  .mm-szero__media, .mm-szero__media img { width: var(--mm-search-offer-img-sm); height: var(--mm-search-offer-img-sm); }
  .mm-szero__chip { min-height: var(--mm-search-tap); }
}
@media (prefers-reduced-motion: reduce) {
  .mm-sfacets__list, .mm-search__col--recent .mm-search__chips { scroll-behavior: auto; }
}
