/**
 * Dollarisho catalogue — customer-facing shop views (archive + single).
 *
 * Scope: every selector is .ds-catalog-* so nothing leaks into the theme.
 * RTL-first: the site is dir=rtl; logical properties everywhere so a theme
 * override with a different direction still lays out sanely.
 * Tokens: the theme's CSS variables (--navy, --mut, --line, --brand…) are
 * used with hard fallbacks so the shop survives a theme swap — this plugin
 * must keep working when the theme is rebuilt.
 * No external assets: fonts fall back to the theme's own stacks.
 */

.ds-catalog {
	max-width: 1200px;
	margin-inline: auto;
	padding: 40px 28px 80px;
	direction: rtl;
}

/* ---------------------------------------------------------------- *
 *  Archive                                                          *
 * ---------------------------------------------------------------- */

.ds-catalog-archive__head {
	margin-block-end: 30px;
}

.ds-catalog-archive__title {
	font-family: YekanBakh, IRANSansX, Vazirmatn, system-ui, sans-serif;
	font-weight: 900;
	font-size: 30px;
	line-height: 1.5;
	color: var(--navy, #19144B);
	margin: 0 0 8px;
}

.ds-catalog-archive__sub {
	font-size: 13px;
	line-height: 1.9;
	color: var(--mut, #6A6588);
	margin: 0;
}

.ds-catalog-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
	gap: 18px;
}

.ds-catalog-card {
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border: 1px solid var(--line, #E4E1EF);
	border-radius: 18px;
	overflow: hidden;
	color: inherit;
	text-decoration: none;
	box-shadow: 0 1px 2px rgba(11, 36, 55, .04), 0 10px 28px -16px rgba(11, 36, 55, .14);
	transition: transform .35s cubic-bezier(.22, 1, .36, 1), box-shadow .35s cubic-bezier(.22, 1, .36, 1);
}

.ds-catalog-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 2px 4px rgba(11, 36, 55, .05), 0 18px 38px -16px rgba(11, 36, 55, .22);
}

.ds-catalog-card:focus-visible {
	outline: 2px solid var(--brand, #19144B);
	outline-offset: 2px;
}

.ds-catalog-card__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px;
	flex: 1;
}

/* CSS clamp, never PHP substr: titles are mixed-script
   ("HeyGen Creator — 1 ماهه، 600 کردیت") and must not be torn. */
.ds-catalog-card__title {
	font-size: 14.5px;
	font-weight: 800;
	color: var(--navy, #19144B);
	line-height: 1.8;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------------------------------------------------------------- *
 *  Media: synced image, or the letter-tile placeholder.             *
 *  images:[] is normal — the tile must look intentional, not broken. *
 * ---------------------------------------------------------------- */

.ds-catalog-media {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	background: var(--brand-soft, #EBE9F5);
	overflow: hidden;
	margin: 0;
}

.ds-catalog-media__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	max-width: 100%;
}

.ds-catalog-media__ph {
	font-family: YekanBakh, IRANSansX, Vazirmatn, system-ui, sans-serif;
	font-weight: 900;
	font-size: 46px;
	line-height: 1;
	color: var(--brand-deep, #0F0B36);
	opacity: .55;
	user-select: none;
}

/* ---------------------------------------------------------------- *
 *  Price: Rial primary, Toman muted secondary. Display-only strings. *
 * ---------------------------------------------------------------- */

.ds-catalog-price {
	display: flex;
	flex-direction: column;
	gap: 3px;
	margin: 0;
}

.ds-catalog-price__rial {
	font-size: 15.5px;
	font-weight: 800;
	color: var(--navy, #19144B);
}

.ds-catalog-price__toman {
	font-size: 12px;
	font-weight: 600;
	color: var(--mut, #6A6588);
}

.ds-catalog-single .ds-catalog-price__rial {
	font-size: 22px;
}

.ds-catalog-single .ds-catalog-price__toman {
	font-size: 13px;
}

/* ---------------------------------------------------------------- *
 *  Availability badge                                               *
 * ---------------------------------------------------------------- */

.ds-catalog-badge {
	align-self: flex-start;
	font-size: 11px;
	font-weight: 700;
	border-radius: 999px;
	padding: 5px 12px;
	border: 1px solid transparent;
	margin-block-start: auto;
}

.ds-catalog-single .ds-catalog-badge {
	margin-block-start: 0;
}

.ds-catalog-badge.is-in-stock {
	background: #E7F6EE;
	color: #0E7B4F;
	border-color: #CBEBD9;
}

.ds-catalog-badge.is-preorder {
	background: #FFF4E0;
	color: #9A6200;
	border-color: #F3E2BB;
}

.ds-catalog-badge.is-out {
	background: #F3F2F8;
	color: var(--mut, #6A6588);
	border-color: var(--line, #E4E1EF);
}

/* ---------------------------------------------------------------- *
 *  Single                                                           *
 * ---------------------------------------------------------------- */

.ds-catalog-crumb {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--mut, #6A6588);
	margin-block-end: 20px;
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.ds-catalog-crumb a {
	color: var(--brand-deep, #0F0B36);
	text-decoration: none;
	white-space: nowrap;
}

.ds-catalog-crumb a:hover {
	color: var(--brand, #19144B);
}

.ds-catalog-crumb__sep {
	color: var(--line, #E4E1EF);
}

.ds-catalog-crumb > span:last-child {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ds-catalog-single__layout {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: 32px;
	align-items: start;
}

.ds-catalog-single__media {
	border: 1px solid var(--line, #E4E1EF);
	border-radius: 20px;
	aspect-ratio: 1 / 1;
}

.ds-catalog-single__media .ds-catalog-media__ph {
	font-size: 84px;
}

.ds-catalog-single__info {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
}

.ds-catalog-single__title {
	font-family: YekanBakh, IRANSansX, Vazirmatn, system-ui, sans-serif;
	font-weight: 900;
	font-size: 24px;
	line-height: 1.7;
	color: var(--navy, #19144B);
	margin: 0;
	overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- *
 *  Buy form + states                                                *
 * ---------------------------------------------------------------- */

.ds-catalog-buy {
	width: 100%;
	max-width: 340px;
	margin: 4px 0 0;
}

.ds-catalog-buy__btn {
	appearance: none;
	border: 0;
	cursor: pointer;
	width: 100%;
	background: var(--brand, #19144B);
	color: #ffffff;
	font-family: inherit;
	font-weight: 800;
	font-size: 15px;
	border-radius: 13px;
	padding: 14px 34px;
	transition: background .2s ease, transform .2s cubic-bezier(.22, 1, .36, 1);
}

.ds-catalog-buy__btn:hover {
	background: var(--brand-deep, #0F0B36);
}

.ds-catalog-buy__btn:active {
	transform: scale(.97);
}

.ds-catalog-buy__btn:focus-visible {
	outline: 2px solid var(--brand, #19144B);
	outline-offset: 2px;
}

/* Honeypot: visually gone for humans, present for bots. Not display:none —
   some fillers skip invisible fields; clipping keeps it "visible" to them. */
.ds-catalog-hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.ds-catalog-note {
	font-size: 13px;
	font-weight: 700;
	line-height: 1.9;
	border-radius: 13px;
	padding: 13px 18px;
	margin: 4px 0 0;
}

.ds-catalog-note--variable {
	background: var(--brand-soft, #EBE9F5);
	color: var(--brand-deep, #0F0B36);
}

.ds-catalog-note--soon {
	background: #FFF4E0;
	color: #9A6200;
}

.ds-catalog-note--out {
	background: #F3F2F8;
	color: var(--mut, #6A6588);
}

.ds-catalog-delivery {
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.9;
	color: var(--mut, #6A6588);
	margin: 0;
	padding-inline-start: 18px;
	position: relative;
}

.ds-catalog-delivery::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: .62em;
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

.ds-catalog-delivery.is-auto::before {
	background: #0E7B4F;
}

.ds-catalog-delivery.is-manual::before {
	background: #9A6200;
}

.ds-catalog-panelnote {
	font-size: 12px;
	line-height: 2.1;
	color: var(--mut, #6A6588);
	background: #ffffff;
	border: 1px dashed var(--line, #E4E1EF);
	border-radius: 13px;
	padding: 12px 16px;
	margin: 4px 0 0;
}

/* ---------------------------------------------------------------- *
 *  Description                                                      *
 * ---------------------------------------------------------------- */

.ds-catalog-single__desc {
	margin-block-start: 44px;
	background: #ffffff;
	border: 1px solid var(--line, #E4E1EF);
	border-radius: 20px;
	padding: 26px 28px;
}

.ds-catalog-single__desc-title {
	font-family: YekanBakh, IRANSansX, Vazirmatn, system-ui, sans-serif;
	font-weight: 800;
	font-size: 18px;
	color: var(--navy, #19144B);
	margin: 0 0 14px;
}

.ds-catalog-prose {
	font-size: 13.5px;
	line-height: 2.2;
	color: var(--ink, #171233);
}

/* Bare URLs from the panel become links (make_clickable) and can be long
   Latin strings inside RTL text — break them, never overflow the card. */
.ds-catalog-prose a {
	color: var(--brand-deep, #0F0B36);
	font-weight: 700;
	overflow-wrap: anywhere;
	direction: ltr;
	unicode-bidi: embed;
}

/* ---------------------------------------------------------------- *
 *  Empty state + pagination                                         *
 * ---------------------------------------------------------------- */

.ds-catalog-empty {
	background: #ffffff;
	border: 1px dashed var(--line, #E4E1EF);
	border-radius: 16px;
	padding: 40px;
	text-align: center;
	font-size: 14px;
	font-weight: 700;
	color: var(--mut, #6A6588);
	margin: 0;
}

.ds-catalog .navigation.pagination {
	margin-block-start: 32px;
}

.ds-catalog .nav-links {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.ds-catalog .nav-links .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--line, #E4E1EF);
	border-radius: 11px;
	background: #ffffff;
	font-size: 13px;
	font-weight: 700;
	color: var(--navy, #19144B);
	text-decoration: none;
}

.ds-catalog .nav-links .page-numbers.current {
	background: var(--brand, #19144B);
	border-color: var(--brand, #19144B);
	color: #ffffff;
}

.ds-catalog .nav-links a.page-numbers:hover {
	border-color: var(--brand, #19144B);
	color: var(--brand-deep, #0F0B36);
	background: var(--brand-soft, #EBE9F5);
}

/* ---------------------------------------------------------------- *
 *  Responsive                                                       *
 * ---------------------------------------------------------------- */

@media (max-width: 820px) {
	.ds-catalog {
		padding: 28px 18px 60px;
	}

	.ds-catalog-single__layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 22px;
	}

	.ds-catalog-single__media {
		aspect-ratio: 4 / 3;
	}

	.ds-catalog-archive__title {
		font-size: 24px;
	}

	.ds-catalog-single__title {
		font-size: 20px;
	}

	.ds-catalog-buy {
		max-width: none;
	}
}

@media (max-width: 480px) {
	.ds-catalog-grid {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
		gap: 12px;
	}

	.ds-catalog-card__body {
		padding: 12px;
		gap: 8px;
	}

	.ds-catalog-card__title {
		font-size: 13px;
	}
}
