/* =========================================================================
   Premium Shop page — Singair Mart  (.sh-* namespace)
   Sticky filter sidebar + AJAX product grid. Mobile: off-canvas drawer + FAB.
   ========================================================================= */

:root {
	--sh-primary: var(--singair-primary, #ff6a21);
	--sh-ink:     #111827;
	--sh-muted:   #6b7280;
	--sh-line:    #eef0f3;
	--sh-border:  1px solid #e5e7eb;
	--sh-radius:  14px;
	--sh-radius-sm: 10px;
	--sh-shadow:  0 1px 3px rgba(17,24,39,.06), 0 1px 2px rgba(17,24,39,.04);
}

.sh-page { padding: 1.25rem 0 3rem; color: var(--sh-ink); }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.sh-breadcrumb { display: flex; align-items: center; gap: .45rem; font-size: .82rem; color: var(--sh-muted); margin-bottom: 1.1rem; }
.sh-breadcrumb a { color: inherit; }
.sh-breadcrumb a:hover { color: var(--sh-primary); }
.sh-breadcrumb [aria-current] { color: var(--sh-ink); font-weight: 600; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.sh-layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 1.5rem; align-items: start; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sh-sidebar {
	background: #fff; border: var(--sh-border); border-radius: var(--sh-radius);
	box-shadow: var(--sh-shadow); position: sticky; top: 90px;
	max-height: calc(100vh - 110px); overflow-y: auto; scrollbar-width: thin;
}
.sh-sidebar__head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: var(--sh-line) solid 1px; }
.sh-sidebar__head h2 { margin: 0; font-size: 1rem; font-weight: 800; }
.sh-sidebar__close { display: none; width: 32px; height: 32px; border: var(--sh-border); border-radius: 8px; background: #fff; cursor: pointer; color: var(--sh-muted); }

.sh-filter { padding: 1.1rem 1.25rem; border-bottom: var(--sh-line) solid 1px; }
.sh-filter:last-of-type { border-bottom: 0; }
.sh-filter__title { margin: 0 0 .75rem; font-size: .85rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }

.sh-list, .sh-cats, .sh-cats__children { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.sh-cats__children { margin: .45rem 0 .2rem 1.35rem; }

.sh-check { display: flex; align-items: center; gap: .5rem; font-size: .85rem; cursor: pointer; color: #374151; }
.sh-check:hover { color: var(--sh-primary); }
.sh-check input { accent-color: var(--sh-primary); width: 15px; height: 15px; flex-shrink: 0; }
.sh-check span { flex: 1; min-width: 0; }
.sh-check small { color: #9ca3af; font-size: .74rem; }
.sh-verified { color: #3b82f6; font-size: .72rem; }
.sh-stars { color: #f5b400; font-size: .78rem; letter-spacing: 1px; }

/* Price slider (dual-range) */
.sh-price__slider { position: relative; height: 22px; margin: .3rem 2px .8rem; }
.sh-price__track { position: absolute; top: 9px; left: 0; right: 0; height: 5px; border-radius: 3px; background: var(--sh-line); }
.sh-price__fill { position: absolute; top: 0; height: 100%; border-radius: 3px; background: var(--sh-primary); }
.sh-price__slider input[type="range"] {
	position: absolute; inset: 0; width: 100%; margin: 0; background: none;
	-webkit-appearance: none; appearance: none; pointer-events: none; height: 22px;
}
.sh-price__slider input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none; appearance: none; pointer-events: auto;
	width: 17px; height: 17px; border-radius: 50%; cursor: grab;
	background: var(--sh-primary); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(17,24,39,.3);
}
.sh-price__slider input[type="range"]::-moz-range-thumb {
	pointer-events: auto; width: 13px; height: 13px; border-radius: 50%;
	cursor: grab; background: var(--sh-primary); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(17,24,39,.3);
}
.sh-price__inputs { display: flex; align-items: center; gap: .45rem; }
.sh-price__inputs label {
	display: flex; align-items: center; gap: .25rem; flex: 1;
	border: var(--sh-border); border-radius: 8px; padding: 0 .5rem; background: #fff;
}
.sh-price__inputs label span { color: var(--sh-muted); font-size: .78rem; }
.sh-price__inputs input { width: 100%; border: 0; height: 34px; font-size: .82rem; outline: none; }
.sh-price__dash { color: var(--sh-muted); }
.sh-apply {
	height: 36px; padding: 0 .9rem; border: 0; border-radius: 8px; cursor: pointer;
	background: var(--sh-primary); color: #fff; font-weight: 700; font-size: .78rem;
}
.sh-apply:hover { background: #e85d13; }

/* Swatches + sizes */
.sh-swatches { display: flex; flex-wrap: wrap; gap: .5rem; }
.sh-swatch { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; font-size: .8rem; }
.sh-swatch input { position: absolute; opacity: 0; }
.sh-swatch__dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #e5e7eb; box-shadow: inset 0 0 0 2px #fff; }
.sh-swatch input:checked + .sh-swatch__dot { border-color: var(--sh-primary); }
.sh-sizes { display: flex; flex-wrap: wrap; gap: .45rem; }
.sh-size input { position: absolute; opacity: 0; }
.sh-size span {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 40px; height: 32px; padding: 0 .6rem;
	border: var(--sh-border); border-radius: 8px; font-size: .78rem; font-weight: 600; cursor: pointer;
}
.sh-size input:checked + span { background: var(--sh-primary); border-color: var(--sh-primary); color: #fff; }

.sh-clear {
	display: block; width: calc(100% - 2.5rem); margin: 1rem 1.25rem 1.25rem;
	height: 38px; border: var(--sh-border); border-radius: 8px; background: #fff;
	color: var(--sh-muted); font-weight: 600; font-size: .8rem; cursor: pointer;
}
.sh-clear:hover { border-color: var(--sh-primary); color: var(--sh-primary); }

/* ── Header / tools ──────────────────────────────────────────────────────── */
.sh-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.sh-title { margin: 0 0 .2rem; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.sh-count { margin: 0; font-size: .84rem; color: var(--sh-muted); }
.sh-tools { display: flex; align-items: center; gap: .7rem; }
.sh-view { display: inline-flex; border: var(--sh-border); border-radius: 9px; overflow: hidden; }
.sh-view__btn { width: 38px; height: 38px; border: 0; background: #fff; cursor: pointer; color: var(--sh-muted); }
.sh-view__btn.is-active { background: var(--sh-primary); color: #fff; }
.sh-sort { display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; color: var(--sh-muted); }
.sh-select { height: 38px; padding: 0 .7rem; border: var(--sh-border); border-radius: 9px; background: #fff; font-size: .82rem; font-weight: 600; cursor: pointer; }

/* ── Quick pills ─────────────────────────────────────────────────────────── */
.sh-pills { display: flex; gap: .55rem; flex-wrap: wrap; margin-bottom: 1rem; }
.sh-pill {
	display: inline-flex; align-items: center; gap: .4rem;
	height: 38px; padding: 0 1rem; border: var(--sh-border); border-radius: 999px;
	background: #fff; font-size: .8rem; font-weight: 600; color: #374151; cursor: pointer;
	transition: all .16s ease;
}
.sh-pill:hover { border-color: var(--sh-primary); color: var(--sh-primary); }
.sh-pill.is-active { background: #fff1e9; border-color: var(--sh-primary); color: var(--sh-primary); }

/* ── Active filter chips ─────────────────────────────────────────────────── */
.sh-chips { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: 1rem; }
.sh-chip {
	display: inline-flex; align-items: center; gap: .4rem;
	height: 30px; padding: 0 .7rem; border: 0; border-radius: 999px;
	background: #eef2f7; color: #374151; font-size: .76rem; font-weight: 600; cursor: pointer;
}
.sh-chip i { font-size: .68rem; opacity: .7; }
.sh-chip:hover { background: #fee2e2; color: #b91c1c; }
.sh-chip--clear { background: transparent; color: var(--sh-primary); text-decoration: underline; }

/* ── Grid ────────────────────────────────────────────────────────────────── */
.sh-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.sh-page[data-columns="2"] .sh-grid { grid-template-columns: repeat(2, 1fr); }
.sh-page[data-columns="3"] .sh-grid { grid-template-columns: repeat(3, 1fr); }
.sh-page[data-columns="5"] .sh-grid { grid-template-columns: repeat(5, 1fr); }

/* List view */
.sh-page.is-list .sh-grid { grid-template-columns: 1fr !important; }
.sh-page.is-list .sm-product-card { display: grid; grid-template-columns: 200px 1fr; align-items: center; }

/* Loading state */
.sh-grid-wrap.is-loading { opacity: .45; pointer-events: none; transition: opacity .15s ease; }
.sh-grid-wrap { transition: opacity .15s ease; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.sh-empty { text-align: center; padding: 4rem 1rem; background: #fff; border: var(--sh-border); border-radius: var(--sh-radius); }
.sh-empty i { font-size: 2.2rem; color: #d1d5db; margin-bottom: .75rem; }
.sh-empty h2 { margin: 0 0 .3rem; font-size: 1.2rem; }
.sh-empty p { color: var(--sh-muted); margin: 0 0 1.1rem; }
.sh-empty__cap { margin: 1.75rem 0 .6rem !important; font-weight: 700; color: var(--sh-ink) !important; }
.sh-empty__cats { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.sh-empty__cats a {
	padding: .4rem .9rem; border: var(--sh-border); border-radius: 999px;
	font-size: .8rem; font-weight: 600; color: #374151;
}
.sh-empty__cats a:hover { border-color: var(--sh-primary); color: var(--sh-primary); }

/* ── Pagination / footer ─────────────────────────────────────────────────── */
.sh-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }
.sh-pagination { display: flex; align-items: center; gap: .35rem; }
.sh-page-btn {
	min-width: 38px; height: 38px; padding: 0 .5rem;
	border: var(--sh-border); border-radius: 9px; background: #fff;
	font-weight: 600; font-size: .84rem; cursor: pointer; color: var(--sh-ink);
}
.sh-page-btn:hover:not(:disabled) { border-color: var(--sh-primary); color: var(--sh-primary); }
.sh-page-btn.is-active { background: var(--sh-primary); border-color: var(--sh-primary); color: #fff; }
.sh-page-btn:disabled { opacity: .4; cursor: not-allowed; }
.sh-page-dots { color: var(--sh-muted); padding: 0 .2rem; }
.sh-perpage { display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; color: var(--sh-muted); }

/* ── Mobile FAB + drawer ─────────────────────────────────────────────────── */
.sh-fab {
	display: none; position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
	z-index: 60; align-items: center; gap: .5rem; height: 46px; padding: 0 1.4rem;
	border: 0; border-radius: 999px; background: var(--sh-primary); color: #fff;
	font-weight: 700; font-size: .88rem; cursor: pointer; box-shadow: 0 8px 24px rgba(255,106,33,.4);
}
.sh-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(17,24,39,.5); opacity: 0; visibility: hidden; transition: opacity .2s ease; }
.sh-overlay.is-open { opacity: 1; visibility: visible; }

@media (max-width: 1024px) {
	.sh-layout { grid-template-columns: 1fr; }
	.sh-sidebar {
		position: fixed; left: 0; top: 0; bottom: 0; z-index: 80;
		width: min(320px, 88vw); max-height: none; height: 100%;
		border-radius: 0; transform: translateX(-100%); transition: transform .25s ease;
	}
	.sh-sidebar.is-open { transform: translateX(0); }
	.sh-sidebar__close { display: inline-flex; align-items: center; justify-content: center; }
	.sh-fab { display: inline-flex; }
	.sh-grid, .sh-page[data-columns] .sh-grid { grid-template-columns: repeat(3, 1fr); }
	.sh-pills { overflow-x: auto; flex-wrap: nowrap; padding-bottom: .3rem; scrollbar-width: none; }
	.sh-pills::-webkit-scrollbar { display: none; }
	.sh-pill { flex-shrink: 0; }
}

@media (max-width: 640px) {
	.sh-grid, .sh-page[data-columns] .sh-grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
	.sh-title { font-size: 1.25rem; }
	.sh-tools { width: 100%; justify-content: space-between; }
	.sh-page.is-list .sm-product-card { grid-template-columns: 120px 1fr; }
	.sh-foot { justify-content: center; }
}

/* ── Mobile: shop grid must shrink + cap columns (was bare 1fr → overflow) ── */
.sh-grid,
.sh-page[data-columns="2"] .sh-grid,
.sh-page[data-columns="3"] .sh-grid,
.sh-page[data-columns="5"] .sh-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sh-page[data-columns="2"] .sh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sh-page[data-columns="3"] .sh-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sh-page[data-columns="5"] .sh-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 900px) { .sh-grid, .sh-page[data-columns] .sh-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (max-width: 640px) { .sh-grid, .sh-page[data-columns] .sh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .7rem; } }
@media (max-width: 380px) { .sh-grid, .sh-page[data-columns] .sh-grid { grid-template-columns: 1fr !important; } }
/* list view card must not force a fixed 200px image column on mobile */
@media (max-width: 560px) { .sh-page.is-list .sm-product-card { grid-template-columns: 1fr !important; } }

/* Root overflow fix: single-column collapse of .sh-layout is min-content-based
   (bare 1fr). Force shrink + let the grid child shrink below its content. */
@media (max-width: 1024px) {
	.sh-layout { grid-template-columns: minmax(0, 1fr) !important; }
	.sh-layout > * { min-width: 0; }
	.sh-grid-wrap, .sh-main, .sh-content { min-width: 0; }
}
