/*
 * Search panel (inc/drawers.php, .ps-sp). Phone: the whole screen, the field kept at the top. Tablet and up: a floating
 * card in the middle of the blurred page, clear of the screen's edges. Recent searches as chips, the main categories
 * (and «all products») as picture tiles, then the products found. Colours and corners come from the site's tokens
 * (--ps-*), so each shop keeps its own. Loaded on its own after the main stylesheet; it overrides the panel's older
 * rules in assets/dist/parsa.css.
 */
.ps-sp { --sp-soft: color-mix(in srgb, var(--ps-heading) 5%, #fff); --sp-soft-2: color-mix(in srgb, var(--ps-heading) 9%, #fff); --sp-tint: color-mix(in srgb, var(--ps-primary) 7%, #fff); --sp-ring: color-mix(in srgb, var(--ps-primary) 14%, transparent); --sp-pad: 28px; background: rgba(17,24,39,.45); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.ps-sp .ps-search-panel { position: relative; max-width: 980px; margin: 0 auto; padding: 0; border-radius: var(--ps-radius-md); background: #fff; box-shadow: 0 30px 70px rgba(17,24,39,.22); transform: translateY(-14px); transition: transform .32s cubic-bezier(.22,.8,.3,1); }
.ps-sp.is-open .ps-search-panel { transform: none; }
.ps-sp .ps-sp__wrap { width: auto; max-width: none; margin: 0; padding-inline: var(--sp-pad); }

/* The field row */
.ps-sp .ps-sp__bar { padding: var(--sp-pad) 0 4px; border-radius: var(--ps-radius-md) var(--ps-radius-md) 0 0; background: #fff; }
.ps-sp .ps-search-panel__top { gap: 10px; max-width: none; margin: 0; }
.ps-sp .ps-search-field { height: 56px; border: 1.5px solid transparent; border-radius: var(--ps-radius-sm); background: var(--sp-soft); }
.ps-sp .ps-search-field:hover { background: var(--sp-soft-2); }
.ps-sp .ps-search-field:focus-within { border-color: var(--ps-primary); background: #fff; box-shadow: 0 0 0 4px var(--sp-ring); }
.ps-sp .ps-search-field__icon { inset-inline-start: 17px; color: var(--ps-muted); transition: color .2s ease; }
.ps-sp .ps-search-field:focus-within .ps-search-field__icon { color: var(--ps-primary); }
.ps-sp .ps-search-field .ps-search-field__input { min-width: 0; padding-inline: 50px 6px; font-size: 16px; }
.ps-sp .ps-search-field__input::placeholder { color: var(--ps-muted); opacity: .85; }
.ps-sp .ps-search-field__go { height: 44px; margin-inline-end: 6px; padding: 0 26px; border-radius: calc(var(--ps-radius-sm) * .75); }
.ps-sp__clear { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 30px; height: 30px; margin-inline-end: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--sp-soft-2); color: var(--ps-heading); cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.ps-sp__clear:hover { background: var(--ps-primary); color: #fff; }
.ps-sp__clear[hidden] { display: none; }
.ps-sp .ps-search-panel__close { width: 56px; height: 56px; border-radius: var(--ps-radius-sm); background: var(--sp-soft); transition: background-color .2s ease, color .2s ease; }
.ps-sp .ps-search-panel__close:hover { background: var(--sp-soft-2); color: var(--ps-primary); }

/* Sections */
.ps-sp .ps-sp__body { padding-bottom: var(--sp-pad); }
.ps-sp .ps-search-panel__suggest { max-width: none; padding-top: 0; }
.ps-sp__sec { padding-top: 26px; animation: ps-sp-in .35s ease both; }
.ps-sp__sec + .ps-sp__sec { animation-delay: .06s; }
.ps-sp__sec[hidden] { display: none; }
@keyframes ps-sp-in { from { opacity: 0; transform: translateY(8px); } }
.ps-sp__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ps-sp__title { display: inline-flex; align-items: center; gap: 8px; color: var(--ps-heading); font-size: 15px; font-weight: 700; }
.ps-sp__title svg { color: var(--ps-primary); }
.ps-sp__forget { display: inline-flex; align-items: center; gap: 5px; padding: 4px 2px; border: 0; background: none; color: var(--ps-muted); font: inherit; font-size: 12.5px; cursor: pointer; transition: color .2s ease; }
.ps-sp__forget:hover { color: var(--ps-primary); }

/* Recent searches */
.ps-sp__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ps-sp__chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 8px 14px; border-radius: var(--ps-radius-pill); background: var(--sp-soft); color: var(--ps-heading); font-size: 13.5px; line-height: 1.4; transition: background-color .2s ease, color .2s ease; }
.ps-sp__chip svg { flex: none; color: var(--ps-muted); }
.ps-sp__chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-sp__chip:hover { background: var(--sp-soft-2); color: var(--ps-primary); }

/* Category tiles: picture above the name */
.ps-sp__cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ps-sp__cat { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--ps-border); border-radius: var(--ps-radius-md); background: #fff; color: var(--ps-heading); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.ps-sp__cat:hover { border-color: color-mix(in srgb, var(--ps-primary) 55%, #fff); color: var(--ps-primary); box-shadow: 0 10px 24px rgba(17,24,39,.08); transform: translateY(-2px); }
.ps-sp__cat-img { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--ps-border); background: #fff; color: var(--ps-primary); }
.ps-sp__cat-img img { display: block; width: 100%; height: 100%; padding: 10px; object-fit: contain; transition: transform .35s ease; }
.ps-sp__cat:hover .ps-sp__cat-img img { transform: scale(1.06); }
.ps-sp__cat-name { display: -webkit-box; margin: 11px 12px 12px; overflow: hidden; font-size: 14px; font-weight: 600; line-height: 1.5; text-align: center; -webkit-line-clamp: 2; -webkit-box-orient: vertical; transition: color .2s ease; }
/* «All products»: the last tile, in the site's colour */
.ps-sp__cat--all { border-color: color-mix(in srgb, var(--ps-primary) 22%, #fff); background: var(--sp-tint); color: var(--ps-primary); }
.ps-sp__cat--all .ps-sp__cat-img { border-bottom-color: color-mix(in srgb, var(--ps-primary) 14%, #fff); background: none; }
.ps-sp__cat--all .ps-sp__cat-img svg { width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--ps-primary) 18%, transparent); transition: transform .25s ease; }
.ps-sp__cat--all:hover .ps-sp__cat-img svg { transform: scale(1.08); }
.ps-sp__cat--all .ps-sp__cat-name { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; }
.ps-sp__cat--all .ps-sp__cat-name svg { transition: transform .2s ease; }
.ps-sp__cat--all:hover .ps-sp__cat-name svg { transform: translateX(-3px); }
[dir="ltr"] .ps-sp__cat--all .ps-sp__cat-name svg { transform: scaleX(-1); }
[dir="ltr"] .ps-sp__cat--all:hover .ps-sp__cat-name svg { transform: scaleX(-1) translateX(-3px); }

/* Products found */
.ps-sp .ps-search-panel__results { max-width: none; }
.ps-sp .ps-search-panel__results:not(:empty) { padding-top: 24px; animation: ps-sp-in .3s ease both; }
.ps-sp .ps-search-results__head { margin-bottom: 14px; color: var(--ps-heading); font-size: 15px; font-weight: 700; }
.ps-sp .ps-search-results__head a { padding: 6px 12px; border-radius: var(--ps-radius-sm); background: var(--sp-tint); font-size: 13px; font-weight: 600; transition: background-color .2s ease; }
.ps-sp .ps-search-results__head a:hover { background: color-mix(in srgb, var(--ps-primary) 13%, #fff); }
/* Not a scroll box of its own: the whole panel scrolls (an inner box with overscroll-behavior: contain swallowed touch
   swipes that started on a product, so the list could only be moved from the empty margin) */
.ps-sp .ps-search-results__list { gap: 10px 14px; max-height: none; overflow: visible; overscroll-behavior: auto; padding: 2px; }
.ps-sp .ps-search-result { gap: 12px; padding: 8px; border: 1px solid var(--ps-border); border-radius: var(--ps-radius-md); transition: border-color .2s ease, box-shadow .2s ease; }
.ps-sp .ps-search-result:hover { border-color: color-mix(in srgb, var(--ps-primary) 55%, #fff); background: #fff; box-shadow: 0 6px 18px rgba(17,24,39,.06); }
.ps-sp .ps-search-result__img { width: 64px; height: 64px; overflow: hidden; border: 1px solid var(--ps-border); border-radius: var(--ps-radius-sm); background: #fff; }
.ps-sp .ps-search-result__img img { padding: 3px; object-fit: contain; }
.ps-sp .ps-search-result__title { font-weight: 600; }
.ps-sp .ps-search-result .price { color: var(--ps-primary); font-weight: 700; }
.ps-sp .ps-search-none { padding: 30px 0 10px; }
.ps-sp .ps-search-none svg { width: 54px; height: 54px; padding: 13px; border-radius: 50%; background: var(--sp-soft); color: var(--ps-primary); }

.ps-sp__hint { margin: 24px 0 0; color: var(--ps-muted); font-size: 12px; text-align: center; }
.ps-sp__hint kbd { display: inline-block; margin-inline-end: 4px; padding: 1px 7px; border: 1px solid var(--ps-border); border-bottom-width: 2px; border-radius: 4px; background: #fff; color: var(--ps-heading); font: 600 11px/1.6 system-ui, sans-serif; }

/* Tablet and up: the card floats clear of the screen's edges */
@media (min-width: 768px) {
	.ps-sp { padding: 24px; }
	.ps-sp .ps-search-panel { min-height: 0; }
}
@media (min-width: 1025px) {
	.ps-sp { --sp-pad: 32px; padding: 40px 32px; }
}
@media (min-width: 768px) and (max-width: 1024px) {
	.ps-sp .ps-search-field__go { padding: 0 20px; }
	.ps-sp__cats { gap: 12px; }
	.ps-sp__cat-name { font-size: 13.5px; }
	.ps-sp__hint { display: none; }
}
/* Phone: the whole screen, the field stays at the top while the lists scroll */
@media (max-width: 767px) {
	.ps-sp { --sp-pad: 15px; background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
	.ps-sp .ps-search-panel { max-width: none; min-height: 100%; border-radius: 0; box-shadow: none; transform: none; }
	.ps-sp .ps-sp__bar { position: sticky; top: 0; z-index: 2; padding: 12px 0; border-bottom: 1px solid var(--ps-border); border-radius: 0; }
	.ps-sp .ps-search-panel__top { gap: 8px; }
	.ps-sp .ps-search-field { height: 48px; }
	.ps-sp .ps-search-field__go { display: none; }
	.ps-sp .ps-search-field__icon { inset-inline-start: 14px; }
	.ps-sp .ps-search-field .ps-search-field__input { padding-inline: 44px 6px; }
	.ps-sp .ps-search-panel__close { width: 48px; height: 48px; }
	.ps-sp .ps-sp__body { padding-bottom: 32px; }
	.ps-sp__sec { padding-top: 20px; }
	.ps-sp__title { font-size: 14px; }
	.ps-sp__cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.ps-sp__cat:hover { transform: none; }
	.ps-sp__cat-img img { padding: 8px; }
	.ps-sp__cat-name { margin: 9px 10px 10px; font-size: 13.5px; }
	/* An odd last tile takes the whole row, picture beside the name */
	.ps-sp__cat:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 12px; padding: 8px; }
	.ps-sp__cat:last-child:nth-child(odd) .ps-sp__cat-img { flex: none; width: 64px; height: 64px; aspect-ratio: auto; border: 1px solid var(--ps-border); border-radius: var(--ps-radius-sm); }
	.ps-sp__cat:last-child:nth-child(odd) .ps-sp__cat-img img { padding: 3px; }
	.ps-sp__cat:last-child:nth-child(odd) .ps-sp__cat-name { margin: 0; text-align: start; }
	.ps-sp .ps-search-results__list { grid-template-columns: 1fr; }
	.ps-sp__hint { display: none; }
}
/*
 * The header's own search field on wide screens (form[data-ps-live-box]): its results drop down under it as a card in
 * the same style -- clear of the card's edges, one scroll only (the list), «see all» as a full-width button at the end.
 */
.ps-search-form[data-ps-live-box] { --sp-soft: color-mix(in srgb, var(--ps-heading) 5%, #fff); --sp-tint: color-mix(in srgb, var(--ps-primary) 7%, #fff); }
.ps-header .ps-search-form[data-ps-live-box]:focus-within .ps-search-form__input { border-color: var(--ps-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ps-primary) 12%, transparent); }
.ps-header .ps-search-form[data-ps-live-box] .ps-search-form__results { top: calc(100% + 8px); flex-direction: column; max-height: none; overflow: hidden; padding: 18px 20px 20px; border: 1px solid var(--ps-border); border-radius: var(--ps-radius-md); box-shadow: 0 24px 60px rgba(17,24,39,.16); }
.ps-header .ps-search-form[data-ps-live-box] .ps-search-form__results:not(:empty) { display: flex; }
.ps-search-form[data-ps-live-box] .ps-search-results__head { display: contents; }
.ps-search-form[data-ps-live-box] .ps-search-results__head > span { margin-bottom: 14px; color: var(--ps-heading); font-size: 15px; font-weight: 700; }
.ps-search-form[data-ps-live-box] .ps-search-results__head > a { order: 2; display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; margin-top: 16px; border-radius: var(--ps-radius-sm); background: var(--sp-tint); color: var(--ps-primary); font-size: 14px; font-weight: 700; transition: background-color .2s ease; }
.ps-search-form[data-ps-live-box] .ps-search-results__head > a:hover { background: color-mix(in srgb, var(--ps-primary) 13%, #fff); }
.ps-search-form[data-ps-live-box] .ps-search-results__list { order: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; max-height: min(52vh, 470px); margin: 0; padding: 2px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.ps-search-form[data-ps-live-box] .ps-search-result { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--ps-border); border-radius: var(--ps-radius-md); color: var(--ps-heading); transition: border-color .2s ease, box-shadow .2s ease; }
.ps-search-form[data-ps-live-box] .ps-search-result:nth-child(odd) { border-inline-end: 1px solid var(--ps-border); }
.ps-search-form[data-ps-live-box] .ps-search-result:hover { border-color: color-mix(in srgb, var(--ps-primary) 55%, #fff); background: #fff; box-shadow: 0 6px 18px rgba(17,24,39,.06); }
.ps-search-form[data-ps-live-box] .ps-search-result__img { flex: none; width: 64px; height: 64px; overflow: hidden; border: 1px solid var(--ps-border); border-radius: var(--ps-radius-sm); background: #fff; }
.ps-search-form[data-ps-live-box] .ps-search-result__img img { width: 100%; height: 100%; padding: 3px; object-fit: contain; }
.ps-search-form[data-ps-live-box] .ps-search-result__title { display: -webkit-box; margin: 0; font-size: 14px; font-weight: 600; line-height: 1.6; }
.ps-search-form[data-ps-live-box] .ps-search-result .price { color: var(--ps-primary); font-weight: 700; }
.ps-search-form[data-ps-live-box] .ps-search-none { padding: 18px 0 6px; }
.ps-search-form[data-ps-live-box] .ps-search-none svg { width: 54px; height: 54px; padding: 13px; border-radius: 50%; background: var(--sp-soft); color: var(--ps-primary); }

/* Mouse drag to scroll (search-panel.js) */
.ps-sp.is-dragging, .ps-search-results__list.is-dragging { cursor: grabbing; user-select: none; }
.ps-sp.is-dragging a, .ps-search-results__list.is-dragging a { pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
	.ps-sp__sec, .ps-sp .ps-search-panel__results:not(:empty) { animation: none; }
	.ps-sp .ps-search-panel, .ps-sp__cat, .ps-sp__cat-img img { transition: none; }
}
