/*!
 * DREA Shop Sidebar
 * Inherits the theme: fonts, text colour and button styles come from the
 * theme; the accent and border use the theme's palette when it has one
 * (Blocksy, Astra, Kadence, GeneratePress variables), else neutral defaults.
 */
.dss-layout {
	--dss-accent: var(--theme-palette-color-1, var(--ast-global-color-0, var(--global-palette1, var(--accent, #2563eb))));
	--dss-border: var(--theme-border-color, rgba(0, 0, 0, .12));
	--dss-muted: color-mix(in srgb, currentColor 62%, transparent);
	--dss-soft: color-mix(in srgb, var(--dss-accent) 8%, transparent);
	--dss-radius: 8px;
	--dss-width: 264px;
	display: grid;
	grid-template-columns: var(--dss-width) minmax(0, 1fr);
	gap: 32px;
	align-items: start;
	margin: 0 0 24px;
}

.dss-layout *,
.dss-layout *::before,
.dss-layout *::after { box-sizing: border-box; }

.dss-results { min-width: 0; grid-column: 2; grid-row: 1 / span 2; }
.dss-sidebar { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: calc(var(--admin-bar, 0px) + 24px); max-height: calc(100vh - 48px); overflow: auto; overscroll-behavior: contain; padding-right: 4px; font-size: 14px; }

/* Shortcode version (sidebar placed in its own column of a page builder layout) */
.dss-layout--standalone { display: block; margin: 0; height: 100%; }
.dss-layout--standalone .dss-sidebar { grid-column: auto; grid-row: auto; }

/* Hidden helpers */
.dss-toggle-input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.dss-mobilebar,
.dss-backdrop,
.dss-close,
.dss-foot { display: none; }

.dss-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px; }
.dss-title { margin: 0; font-size: 18px; line-height: 1.3; }
.dss-total { margin: 0 0 14px; color: var(--dss-muted); }
.dss-total strong { color: var(--theme-text-color, inherit); font-weight: 700; }

/* Active filters */
.dss-active { margin: 0 0 14px; padding: 0 0 14px; border-bottom: 1px solid var(--dss-border); }
.dss-chips { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dss-chips li { margin: 0; }
.dss-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--dss-soft); border: 1px solid color-mix(in srgb, var(--dss-accent) 30%, transparent); color: inherit; text-decoration: none; font-size: 13px; line-height: 1.4; }
.dss-chip:hover, .dss-chip:focus-visible { border-color: var(--dss-accent); }
.dss-chip-group { color: var(--dss-muted); }
.dss-x { font-size: 16px; line-height: 1; margin-left: 2px; }
.dss-clear, .dss-clear-inline { color: var(--dss-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* Groups */
.dss-group { border-bottom: 1px solid var(--dss-border); padding: 4px 0; }
.dss-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 0; font-weight: 600; }
.dss-group > summary::-webkit-details-marker { display: none; }
.dss-group > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; opacity: .6; }
.dss-group[open] > summary::after { transform: rotate(-135deg); }
.dss-group-body { padding: 0 0 12px; }
.dss-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--dss-accent); color: #fff; font-size: 12px; font-weight: 700; line-height: 1; }

.dss-list { list-style: none; margin: 0; padding: 0; }
.dss-list li { margin: 0; }
.dss-opt { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 6px; color: inherit; text-decoration: none; line-height: 1.35; }
.dss-opt:hover, .dss-opt:focus-visible { background: var(--dss-soft); }
.dss-check { flex: 0 0 18px; width: 18px; height: 18px; border: 1.5px solid color-mix(in srgb, currentColor 45%, transparent); border-radius: 4px; position: relative; background: transparent; }
.dss-opt--radio .dss-check { border-radius: 50%; }
.dss-opt.is-on .dss-check { background: var(--dss-accent); border-color: var(--dss-accent); }
.dss-opt.is-on .dss-check::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.dss-opt--radio.is-on .dss-check::after { left: 4px; top: 4px; width: 7px; height: 7px; border: 0; border-radius: 50%; background: #fff; transform: none; }
.dss-opt.is-on .dss-label { font-weight: 600; }
.dss-label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.dss-count { flex: 0 0 auto; color: var(--dss-muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.dss-more > summary { cursor: pointer; color: var(--dss-accent); font-weight: 600; padding: 6px 4px; list-style: none; }
.dss-more > summary::-webkit-details-marker { display: none; }
.dss-more[open] > summary { display: none; }

/* Price */
.dss-price { margin: 0 0 8px; }
.dss-price-fields { display: flex; align-items: flex-end; gap: 8px; margin: 0 0 10px; }
.dss-price-fields label { flex: 1 1 0; display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 12px; color: var(--dss-muted); }
.dss-price-fields input { width: 100%; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--dss-border); border-radius: 6px; font: inherit; color: inherit; background: transparent; }
.dss-dash { padding-bottom: 9px; color: var(--dss-muted); }
.dss-price-go { width: 100%; }
.dss-slider { position: relative; height: 28px; margin: 4px 0 10px; }
.dss-slider::before { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 2px; background: var(--dss-border); }
.dss-slider .dss-fill { position: absolute; top: 12px; height: 4px; border-radius: 2px; background: var(--dss-accent); }
.dss-range { position: absolute; left: 0; top: 0; width: 100%; height: 28px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.dss-range::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--dss-accent); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.dss-range::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--dss-accent); cursor: pointer; }
.dss-range::-webkit-slider-runnable-track { background: none; }
.dss-range::-moz-range-track { background: none; }
.dss-range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--dss-accent); outline-offset: 2px; }
.dss-bands { margin-top: 4px; }

.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important; }

/* ---------------------------------------------------------------- */
/* Tablet & mobile: "Filters" button + slide-in panel                */
/* ---------------------------------------------------------------- */
@media (max-width: 999px) {
	.dss-layout { display: block; }
	.dss-layout--standalone { height: auto; }
	.dss-layout--standalone .dss-mobilebar { margin: 0; }
	.dss-results { grid-column: auto; grid-row: auto; }

	.dss-mobilebar { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; }
	.dss-toggle-btn { display: inline-flex !important; align-items: center; gap: 8px; cursor: pointer; margin: 0; }
	.dss-toggle-btn .dss-badge { background: #fff; color: var(--dss-accent); }

	.dss-sidebar {
		position: fixed; z-index: 100000; top: 0; bottom: 0; left: 0;
		width: min(88vw, 380px); max-height: none; height: 100%;
		padding: 18px 18px 0; overflow: auto;
		background: var(--theme-palette-color-8, #fff); color: var(--theme-text-color, inherit);
		box-shadow: 0 0 40px rgba(0, 0, 0, .25);
		transform: translateX(-105%); transition: transform .25s ease; visibility: hidden;
	}
	.dss-backdrop { position: fixed; inset: 0; z-index: 99999; background: rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; transition: opacity .25s; display: block; }
	.dss-toggle-input:checked ~ .dss-sidebar { transform: none; visibility: visible; }
	.dss-toggle-input:checked ~ .dss-backdrop { opacity: 1; pointer-events: auto; }
	.dss-close { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-right: -8px; font-size: 28px; line-height: 1; cursor: pointer; }
	.dss-foot { display: block; position: sticky; bottom: 0; margin: 12px -18px 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: inherit; border-top: 1px solid var(--dss-border); }
	.dss-apply { display: block !important; width: 100%; text-align: center; cursor: pointer; }
	.dss-opt { padding: 9px 4px; }
}

@media (prefers-reduced-motion: reduce) {
	.dss-sidebar, .dss-backdrop, .dss-group > summary::after { transition: none; }
}

/* Lock page scroll while the panel is open (set by the script). */
html.dss-lock, html.dss-lock body { overflow: hidden; }
