/* Instant Shop Filter & Search. Colours and radius come from the settings as --isf-* variables on :root.
   The phone layout is switched by the .isf-phone class (set by shop.js from the breakpoint setting), so the
   breakpoint can be changed without editing this file. Flat, rounded, the theme's own font. */

:root {
	--isf-ink: #0b0b0d;
	--isf-accent: #e6be8a;
	--isf-accent-dark: #996515;
	--isf-line: #ece8ea;
	--isf-soft: #f6f6f8;
	--isf-muted: #6b6f78;
	--isf-radius: 18px;
}

/* Themes often set overflow-x:hidden on html/body, which turns them into scroll containers and stops the phone
   search bar from sticking. clip still hides sideways overflow without that side effect. */
html:has(.isf-shop),
body.isf-has-shop,
body:has(.isf-shop) {
	overflow-x: clip !important;
	overflow-y: visible !important;
}

/* Don't depend on the theme for box sizing (padding and borders stay inside widths). */
.isf-shop .isf-app,
.isf-shop .isf-app *,
.isf-search,
.isf-search * {
	box-sizing: border-box;
}

/* Neutralise theme button/input styles inside our components. */
.isf-shop button,
.isf-search button,
.isf-shop input,
.isf-shop select,
.isf-search input {
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	box-shadow: none;
	margin: 0;
}
.isf-shop button,
.isf-search button {
	appearance: none;
	border: 0;
	background: none;
	color: inherit;
	padding: 0;
	min-height: 0;
	line-height: normal;
	cursor: pointer;
}
.isf-shop button:focus-visible,
.isf-shop input:focus-visible,
.isf-shop select:focus-visible,
.isf-search button:focus-visible,
.isf-search a:focus-visible,
.isf-search input:focus-visible {
	outline: 2px solid var(--isf-ink);
	outline-offset: 2px;
}
.isf-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
.isf-shop .isf-hide,
.isf-shop [hidden],
.isf-search [hidden] {
	display: none !important;
}
html.isf-lock {
	overflow: hidden;
}

/* ---------- Feature A: shop filter ---------- */

.isf-shop .isf-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 18px;
}
.isf-shop .isf-field {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	height: 52px;
	margin: 0;
	padding: 0 8px 0 18px;
	border-radius: 99px;
	background: var(--isf-soft);
	border: 1.5px solid transparent;
	transition: border-color 0.15s, background 0.15s;
}
.isf-shop .isf-field:focus-within {
	border-color: var(--isf-ink);
	background: #fff;
}
.isf-shop .isf-field svg {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	color: var(--isf-muted);
}
.isf-shop .isf-field input {
	flex: 1;
	width: 0; /* themes often set inputs to 100%; flex decides the width here */
	min-width: 0;
	height: 100%;
	padding: 0;
	border: 0;
	background: none;
	font-size: 16px; /* 16px stops iPhone zooming in */
	outline: none;
	color: var(--isf-ink);
}
.isf-shop .isf-field input::-webkit-search-cancel-button {
	display: none;
}
.isf-shop .isf-x {
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #fff;
	font-size: 20px;
	line-height: 1;
	color: var(--isf-ink);
}
.isf-shop .isf-open {
	position: relative;
	display: none;
	place-items: center;
	flex: 0 0 52px;
	height: 52px;
	border-radius: 16px;
	background: var(--isf-accent);
	color: var(--isf-ink);
}
.isf-shop .isf-open svg {
	width: 24px;
	height: 24px;
}
.isf-shop .isf-badge {
	position: absolute;
	top: -5px;
	right: -5px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 99px;
	background: var(--isf-ink);
	color: #fff;
	font-size: 12px;
	line-height: 22px;
}
.isf-shop .isf-sort {
	flex: 0 0 auto;
	width: auto; /* themes often set selects to 100% */
	max-width: 240px;
	height: 52px;
	padding: 0 40px 0 16px;
	border: 1.5px solid var(--isf-line);
	border-radius: 99px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%230b0b0d' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 16px center;
	font-size: 15px;
	font-weight: 600;
	color: var(--isf-ink);
	appearance: none;
	cursor: pointer;
}
.isf-shop .isf-body {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

/* the theme's own product grid, made to fit the results column */
.isf-shop ul.products {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	margin: 0 !important;
	padding: 0 !important;
}
.isf-shop ul.products::before,
.isf-shop ul.products::after {
	display: none !important;
}
.isf-shop ul.products li.product {
	width: auto !important;
	margin: 0 !important;
	float: none !important;
	clear: none !important;
}

/* the filter panel: a sidebar card on desktop */
.isf-shop .isf-panel {
	position: sticky;
	top: 24px;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 22px;
	padding: 20px;
	border: 1px solid var(--isf-line);
	border-radius: calc(var(--isf-radius) + 2px);
	background: #fff;
	color: var(--isf-ink);
}
.isf-shop .isf-panel header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0;
	padding: 0;
	background: none;
}
.isf-shop .isf-panel h2 {
	margin: 0;
	font-size: 20px;
	font-weight: 800;
	outline: none;
	color: inherit;
}
.isf-shop .isf-panel h3 {
	margin: 0 0 12px;
	font-size: 15px;
	font-weight: 800;
	color: inherit;
}
.isf-shop .isf-panel section {
	margin: 0;
	padding: 0;
}
.isf-shop .isf-reset {
	font-weight: 700;
	color: var(--isf-accent-dark);
	text-decoration: underline;
}
.isf-shop .isf-reset:disabled {
	color: var(--isf-muted);
	text-decoration: none;
	cursor: default;
}
.isf-shop .isf-grip,
.isf-shop .isf-panel footer,
.isf-shop .isf-backdrop,
.isf-shop .isf-sortsec {
	display: none;
}
.isf-shop .isf-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.isf-shop .isf-chips button {
	min-height: 36px;
	padding: 0 12px;
	border-radius: 10px;
	background: var(--isf-soft);
	border: 1.5px solid transparent;
	font-weight: 600;
	font-size: 13.5px;
	color: var(--isf-ink);
	transition: background 0.15s, border-color 0.15s;
}
.isf-shop .isf-chips button:hover {
	border-color: var(--isf-line);
}
.isf-shop .isf-chips button[aria-pressed='true'] {
	background: var(--isf-ink);
	color: #fff;
}
.isf-shop .isf-budgets {
	margin-top: 14px;
}
.isf-shop .isf-budgets button {
	font-size: 13px;
}
.isf-shop .isf-minmax {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: end;
	gap: 8px;
}
.isf-shop .isf-minmax > span {
	padding-bottom: 12px;
	color: var(--isf-muted);
}
.isf-shop .isf-minmax label {
	display: block;
	min-width: 0;
	margin: 0;
}
.isf-shop .isf-minmax label span {
	display: block;
	margin-bottom: 4px;
	color: var(--isf-muted);
	font-size: 12.5px;
}
.isf-shop .isf-minmax input {
	width: 100%;
	height: 46px;
	padding: 0 12px;
	border: 1.5px solid var(--isf-ink);
	border-radius: 12px;
	background: #fff;
	font-size: 16px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--isf-ink);
}
.isf-shop .isf-minmax input::placeholder {
	color: var(--isf-muted);
	font-weight: 500;
}

/* two-handle slider: two native range inputs on one track, the part between them filled with the accent */
.isf-shop .isf-range {
	position: relative;
	height: 36px;
	margin-top: 10px;
}
.isf-shop .isf-range::before {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 6px;
	margin-top: -3px;
	border-radius: 99px;
	background: linear-gradient(90deg, var(--isf-line) var(--isf-a, 0%), var(--isf-accent) var(--isf-a, 0%), var(--isf-accent) var(--isf-b, 100%), var(--isf-line) var(--isf-b, 100%));
}
.isf-shop .isf-range input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 36px;
	padding: 0;
	border: 0;
	background: none;
	appearance: none;
	pointer-events: none;
}
.isf-shop .isf-range input::-webkit-slider-runnable-track {
	height: 36px;
	background: none;
}
.isf-shop .isf-range input::-moz-range-track {
	background: none;
}
.isf-shop .isf-range input::-webkit-slider-thumb {
	width: 28px;
	height: 28px;
	margin-top: 4px;
	border-radius: 50%;
	border: 3px solid #fff;
	background: var(--isf-ink);
	box-shadow: 0 2px 8px rgba(11, 11, 13, 0.35);
	appearance: none;
	pointer-events: auto;
	cursor: grab;
}
.isf-shop .isf-range input::-moz-range-thumb {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 3px solid #fff;
	background: var(--isf-ink);
	box-shadow: 0 2px 8px rgba(11, 11, 13, 0.35);
	pointer-events: auto;
	cursor: grab;
}
.isf-shop .isf-range input:focus-visible {
	outline: none;
}
.isf-shop .isf-range input:focus-visible::-webkit-slider-thumb {
	outline: 2px solid var(--isf-ink);
	outline-offset: 2px;
}
.isf-shop .isf-range input:focus-visible::-moz-range-thumb {
	outline: 2px solid var(--isf-ink);
	outline-offset: 2px;
}

/* toggle switch */
.isf-shop .isf-switch {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	margin: 0;
	font-weight: 600;
	cursor: pointer;
}
.isf-shop .isf-switch input {
	position: absolute;
	opacity: 0;
	width: 48px;
	height: 28px;
}
.isf-shop .isf-switch span {
	position: relative;
	flex: 0 0 48px;
	height: 28px;
	border-radius: 99px;
	background: #d9d6d0;
	transition: background 0.15s;
}
.isf-shop .isf-switch span::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.15s;
}
.isf-shop .isf-switch input:checked + span {
	background: var(--isf-ink);
}
.isf-shop .isf-switch input:checked + span::after {
	transform: translateX(20px);
}
.isf-shop .isf-switch input:focus-visible + span {
	outline: 2px solid var(--isf-ink);
	outline-offset: 2px;
}

/* applied filters */
.isf-shop .isf-applied {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	min-height: 38px;
	margin-bottom: 14px;
}
.isf-shop .isf-applied-chips {
	display: contents;
}
.isf-shop .isf-count {
	margin-right: 6px;
	color: var(--isf-muted);
	font-weight: 600;
}
.isf-shop .isf-applied button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 34px;
	padding: 0 12px;
	border-radius: 99px;
	background: var(--isf-ink);
	color: #fff;
	font-size: 13.5px;
	font-weight: 600;
}
.isf-shop .isf-applied button span {
	font-size: 17px;
	line-height: 1;
	opacity: 0.8;
}
.isf-shop .isf-applied .isf-clear {
	background: none;
	color: var(--isf-accent-dark);
	text-decoration: underline;
}

/* nothing matches */
.isf-shop .isf-none {
	padding: 28px;
	border-radius: calc(var(--isf-radius) + 2px);
	background: var(--isf-soft);
}
.isf-shop .isf-none h2 {
	margin: 0;
	font-size: 22px;
	font-weight: 800;
}
.isf-shop .isf-none p {
	margin: 6px 0 14px;
	color: var(--isf-muted);
}
.isf-shop .isf-none .isf-chips button {
	min-height: 42px;
	padding: 0 16px;
	border-radius: 12px;
	background: #fff;
}
.isf-shop .isf-none h3 {
	margin: 28px 0 12px;
	font-size: 17px;
	font-weight: 800;
}
.isf-shop .isf-none ul.products {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1100px) {
	.isf-shop ul.products,
	.isf-shop .isf-none ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Long shops (hundreds of cards): the browser skips layout and paint for cards far off screen, which keeps
   scrolling smooth on phones. Browsers without content-visibility ignore it. */
.isf-shop ul.products > li.product {
	content-visibility: auto;
	contain-intrinsic-size: auto 420px;
}

/* phones (class set by shop.js from the breakpoint setting) */
.isf-shop.isf-phone .isf-bar {
	position: sticky;
	top: var(--isf-top, 0px);
	z-index: 40;
	margin: 0 -14px 12px;
	padding: 10px 14px;
	background: #fff;
	box-shadow: 0 8px 14px -14px rgba(11, 11, 13, 0.4);
}
.isf-shop.isf-phone .isf-open {
	display: grid;
}
.isf-shop.isf-phone .isf-sort {
	display: none;
}
.isf-shop.isf-phone .isf-sortsec {
	display: block;
}
.isf-shop.isf-phone .isf-body {
	grid-template-columns: minmax(0, 1fr);
}
.isf-shop.isf-phone ul.products {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}
.isf-shop.isf-phone .isf-panel {
	position: fixed;
	left: 0;
	right: 0;
	top: auto;
	bottom: 0;
	z-index: 99995;
	max-height: 86vh;
	padding: 10px 20px 0;
	border: 0;
	border-radius: calc(var(--isf-radius) + 8px) calc(var(--isf-radius) + 8px) 0 0;
	box-shadow: 0 -20px 50px rgba(11, 11, 13, 0.25);
	transform: translateY(105%);
	transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
	/* iOS Safari let the sheet itself slide sideways; only the category row may scroll sideways */
	overflow-x: hidden;
	overscroll-behavior: contain;
	touch-action: pan-y;
}
.isf-shop.isf-phone .isf-panel > * {
	min-width: 0;
	max-width: 100%;
}
.isf-shop.isf-phone .isf-panel input {
	max-width: 100%;
	min-width: 0;
}
.isf-shop.isf-phone .isf-panel.open {
	transform: none;
}
.isf-shop.isf-phone .isf-grip {
	display: block;
	width: 44px;
	height: 5px;
	margin: 0 auto;
	border-radius: 99px;
	background: #d9d6d0;
}
.isf-shop.isf-phone .isf-cats {
	flex-wrap: nowrap;
	overflow-x: auto;
	margin: 0 -20px;
	padding: 0 20px 4px;
	scrollbar-width: none;
	touch-action: pan-x pan-y;
	overscroll-behavior-x: contain;
}
.isf-shop.isf-phone .isf-panel .isf-chips button {
	flex-shrink: 0;
	min-height: 46px;
	padding: 0 16px;
	border-radius: 12px;
	font-size: 14px;
}
.isf-shop.isf-phone .isf-panel footer {
	display: block;
	position: sticky;
	bottom: 0;
	margin: 0 -20px;
	padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
	background: #fff;
	border-top: 1px solid var(--isf-line);
}
.isf-shop.isf-phone .isf-show {
	width: 100%;
	height: 54px;
	border-radius: 16px;
	background: var(--isf-ink);
	color: #fff;
	font-size: 16px;
	font-weight: 800;
}
.isf-shop.isf-phone .isf-backdrop {
	display: block;
	position: fixed;
	inset: 0;
	z-index: 99994;
	background: rgba(11, 11, 13, 0.45);
}
.isf-shop.isf-phone .isf-applied {
	flex-wrap: nowrap;
	overflow-x: auto;
	scrollbar-width: none;
	margin: 0 -14px 12px;
	padding: 0 14px;
}
.isf-shop.isf-phone .isf-applied > *,
.isf-shop.isf-phone .isf-applied button {
	flex-shrink: 0;
}
.isf-shop.isf-phone .isf-none {
	padding: 20px;
}
.isf-shop.isf-phone .isf-none ul.products {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (prefers-reduced-motion: reduce) {
	.isf-shop .isf-panel {
		transition: none !important;
	}
}

/* ---------- Feature B: header search ---------- */

/* the shop filter has its own search box, so the header one steps aside on that page */
body:has(.isf-shop) .isf-search,
body.isf-has-shop .isf-search {
	display: none !important;
}
.isf-search {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0; /* can shrink inside a crowded flex header */
	height: 52px;
	margin: 0;
	padding: 0 5px 0 20px;
	border-radius: 99px;
	background: var(--isf-soft);
	color: var(--isf-ink);
}
.isf-search > svg {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
}
.isf-search input[type='search'] {
	flex: 1;
	width: 0; /* no intrinsic width: grows with flex, never forces the box wider */
	min-width: 0;
	height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	font-size: 16px;
	color: var(--isf-ink);
	outline: none;
}
.isf-search input::placeholder {
	color: var(--isf-muted);
}
.isf-search input::-webkit-search-cancel-button {
	cursor: pointer;
}
.isf-search button[type='submit'] {
	flex-shrink: 0;
	height: 42px;
	padding: 0 20px;
	border-radius: 99px;
	background: var(--isf-accent);
	color: var(--isf-ink);
	font-weight: 800;
	font-size: 15px;
}
.isf-search button[type='submit']:hover {
	background: var(--isf-ink);
	color: var(--isf-accent);
}
.isf-search .isf-hs-pop {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	z-index: 9990;
	max-height: min(70vh, 560px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 8px;
	border: 1px solid var(--isf-line);
	border-radius: var(--isf-radius);
	background: #fff;
	box-shadow: 0 24px 48px -16px rgba(11, 11, 13, 0.28);
	text-align: left;
}
.isf-search .isf-hs-pop ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.isf-search .isf-hs-pop a {
	color: var(--isf-ink);
	text-decoration: none;
}
.isf-search .isf-hs-note,
.isf-search .isf-hs-none p {
	margin: 0;
	padding: 12px;
	color: var(--isf-muted);
	font-size: 14.5px;
}
.isf-search .isf-hs-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 4px 4px 10px !important;
	margin-bottom: 6px !important;
	border-bottom: 1px solid var(--isf-line);
}
.isf-search .isf-hs-cats a {
	display: inline-flex;
	align-items: baseline;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 10px;
	background: var(--isf-soft);
	font-size: 14px;
}
.isf-search .isf-hs-cats small {
	color: var(--isf-muted);
}
.isf-search .isf-hs-list li {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0 6px 0 0;
	border-radius: 12px;
}
.isf-search .isf-hs-list li:hover,
.isf-search .isf-hs-list li:focus-within {
	background: var(--isf-soft);
}
.isf-search .isf-hs-item {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: 12px;
}
.isf-search .isf-hs-img {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	border-radius: 10px;
	overflow: hidden;
	background: var(--isf-soft);
}
.isf-search .isf-hs-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.isf-search .isf-hs-txt {
	min-width: 0;
	display: grid;
	gap: 2px;
}
.isf-search .isf-hs-txt b {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-weight: 600;
	font-size: 14.5px;
}
.isf-search .isf-hs-txt em {
	font-style: normal;
	font-weight: 800;
	font-size: 14.5px;
}
.isf-search .isf-hs-txt small {
	color: #c0392b;
	font-size: 12.5px;
	font-weight: 600;
}
.isf-search .isf-qadd {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--isf-accent);
	color: var(--isf-ink);
	font-size: 22px;
	font-weight: 600;
	line-height: 1;
	transition: transform 0.15s, background 0.15s;
}
.isf-search .isf-qadd:hover {
	transform: scale(1.06);
}
.isf-search .isf-qadd.done {
	background: var(--isf-accent-dark);
	color: #fff;
	font-size: 18px;
}
.isf-search .isf-hs-choose {
	flex-shrink: 0;
	padding: 8px 12px;
	border-radius: 99px;
	border: 1.5px solid var(--isf-line);
	font-weight: 700;
	font-size: 13px;
}
.isf-search .isf-hs-all,
.isf-search .isf-hs-none a {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 6px;
	padding: 12px;
	border-radius: 12px;
	background: var(--isf-ink);
	color: #fff !important;
	font-weight: 700;
	font-size: 14.5px;
}
.isf-search .isf-hs-all svg,
.isf-search .isf-hs-none a svg {
	width: 18px;
	height: 18px;
}
@media (max-width: 600px) {
	.isf-search {
		height: 50px;
		padding-left: 16px;
	}
	.isf-search button[type='submit'] {
		padding: 0 14px;
	}
}

/* 1.2.0: cards load in batches */
.isf-shop .isf-more {
	display: block;
	margin: 22px auto 4px;
	padding: 12px 26px;
	border: 1.5px solid var(--isf-ink);
	border-radius: 99px;
	background: #fff;
	color: var(--isf-ink);
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}
.isf-shop .isf-more:hover {
	background: var(--isf-ink);
	color: #fff;
}
.isf-nojs-list {
	columns: 2 220px;
	margin: 18px 0;
	padding-left: 18px;
	line-height: 1.8;
}
