/* Estetikos studija – prekių filtrai (papildo main.css). */

/* ---------- Šoninė juosta kompiuteryje ---------- */
@media (min-width: 901px) {
	.es-filters { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 6px; }
	/* Su scenarijumi filtrai pritaikomi iš karto – mygtukas „Rodyti prekes“ nereikalingas. */
	.es-js-filtrai .es-filters__actions [data-es-rodyti] { display: none; }
	.es-js-filtrai .es-filters__actions { justify-content: flex-start; }
	body.es .es-js-filtrai .es-filters__actions .es-btn { flex: 0 0 auto; padding: 0 18px; }
}

.es-filters-backdrop { display: none; }
.es-arch__main:focus { outline: none; }

/* ---------- Grupės ---------- */
.es-fgroup__list { display: flex; flex-direction: column; gap: 2px; }
.es-js-filtrai .es-check--more { display: none; }
.es-js-filtrai .es-fgroup.is-all .es-check--more,
.es-js-filtrai .es-fgroup.is-searching .es-check--more { display: flex; }
.es-check[hidden] { display: none !important; }

body.es .es-fmore { align-self: flex-start; margin: 6px 0 0; padding: 6px 0; border: 0; background: none; font-size: 15px; font-weight: 600; color: var(--es-accent); text-decoration: underline; text-underline-offset: 3px; box-shadow: none; }
body.es .es-fgroup.is-searching .es-fmore { display: none; }
html:not(.es-js-filtrai) .es-fmore,
html:not(.es-js-filtrai) .es-fsearch,
html:not(.es-js-filtrai) .es-fquick { display: none; }

.es-fsearch { position: relative; display: block; margin-bottom: 8px; }
.es-fsearch svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--es-muted); pointer-events: none; }
body.es .es-fsearch input { width: 100%; height: 42px; margin: 0; padding: 0 12px 0 38px; border: 1px solid var(--es-line2); border-radius: var(--es-r); background: #FFFFFF; box-shadow: none; font-size: 15px; font-weight: 400; color: var(--es-ink); }
body.es .es-fsearch input:focus { border-color: var(--es-ink); }

/* Greiti kainos intervalai */
.es-fquick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
body.es .es-fquick button { height: 36px; margin: 0; padding: 0 12px; border: 1px solid var(--es-line2); border-radius: 18px; background: #FFFFFF; box-shadow: none; font-size: 14px; font-weight: 600; line-height: 1; color: var(--es-ink); }
body.es .es-fquick button:hover { border-color: var(--es-ink); }
body.es .es-fquick button[aria-pressed="true"] { border-color: var(--es-accent); background: var(--es-tint); color: var(--es-accent); }

/* Jungiklio išvaizdos varnelės „Kiti filtrai“ */
body.es .es-check--switch input { appearance: none; -webkit-appearance: none; flex: 0 0 40px; width: 40px; height: 24px; border-radius: 12px; background: var(--es-line2); position: relative; transition: background 0.15s; cursor: pointer; }
body.es .es-check--switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s; }
body.es .es-check--switch input:checked { background: var(--es-accent); }
body.es .es-check--switch input:checked::after { transform: translateX(16px); }

/* ---------- Aktyvių filtrų žymos ---------- */
.es-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.es-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 14px; border-radius: 18px; background: var(--es-tint); color: var(--es-ink); font-size: 14px; font-weight: 600; text-decoration: none !important; }
.es-chip span[aria-hidden] { font-size: 18px; line-height: 1; color: var(--es-accent); }
.es-chip:hover { background: #EFE5CC; }
.es-chip--clear { background: transparent; padding: 0 6px; color: var(--es-muted); text-decoration: underline !important; text-underline-offset: 3px; }
.es-chip--clear:hover { background: transparent; color: var(--es-ink); }

/* Skaičius ant mygtuko „Filtrai“ */
.es-toolbar__n { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; margin-left: 6px; padding: 0 6px; border-radius: 11px; background: var(--es-accent); color: var(--es-on-accent); font-size: 12px; font-weight: 700; }
.es-toolbar--empty { display: none; }

/* Kraunama */
.es-arch__main { transition: opacity 0.15s; }
.es-arch__main.is-loading { opacity: 0.45; pointer-events: none; }
[data-es-rodyti].is-loading { opacity: 0.7; }

/* ---------- Telefonas: apatinis skydas ---------- */
@media (max-width: 900px) {
	.es-toolbar--empty { display: flex; }
	/* Pritemdymas – atskiras elementas, kad paspaudimas ant jo uždarytų skydą, o ne paspaustų prekę po juo. */
	.es-filters { inset: auto 0 0 0; max-height: 88vh; max-height: 88dvh; border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(23, 25, 26, 0.18); }
	.es-filters.is-open + .es-filters-backdrop { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(23, 25, 26, 0.55); }
	.es-filters.is-open { animation: es-sheet-up 0.22s ease-out; }
	.es-filters__form { flex: 1 1 auto; }
	.es-filters__head { position: relative; padding-top: 18px; }
	.es-filters__head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--es-line2); }
	.es-fgroup { padding-bottom: 20px; }
	.es-fquick button { height: 40px; }
	.es-filters__actions { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
	.es-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--es-pad) * -1) 14px; padding: 0 var(--es-pad) 2px; scrollbar-width: none; }
	.es-chip { flex: 0 0 auto; white-space: nowrap; }

	/* Mygtukai „Filtrai“ ir rikiavimas prilimpa po ekrano viršumi slenkant sąrašą. */
	.es-toolbar { position: sticky; top: 0; z-index: 20; margin: 0 calc(var(--es-pad) * -1) 20px; padding: 10px var(--es-pad); background: rgba(255, 255, 255, 0.96); border-bottom: 1px solid var(--es-line); }
	body.es .es-toolbar .woocommerce-result-count { display: none; }
}

@keyframes es-sheet-up {
	from { transform: translateY(24px); }
	to { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.es-filters.is-open { animation: none; }
	.es-arch__main { transition: none; }
}
