/* Stores Directory — compact premium */
.stores-directory-page {
	--store-dir-bg: #f4f6fb;
	--store-dir-surface: #ffffff;
	--store-dir-border: rgba(148, 163, 184, 0.28);
	--store-dir-text: #0f172a;
	--store-dir-muted: #64748b;
	--store-dir-accent: #720ba1;
	--store-dir-accent-soft: rgba(114, 11, 161, 0.1);
	--store-dir-category-bg: rgba(114, 11, 161, 0.1);
	--store-dir-category-text: #720ba1;
	--store-dir-category-border: rgba(114, 11, 161, 0.18);
	--store-dir-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
	--store-dir-shadow-hover: 0 14px 32px rgba(114, 11, 161, 0.14);
	background: var(--store-dir-bg);
	color: var(--store-dir-text);
}

html[data-theme='dark'] .stores-directory-page {
	--store-dir-bg: #0b1120;
	--store-dir-surface: #111827;
	--store-dir-border: rgba(71, 85, 105, 0.55);
	--store-dir-text: #f1f5f9;
	--store-dir-muted: #94a3b8;
	--store-dir-accent: #c4b5fd;
	--store-dir-accent-soft: rgba(167, 139, 250, 0.22);
	--store-dir-category-bg: rgba(167, 139, 250, 0.2);
	--store-dir-category-text: #e9d5ff;
	--store-dir-category-border: rgba(196, 181, 253, 0.42);
	--store-dir-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
	--store-dir-shadow-hover: 0 14px 32px rgba(114, 11, 161, 0.22);
}

.stores-directory-shell {
	position: relative;
	min-height: 100vh;
	padding-bottom: max(5.5rem, env(safe-area-inset-bottom));
	overflow: hidden;
}

@media (min-width: 64rem) {
	.stores-directory-shell {
		padding-bottom: 2.5rem;
	}
}

.stores-directory-container {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 100rem;
	margin-inline: auto;
	padding-inline: 1rem;
}

@media (min-width: 40rem) {
	.stores-directory-container {
		padding-inline: 1.5rem;
	}
}

@media (min-width: 48rem) {
	.stores-directory-container {
		padding-inline: 2.5rem;
	}
}

@media (min-width: 64rem) {
	.stores-directory-container {
		padding-inline: 3rem;
	}
}

@media (min-width: 80rem) {
	.stores-directory-container {
		padding-inline: 4rem;
	}
}

.stores-directory-top {
	padding-top: 0.75rem;
}

.stores-directory-hero {
	margin-top: 1rem;
	margin-bottom: 1.25rem;
	padding: 1.1rem 1rem;
	border-radius: 1.15rem;
	background: var(--store-dir-surface);
	border: 1px solid var(--store-dir-border);
	box-shadow: var(--store-dir-shadow);
}

@media (min-width: 48rem) {
	.stores-directory-hero {
		display: flex;
		align-items: flex-end;
		justify-content: space-between;
		gap: 1rem;
		padding: 1.25rem 1.35rem;
	}
}

.stores-directory-hero__badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.28rem 0.6rem;
	border-radius: 9999px;
	background: var(--store-dir-accent-soft);
	color: var(--store-dir-accent);
	font-size: 0.6875rem;
	font-weight: 700;
	margin-bottom: 0.5rem;
}

.stores-directory-hero__title {
	font-size: clamp(1.35rem, 3vw, 1.85rem);
	font-weight: 900;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.stores-directory-hero__sub {
	margin-top: 0.35rem;
	font-size: 0.8125rem;
	color: var(--store-dir-muted);
	max-width: 32rem;
	line-height: 1.65;
}

.stores-directory-search {
	width: 100%;
	max-width: 22rem;
	margin-top: 0.75rem;
}

@media (min-width: 48rem) {
	.stores-directory-search {
		margin-top: 0;
		flex-shrink: 0;
	}
}

.stores-directory-search__wrap {
	position: relative;
}

.stores-directory-search__icon {
	position: absolute;
	right: 0.85rem;
	top: 50%;
	transform: translateY(-50%);
	width: 1rem;
	height: 1rem;
	color: var(--store-dir-muted);
	pointer-events: none;
}

.stores-directory-search__input {
	width: 100%;
	border: 1px solid var(--store-dir-border);
	border-radius: 0.85rem;
	background: var(--store-dir-bg);
	padding: 0.72rem 2.4rem 0.72rem 0.85rem;
	font-size: 0.875rem;
	color: inherit;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.stores-directory-search__input:focus {
	outline: none;
	border-color: rgba(114, 11, 161, 0.45);
	box-shadow: 0 0 0 3px rgba(114, 11, 161, 0.1);
}

.stores-directory-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.55rem;
}

@media (min-width: 48rem) {
	.stores-directory-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.75rem;
	}
}

@media (min-width: 64rem) {
	.stores-directory-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 1rem;
	}
}

/* ── Card base ── */
.store-dir-card {
	position: relative;
	min-width: 0;
	border-radius: 1rem;
	background: var(--store-dir-surface);
	border: 1px solid var(--store-dir-border);
	box-shadow: var(--store-dir-shadow);
	overflow: hidden;
	transition: border-color 0.25s ease, box-shadow 0.25s ease;
	opacity: 0;
	transform: translateY(18px) scale(0.98);
}

.stores-directory-page.is-animated .store-dir-card {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.store-dir-card {
		opacity: 1;
		transform: none;
	}
}

@media (hover: hover) and (pointer: fine) {
	.store-dir-card:hover {
		border-color: rgba(114, 11, 161, 0.32);
		box-shadow: var(--store-dir-shadow-hover);
	}

	.store-dir-card:hover .store-dir-card__logo-img {
		transform: translateY(-6px);
	}
}

.store-dir-card__logo-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0.75rem;
	border: 2px solid var(--store-dir-surface);
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
	transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.store-dir-card__logo-img--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--store-dir-accent-soft);
	color: var(--store-dir-accent);
}

.store-dir-card__logo-img--placeholder svg,
.store-dir-card__placeholder-icon {
	width: 1.35rem;
	height: 1.35rem;
}

.store-dir-card__name {
	font-size: 0.9375rem;
	font-weight: 800;
	line-height: 1.35;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.store-dir-card__category-tag {
	display: inline-block;
	margin-top: 0.2rem;
	padding: 0.15rem 0.45rem;
	border-radius: 9999px;
	font-size: 0.625rem;
	font-weight: 700;
	background: var(--store-dir-category-bg);
	color: var(--store-dir-category-text);
	border: 1px solid var(--store-dir-category-border);
}

.store-dir-card__category-tag--desktop {
	display: inline-block;
	margin: 0 0 0.35rem;
	padding: 0.22rem 0.6rem;
	border-radius: 9999px;
	background: var(--store-dir-category-bg);
	color: var(--store-dir-category-text);
	border: 1px solid var(--store-dir-category-border);
	font-size: 0.6875rem;
	font-weight: 700;
	white-space: nowrap;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── Mobile row ── */
.store-dir-card__mobile {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.55rem 0.65rem;
}

@media (min-width: 64rem) {
	.store-dir-card__mobile {
		display: none;
	}
}

.store-dir-card__mobile-logo {
	flex-shrink: 0;
	width: 2.75rem;
	height: 2.75rem;
}

.store-dir-card__mobile-info {
	flex: 1;
	min-width: 0;
}

.store-dir-card__icon-btn {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.35rem;
	height: 2.35rem;
	border-radius: 0.7rem;
	border: 1px solid var(--store-dir-border);
	background: var(--store-dir-bg);
	color: var(--store-dir-accent);
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.store-dir-card__icon-btn svg {
	width: 1.1rem;
	height: 1.1rem;
}

.store-dir-card__icon-btn:active {
	transform: scale(0.94);
}

.store-dir-card__icon-btn--qr {
	background: var(--store-dir-accent-soft);
	border-color: transparent;
}

.store-dir-card__icon-btn--go {
	color: var(--store-dir-muted);
}

/* ── Desktop layout — vertical card, 4 per row ── */
.store-dir-card__desktop {
	display: none;
}

@media (min-width: 64rem) {
	.store-dir-card__desktop {
		display: flex;
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 0.65rem;
		padding: 1.15rem 1rem 1rem;
		min-height: 100%;
	}
}

.store-dir-card__logo-wrap--desktop {
	flex-shrink: 0;
	width: 4.25rem;
	height: 4.25rem;
}

.store-dir-card__brand-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.65rem;
	width: 100%;
}

.store-dir-card__name--desktop {
	width: 100%;
	font-size: 1rem;
	white-space: normal;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.store-dir-card__stat--desktop {
	justify-content: center;
	font-size: 0.75rem;
}

.store-dir-card__btn--desktop {
	width: 100%;
	padding: 0.55rem 0.85rem;
	font-size: 0.75rem;
}

.store-dir-card__qr-panel {
	flex-shrink: 0;
}

.store-dir-card__qr-host {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 4.25rem;
	height: 4.25rem;
	border-radius: 0.75rem;
	border: 1px solid var(--store-dir-border);
	background: #fff;
	padding: 0.2rem;
	overflow: hidden;
}

html[data-theme='dark'] .store-dir-card__qr-host {
	background: #0f172a;
}

.store-dir-card__qr-host canvas {
	display: block;
	max-width: 100%;
	height: auto !important;
}

@media (min-width: 64rem) {
	.store-dir-card__logo-wrap--desktop .store-dir-card__logo-img--placeholder svg,
	.store-dir-card__logo-wrap--desktop .store-dir-card__placeholder-icon {
		width: 1.85rem;
		height: 1.85rem;
	}
}

.store-dir-card__stat {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.6875rem;
	font-weight: 700;
	color: var(--store-dir-muted);
}

.store-dir-card__stat-icon {
	width: 0.85rem;
	height: 0.85rem;
	color: var(--store-dir-accent);
}

.store-dir-card__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.42rem 0.75rem;
	border-radius: 0.6rem;
	background: linear-gradient(135deg, #720ba1, #5b21b6);
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 700;
	font-family: inherit;
	text-decoration: none;
	white-space: nowrap;
	box-shadow: 0 4px 12px rgba(114, 11, 161, 0.22);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.store-dir-card__btn:hover {
	box-shadow: 0 6px 16px rgba(114, 11, 161, 0.32);
}

.store-dir-card__btn:active {
	transform: scale(0.97);
}

.store-dir-card__btn-icon {
	width: 0.8rem;
	height: 0.8rem;
}

.store-dir-card.is-hidden {
	display: none;
}

/* Empty / skeleton / sheet — unchanged essentials */
.stores-directory-empty,
.stores-directory-no-match {
	grid-column: 1 / -1;
	text-align: center;
	padding: 2.5rem 1rem;
	border-radius: 1.15rem;
	border: 1px dashed var(--store-dir-border);
	background: var(--store-dir-surface);
}

.stores-directory-empty__visual {
	width: 4rem;
	height: 4rem;
	margin-inline: auto;
	margin-bottom: 1rem;
	border-radius: 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--store-dir-accent-soft);
	color: var(--store-dir-accent);
}

.stores-directory-empty__icon {
	width: 2rem;
	height: 2rem;
}

.stores-directory-empty__title {
	font-size: 1rem;
	font-weight: 800;
	margin-bottom: 0.25rem;
}

.stores-directory-empty__text,
.stores-directory-no-match {
	color: var(--store-dir-muted);
	font-size: 0.875rem;
	line-height: 1.65;
}

.stores-directory-empty__cta {
	display: inline-flex;
	margin-top: 1rem;
	padding: 0.65rem 1.15rem;
	border-radius: 9999px;
	background: linear-gradient(135deg, #720ba1, #5b21b6);
	color: #fff;
	font-size: 0.8125rem;
	font-weight: 700;
	text-decoration: none;
}

.stores-directory-skeleton {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.55rem;
}

@media (min-width: 48rem) {
	.stores-directory-skeleton {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 64rem) {
	.stores-directory-skeleton {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.stores-directory-skeleton__card {
	height: 3.5rem;
	border-radius: 1rem;
	background: linear-gradient(90deg, rgba(148, 163, 184, 0.1) 25%, rgba(148, 163, 184, 0.2) 50%, rgba(148, 163, 184, 0.1) 75%);
	background-size: 200% 100%;
	animation: store-dir-shimmer 1.2s ease-in-out infinite;
}

@media (min-width: 64rem) {
	.stores-directory-skeleton__card {
		height: 15rem;
	}
}

@keyframes store-dir-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

.stores-directory-page.is-ready .stores-directory-skeleton {
	display: none;
}

.store-dir-qr-sheet {
	position: fixed;
	inset: 0;
	z-index: 80;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.28s ease, visibility 0.28s ease;
}

.store-dir-qr-sheet.is-open {
	pointer-events: auto;
	opacity: 1;
	visibility: visible;
}

.store-dir-qr-sheet__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(4px);
}

.store-dir-qr-sheet__panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 24rem;
	margin: 0 0.75rem max(0.75rem, env(safe-area-inset-bottom));
	padding: 1.15rem;
	border-radius: 1.25rem;
	background: var(--store-dir-surface);
	border: 1px solid var(--store-dir-border);
	box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
	transform: translateY(110%);
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.store-dir-qr-sheet.is-open .store-dir-qr-sheet__panel {
	transform: translateY(0);
}

.store-dir-qr-sheet__handle {
	width: 2.25rem;
	height: 0.25rem;
	border-radius: 9999px;
	background: var(--store-dir-border);
	margin: 0 auto 0.85rem;
}

.store-dir-qr-sheet__title {
	font-size: 0.9375rem;
	font-weight: 800;
	text-align: center;
}

.store-dir-qr-sheet__slug {
	text-align: center;
	font-size: 0.6875rem;
	color: var(--store-dir-muted);
	direction: ltr;
	margin: 0.25rem 0 0.85rem;
}

.store-dir-qr-sheet__canvas {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-inline: auto;
	width: 12rem;
	height: 12rem;
	border-radius: 0.85rem;
	border: 1px solid var(--store-dir-border);
	background: #fff;
	padding: 0.3rem;
}

html[data-theme='dark'] .store-dir-qr-sheet__canvas {
	background: #0f172a;
}

.store-dir-qr-sheet__actions {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-top: 0.85rem;
}

.store-dir-qr-sheet__close {
	background: var(--store-dir-accent-soft);
	color: var(--store-dir-accent);
}

@media (min-width: 64rem) {
	.store-dir-qr-sheet {
		display: none;
	}
}

/* تم دارک — دکمه تغییر تم در هدر */
html[data-theme='dark'] .stores-directory-page .theme-toggle-btn {
	background: rgba(51, 65, 85, 0.85) !important;
	color: #e2e8f0 !important;
}
