/*!
 * Voski Store Selector — front-end styles.
 * The breakpoint rule that reveals the mobile bar and the accent colour are
 * printed inline from the network settings (see VSS_Frontend::inline_css()).
 */

/* Accent tokens are overridden inline from the network settings. */
:root {
	--vss-accent: #222222;
	--vss-accent-soft: #e2e2e2;
	--vss-accent-ink: #181818;
	--vss-ink: #121212;
	--vss-muted: #6f6f6f;
	--vss-line: rgba(18, 18, 18, 0.08);
	--vss-hover: #f5f4f2;
	--vss-bar-bg: #faf8f5;
	--vss-z: 1000000000; /* above chat/loyalty launchers (e.g. WPLoyalty uses 999999999) */
}

#vss-panel[hidden],
#vss-scrim[hidden],
#vss-panel [hidden] {
	display: none !important;
}

/* Line icons. !important on fill beats theme rules such as `svg { fill: currentColor }`. */
svg.vss-svg {
	display: block;
	flex: none;
	overflow: visible;
	fill: none !important;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
 * Desktop trigger (the theme's existing "Change Location" link)
 * ----------------------------------------------------------------------- */

.vss-caret {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 16px;
	height: 16px;
	margin-left: 6px;
	opacity: 0.55;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.vss-caret svg {
	display: block;
	width: 14px;
	height: 14px;
}

.vss-is-trigger:hover .vss-caret,
.vss-is-trigger[aria-expanded="true"] .vss-caret {
	opacity: 1;
}

.vss-is-trigger[aria-expanded="true"] .vss-caret {
	transform: rotate(180deg);
}

/* Shortcode trigger: [store_selector] */
a.vss-trigger {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: inherit;
	font-weight: 600;
	text-decoration: none;
}

a.vss-trigger .vss-trigger__pin {
	display: inline-flex;
	color: var(--vss-accent);
}

a.vss-trigger svg {
	width: 18px;
	height: 18px;
}

/* --------------------------------------------------------------------------
 * Mobile location bar
 * ----------------------------------------------------------------------- */

/* No z-index here: a stacking context would trap the docked (fixed) bar beneath page content. */
#vss-bar {
	display: none;
	position: relative;
	box-sizing: border-box;
	flex: none;
	align-self: stretch;
	clear: both;
	width: auto;
	max-width: none;
	margin: 0;
	padding: 0;
	text-align: left;
}

#vss-bar .vss-bar__dock {
	background: var(--vss-bar-bg);
	border-top: 1px solid var(--vss-line);
	border-bottom: 1px solid var(--vss-line);
}

#vss-bar.is-docked .vss-bar__dock {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 990;
	background: rgba(250, 248, 245, 0.94);
	-webkit-backdrop-filter: saturate(160%) blur(10px);
	backdrop-filter: saturate(160%) blur(10px);
	box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.35);
}

#vss-bar .vss-bar__btn {
	all: unset;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 9px;
	width: 100%;
	min-height: 40px;
	padding: 5px 10px 5px 14px;
	cursor: pointer;
	font-family: inherit;
	font-size: 13px;
	line-height: 1.2;
	color: var(--vss-ink);
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	-webkit-tap-highlight-color: transparent;
	-webkit-user-select: none;
	user-select: none;
}

#vss-bar .vss-bar__btn:focus-visible {
	outline: 2px solid var(--vss-accent);
	outline-offset: -3px;
	border-radius: 10px;
}

#vss-bar .vss-bar__pin {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--vss-accent-soft);
	color: var(--vss-accent);
}

#vss-bar .vss-bar__pin svg {
	display: block;
	width: 14px;
	height: 14px;
}

#vss-bar .vss-bar__text {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

#vss-bar .vss-bar__label {
	margin-right: 0.3em;
	color: var(--vss-muted);
	font-weight: 500;
}

#vss-bar .vss-bar__store {
	color: var(--vss-ink);
	font-weight: 700;
}

#vss-bar .vss-bar__action {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	flex: none;
	height: 28px;
	padding: 0 8px 0 11px;
	border-radius: 999px;
	background: #fff;
	box-shadow: inset 0 0 0 1px rgba(18, 18, 18, 0.12);
	color: var(--vss-ink);
	font-size: 12px;
	font-weight: 600;
	transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

#vss-bar .vss-bar__action svg {
	display: block;
	width: 14px;
	height: 14px;
	transition: transform 0.22s ease;
}

#vss-bar .vss-bar__btn:active .vss-bar__action {
	background: var(--vss-hover);
}

#vss-bar.is-open .vss-bar__action {
	background: var(--vss-ink);
	color: #fff;
	box-shadow: none;
}

#vss-bar.is-open .vss-bar__action svg {
	transform: rotate(180deg);
}

#vss-bar.is-empty .vss-bar__store {
	font-weight: 600;
}

/* Set by the script when "Shopping at" + the store name wouldn't fit. */
#vss-bar.is-tight .vss-bar__label {
	display: none;
}

@media (max-width: 359px) {
	#vss-bar .vss-bar__label {
		display: none;
	}
}

/* --------------------------------------------------------------------------
 * Store panel (dropdown)
 * ----------------------------------------------------------------------- */

#vss-panel {
	position: fixed;
	top: 0;
	left: 0;
	z-index: calc(var(--vss-z) + 1);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	width: 404px;
	max-width: calc(100vw - 24px);
	max-height: var(--vss-max-h, 80vh);
	margin: 0;
	padding: 0;
	background: #fff;
	color: var(--vss-ink);
	border-radius: 16px;
	box-shadow:
		0 0 0 1px rgba(18, 18, 18, 0.07),
		0 2px 6px rgba(18, 18, 18, 0.05),
		0 22px 48px -12px rgba(18, 18, 18, 0.28);
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	opacity: 0;
	transform: translateY(-6px) scale(0.985);
	transform-origin: var(--vss-arrow-x, 50%) 0;
	transition: opacity 0.16s ease, transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
	pointer-events: none;
	outline: none;
}

#vss-panel.is-open {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

#vss-panel *,
#vss-panel *::before,
#vss-panel *::after {
	box-sizing: border-box;
}

#vss-panel ul,
#vss-panel li {
	margin: 0;
	padding: 0;
	list-style: none;
	background: none;
	border: 0;
}

#vss-panel li::before,
#vss-panel li::after {
	content: none;
}

#vss-panel p {
	margin: 0;
	padding: 0;
}

#vss-panel a {
	text-decoration: none;
	box-shadow: none;
}

#vss-panel .vss-panel__arrow {
	position: absolute;
	top: -6px;
	left: var(--vss-arrow-x, 50%);
	width: 13px;
	height: 13px;
	margin-left: -6.5px;
	background: #fff;
	border-radius: 3px 0 0 0;
	box-shadow: -1px -1px 0 rgba(18, 18, 18, 0.07);
	transform: rotate(45deg);
}

#vss-panel .vss-panel__head {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 18px 14px 12px 20px;
}

#vss-panel .vss-panel__titles {
	flex: 1 1 auto;
	min-width: 0;
}

#vss-panel .vss-panel__title {
	color: var(--vss-ink);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

#vss-panel .vss-panel__sub {
	margin-top: 3px;
	color: var(--vss-muted);
	font-size: 12.5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#vss-panel .vss-panel__sub strong {
	color: var(--vss-ink);
	font-weight: 600;
}

#vss-panel .vss-panel__close {
	all: unset;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 32px;
	height: 32px;
	margin: -4px 0 0;
	border-radius: 50%;
	color: var(--vss-muted);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

#vss-panel .vss-panel__close:hover {
	background: var(--vss-hover);
	color: var(--vss-ink);
}

#vss-panel .vss-panel__close:focus-visible {
	outline: 2px solid var(--vss-accent);
	outline-offset: 1px;
}

#vss-panel .vss-panel__close svg {
	width: 18px;
	height: 18px;
}

/* Search */
#vss-panel .vss-search {
	position: relative;
	display: flex;
	align-items: center;
	margin: 0 16px 8px;
	border-radius: 11px;
	background: #f3f2f0;
	box-shadow: inset 0 0 0 1px transparent;
	transition: box-shadow 0.15s ease, background-color 0.15s ease;
}

#vss-panel .vss-search:focus-within {
	background: #fff;
	box-shadow: inset 0 0 0 1.5px var(--vss-accent), 0 0 0 4px var(--vss-accent-soft);
}

#vss-panel .vss-search > svg {
	position: absolute;
	left: 12px;
	width: 17px;
	height: 17px;
	color: var(--vss-muted);
	pointer-events: none;
}

#vss-panel .vss-search__input {
	all: unset;
	box-sizing: border-box;
	display: block;
	width: 100%;
	height: 40px;
	padding: 0 12px 0 38px;
	color: var(--vss-ink);
	font-family: inherit;
	font-size: 14px;
	line-height: 40px;
	cursor: text;
	-webkit-appearance: none;
	appearance: none;
}

#vss-panel .vss-search__input::placeholder {
	color: #8d8d8d;
	opacity: 1;
}

#vss-panel .vss-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}

/* List */
#vss-panel .vss-list {
	flex: 1 1 auto;
	min-height: 0;
	padding: 2px 8px 8px;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

#vss-panel .vss-group + .vss-group {
	margin-top: 4px;
}

#vss-panel .vss-group__label {
	padding: 10px 12px 4px;
	color: #8a8a8a;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

#vss-panel .vss-item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 10px 10px 12px;
	border-radius: 12px;
	color: var(--vss-ink);
	background: transparent;
	outline: none;
	transition: background-color 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

#vss-panel .vss-item:hover,
#vss-panel .vss-item:focus-visible {
	background: var(--vss-hover);
	color: var(--vss-ink);
}

#vss-panel .vss-item:focus-visible {
	box-shadow: inset 0 0 0 2px var(--vss-accent);
}

#vss-panel .vss-item__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #f1f0ee;
	color: var(--vss-ink);
	transition: background-color 0.15s ease;
}

#vss-panel .vss-item:hover .vss-item__icon {
	background: #e9e7e4;
}

#vss-panel .vss-item__icon svg {
	width: 18px;
	height: 18px;
}

#vss-panel .vss-item__text {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
}

#vss-panel .vss-item__name {
	display: -webkit-box;
	overflow: hidden;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	color: var(--vss-ink);
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.3;
}

#vss-panel .vss-item__addr {
	margin-top: 2px;
	overflow: hidden;
	color: var(--vss-muted);
	font-size: 12.5px;
	line-height: 1.35;
	white-space: nowrap;
	text-overflow: ellipsis;
}

#vss-panel .vss-item__end {
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	flex: none;
	min-width: 20px;
	color: #a3a3a3;
}

#vss-panel .vss-item__end svg {
	width: 18px;
	height: 18px;
	transition: transform 0.18s ease, color 0.18s ease;
}

#vss-panel .vss-item:hover .vss-item__end svg {
	color: var(--vss-ink);
	transform: translateX(2px);
}

#vss-panel .vss-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px 3px 6px;
	border-radius: 999px;
	background: var(--vss-accent-soft);
	color: var(--vss-accent-ink);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.3;
	white-space: nowrap;
}

#vss-panel .vss-badge svg {
	width: 12px;
	height: 12px;
	stroke-width: 2.6;
}

/* Current store */
#vss-panel .vss-item.is-current {
	background: #fbf8f4;
}

#vss-panel .vss-item.is-current:hover {
	background: var(--vss-hover);
}

#vss-panel .vss-item.is-current .vss-item__icon {
	background: var(--vss-accent);
	color: #fff;
}

/* Switching (navigation in progress) */
#vss-panel .vss-spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(18, 18, 18, 0.14);
	border-top-color: var(--vss-ink);
	border-radius: 50%;
	animation: vss-spin 0.7s linear infinite;
}

#vss-panel .vss-item.is-loading .vss-spinner {
	display: block;
}

#vss-panel .vss-item.is-loading .vss-item__end > :not(.vss-spinner) {
	display: none;
}

#vss-panel.is-switching .vss-item:not(.is-loading) {
	opacity: 0.45;
	pointer-events: none;
}

@keyframes vss-spin {
	to {
		transform: rotate(360deg);
	}
}

#vss-panel .vss-empty {
	padding: 22px 20px 26px;
	color: var(--vss-muted);
	font-size: 13.5px;
	text-align: center;
}

/* Footer */
#vss-panel .vss-panel__foot {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px 20px 14px;
	border-top: 1px solid var(--vss-line);
}

#vss-panel .vss-panel__foot:not(:has(> :not([hidden]))) {
	display: none;
}

#vss-panel .vss-all {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	align-self: flex-start;
	color: var(--vss-ink);
	font-size: 13px;
	font-weight: 600;
	border-radius: 6px;
}

#vss-panel .vss-all svg {
	width: 16px;
	height: 16px;
	transition: transform 0.18s ease;
}

#vss-panel .vss-all:hover {
	color: var(--vss-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

#vss-panel .vss-all:hover svg {
	transform: translateX(3px);
}

#vss-panel .vss-all:focus-visible {
	outline: 2px solid var(--vss-accent);
	outline-offset: 3px;
}

#vss-panel .vss-cartnote {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--vss-muted);
	font-size: 12px;
}

#vss-panel .vss-cartnote svg {
	width: 14px;
	height: 14px;
}

/* --------------------------------------------------------------------------
 * Mobile presentation: the list drops down from the location bar
 * ----------------------------------------------------------------------- */

#vss-panel.vss-panel--mobile {
	left: 0 !important;
	right: 0;
	width: auto;
	max-width: none;
	border-radius: 0 0 20px 20px;
	box-shadow: 0 0 0 1px rgba(18, 18, 18, 0.05), 0 24px 48px -16px rgba(0, 0, 0, 0.4);
	transform: translateY(-12px);
	transform-origin: 50% 0;
}

#vss-panel.vss-panel--mobile.is-open {
	transform: none;
}

#vss-panel.vss-panel--mobile .vss-panel__arrow {
	display: none;
}

#vss-panel.vss-panel--mobile .vss-panel__head {
	align-items: center;
	padding: 12px 10px 10px 18px;
}

/* The bar right above already says which store you're in. */
#vss-panel.vss-panel--mobile .vss-panel__sub {
	display: none;
}

#vss-panel.vss-panel--mobile .vss-panel__close {
	margin: 0;
}

#vss-panel.vss-panel--mobile .vss-search {
	margin: 0 14px 6px;
}

/* 16px stops iOS from zooming into the field on focus */
#vss-panel.vss-panel--mobile .vss-search__input {
	height: 44px;
	font-size: 16px;
	line-height: 44px;
}

#vss-panel.vss-panel--mobile .vss-list {
	padding: 2px 6px 6px;
}

#vss-panel.vss-panel--mobile .vss-item {
	gap: 14px;
	padding: 12px 10px 12px 12px;
}

#vss-panel.vss-panel--mobile .vss-item__icon {
	width: 40px;
	height: 40px;
}

#vss-panel.vss-panel--mobile .vss-item__name {
	font-size: 15px;
}

#vss-panel.vss-panel--mobile .vss-item__addr {
	font-size: 13px;
}

#vss-panel.vss-panel--mobile .vss-panel__foot {
	padding: 12px 18px calc(16px + env(safe-area-inset-bottom, 0px));
}

#vss-scrim {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: var(--vss-z);
	background: rgba(18, 18, 18, 0.42);
	opacity: 0;
	transition: opacity 0.2s ease;
	touch-action: none;
	-webkit-tap-highlight-color: transparent;
}

#vss-scrim.is-open {
	opacity: 1;
}

html.vss-locked,
html.vss-locked body {
	overflow: hidden !important;
}

html.vss-locked {
	scrollbar-gutter: stable;
}

@media (prefers-reduced-motion: reduce) {
	#vss-panel,
	#vss-scrim,
	.vss-caret,
	#vss-bar .vss-bar__action,
	#vss-bar .vss-bar__action svg,
	#vss-panel .vss-item__end svg,
	#vss-panel .vss-all svg {
		transition: none !important;
	}

	#vss-panel {
		transform: none !important;
	}
}
