/* ═══════════════════════════════════════════════════════
   WC Combined Grid – Stylesheet v2.1.2
   ═══════════════════════════════════════════════════════ */

/* ── Font display ── */
@font-face {
	font-family: IRANYekanX;
	font-display: swap;
}
@font-face {
	font-family: IRANYekan;
	font-display: swap;
}

/* ── Base resets ── */
.wc-grid-wrap,
.wc-grid-wrap *,
.wcpg-filter-wrap,
.wcpg-filter-wrap * {
	font-family: IRANYekanX, IRANYekan, sans-serif !important;
	box-sizing: border-box;
}

.wcpg-wrap,
.wc-grid-wrap,
.wcpg-filter-wrap {
	direction: rtl;
}

.wcdg-wrap,
.wcdg-wrap * {
	box-sizing: border-box;
	font-family: IRANYekanX, IRANYekan, "Yekan Bakh", Tahoma, sans-serif !important;
}
.wcdg-wrap {
	direction: rtl;
}

/* ════════════════════════════════════
   WC GRID (wc_archive_grid)
   ════════════════════════════════════ */

.wc-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	contain: layout style;
}

/* ── Card ── */
.wc-card {
	background: #fff;
	border: 1px solid #e9e9e9;
	border-radius: 10px;
	overflow: hidden;
	position: relative;
	contain: layout style paint;
}

@media (hover: hover) and (pointer: fine) {
	.wc-card {
		transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
		will-change: transform;
	}
	.wc-card:hover {
		transform: translateY(-3px);
		border-color: #cfcfcf;
		box-shadow: 0 8px 22px rgba(0, 0, 0, .06);
	}
	.wc-card:hover .wc-thumb img {
		transform: scale(1.04);
	}
}

.wc-link {
	text-decoration: none;
	color: inherit;
	display: block;
	height: 100%;
}

/* ── Thumbnail ── */
.wc-thumb {
	aspect-ratio: 1 / 1;
	background: #f1f1f1;
	overflow: hidden;
}

.wc-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

@media (hover: hover) and (pointer: fine) {
	.wc-thumb img {
		transition: transform .35s ease;
	}
}

/* ── Content ── */
.wc-content {
	padding: 10px;
}

.wc-title {
	font-size: 12px;
	font-weight: 700;
	line-height: 1.8;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 65px;
	margin: 0 0 8px;
	color: #111;
	text-align: right;
}

/* ── Price ── */
.wc-price {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	direction: ltr;
	text-align: left;
	gap: 5px;
	width: 100%;
	margin-bottom: 10px;
}

.wc-price-currency {
	font-size: 11px;
	font-weight: 700;
	color: #666;
	white-space: nowrap;
	direction: rtl;
}

.wc-price-amount {
	direction: ltr;
	unicode-bidi: isolate;
	font-size: 15px;
	font-weight: 900;
	color: #111;
	line-height: 1.4;
}

/* ── Contact ── */
.wc-contact {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	font-weight: 800;
	color: #1a6fc4;
	background: rgba(26, 111, 196, .08);
	border: 1px solid rgba(26, 111, 196, .22);
	border-radius: 6px;
	padding: 4px 10px;
	margin-bottom: 10px;
}
.wc-contact::before {
	content: '';
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #1a6fc4;
	flex-shrink: 0;
}

/* ── Meta row ── */
.wc-meta-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
}

.wc-id,
.wc-guarantee {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 28px;
	padding: 4px 6px;
	border-radius: 4px;
	text-align: center;
	white-space: nowrap;
}

.wc-id {
	font-size: 10px;
	font-weight: 700;
	color: #444;
	background: #e9e9e9;
}

.wc-guarantee {
	font-size: 10px;
	font-weight: 800;
	color: #00a86b;
	background: rgba(0, 168, 107, .12);
}

/* ── Empty ── */
.wc-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 28px 14px;
	border: 1px dashed #ddd;
	border-radius: 10px;
	color: #666;
	background: #fafafa;
	font-size: 13px;
}

/* ── Pagination ── */
.wc-pagination {
	margin-top: 20px;
	display: flex;
	gap: 6px;
	justify-content: center;
	flex-wrap: wrap;
}

.wcpg-page-btn {
	padding: 8px 14px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fff;
	color: #111;
	font-size: 13px;
	font-family: inherit;
	cursor: pointer;
	line-height: 1.5;
	min-height: 40px;
	min-width: 40px;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
	.wcpg-page-btn {
		transition: background .2s, border-color .2s, color .2s;
	}
	.wcpg-page-btn:hover:not(.current) {
		background: #f5f5f5;
		border-color: #bbb;
	}
}

.wcpg-page-btn.current {
	background: #111;
	color: #fff;
	border-color: #111;
	cursor: default;
	pointer-events: none;
}

/* ── Loading state ── */
#wcpg-results.wcpg-loading {
	opacity: .4;
	pointer-events: none;
	transition: opacity .2s;
}

/* ════════════════════════════════════
   WC FILTER (wc_product_filter)
   ════════════════════════════════════ */

.wcpg-filter-wrap {
	background: #fff;
	border: 1px solid #e9e9e9;
	border-radius: 10px;
	padding: 16px 14px;
}

.wcpg-filter-group {
	margin-bottom: 20px;
}
.wcpg-filter-group:last-child {
	margin-bottom: 0;
}

.wcpg-filter-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #111;
	margin-bottom: 10px;
	padding-bottom: 7px;
	border-bottom: 1px solid #f0f0f0;
}

/* ── Search ── */
.wcpg-search-wrap {
	position: relative;
}
.wcpg-search-wrap .wcpg-filter-input {
	padding-left: 34px;
}

.wcpg-clear-search {
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 24px;
	height: 24px;
	display: none;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	color: #999;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}
.wcpg-clear-search svg {
	width: 10px;
	height: 10px;
	display: block;
}
.wcpg-clear-search.is-visible {
	display: flex;
}

/* ── Inputs ── */
.wcpg-filter-input[type="text"],
.wcpg-filter-input[type="number"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
	direction: rtl;
	color: #333;
	background: #fafafa;
	-moz-appearance: textfield;
	appearance: textfield;
	min-height: 44px;
}
.wcpg-filter-input[type="text"]:focus,
.wcpg-filter-input[type="number"]:focus {
	outline: none;
	border-color: #1a6fc4;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(26, 111, 196, .1);
}
.wcpg-filter-input[type="number"]::-webkit-inner-spin-button,
.wcpg-filter-input[type="number"]::-webkit-outer-spin-button {
	opacity: 1;
}

/* ── Price inputs ── */
.wcpg-price-inputs {
	display: flex;
	align-items: center;
	gap: 8px;
}
.wcpg-price-inputs .wcpg-filter-input {
	flex: 1;
	min-width: 0;
}
.wcpg-price-sep {
	font-size: 12px;
	color: #999;
	white-space: nowrap;
	flex-shrink: 0;
}

/* ── Toggle ── */
.wcpg-toggle-label {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	user-select: none;
	min-height: 44px;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}
.wcpg-toggle-input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}
.wcpg-toggle-track {
	position: relative;
	width: 44px;
	height: 26px;
	background: #ddd;
	border-radius: 100px;
	flex-shrink: 0;
	transition: background .25s ease;
}
.wcpg-toggle-thumb {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
	transition: right .25s ease;
}
.wcpg-toggle-input:checked ~ .wcpg-toggle-track {
	background: #1a6fc4;
}
.wcpg-toggle-input:checked ~ .wcpg-toggle-track .wcpg-toggle-thumb {
	right: calc(100% - 22px);
}
.wcpg-toggle-text {
	font-size: 13px;
	color: #444;
}
.wcpg-toggle-input:checked ~ .wcpg-toggle-text {
	color: #1a6fc4;
	font-weight: 500;
}

/* ── Chips ── */
.wcpg-chip-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.wcpg-chip {
	display: inline-flex;
	cursor: pointer;
	user-select: none;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}
.wcpg-chip input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}
.wcpg-chip-text {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	font-size: 12px;
	font-weight: 400;
	color: #555;
	background: #f5f5f5;
	border: 1.5px solid #e8e8e8;
	border-radius: 100px;
	white-space: nowrap;
	line-height: 1.5;
	min-height: 36px;
}
.wcpg-chip input[type="checkbox"]:checked + .wcpg-chip-text {
	background: #1a6fc4;
	border-color: #1a6fc4;
	color: #fff;
	font-weight: 500;
	padding-right: 10px;
	box-shadow: 0 2px 8px rgba(26, 111, 196, .25);
}
.wcpg-chip-x {
	display: none;
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .22);
	flex-shrink: 0;
}
.wcpg-chip-x svg {
	width: 8px;
	height: 8px;
	display: block;
}
.wcpg-chip input[type="checkbox"]:checked + .wcpg-chip-text .wcpg-chip-x {
	display: inline-flex;
}

/* ════════════════════════════════════
   DIVAR GRID (divar_grid)
   ════════════════════════════════════ */

.wcdg-list {
	display: flex;
	flex-direction: column;
}

/* ── Card ── */
.dv-card {
	background: #fff;
	border-bottom: 1px solid #eee;
	padding: 12px 0;
}
.dv-link {
	display: flex;
	flex-direction: row-reverse;
	gap: 12px;
	text-decoration: none;
	color: inherit;
	align-items: flex-start;
}

/* ── Thumbnail ── */
.dv-thumb {
	flex: 0 0 38%;
	width: 38%;
	max-width: 38%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f5f5f5;
	border-radius: 6px;
}
.dv-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ── Content ── */
.dv-content {
	flex: 1;
	padding: 0;
	min-width: 0;
}
.dv-title {
	font-size: 13px;
	font-weight: 700;
	line-height: 1.8;
	margin: 0 0 6px;
	color: #111;
}

/* ── Price ── */
.dv-price {
	display: flex;
	flex-direction: row;
	align-items: baseline;
	justify-content: flex-start;
	direction: ltr;
	gap: 5px;
	margin-bottom: 8px;
	line-height: 1.6;
	color: #000;
}
.dv-price .toman-label {
	order: 1;
	font-size: 11px !important;
	font-weight: 500 !important;
	color: #8a8a8a !important;
	line-height: 1;
	white-space: nowrap;
	position: relative;
	top: -1px;
}
.dv-price .price-amount {
	order: 2;
	display: inline-flex;
	align-items: baseline;
	font-size: 13px;
	font-weight: 700;
	color: #000;
}
.dv-price .price-amount *,
.dv-price .woocommerce-Price-amount,
.dv-price .woocommerce-Price-amount bdi,
.dv-price del,
.dv-price ins {
	font-size: 12.5px !important;
	font-weight: 700 !important;
	color: #000 !important;
	text-decoration: none;
}
.dv-price del {
	opacity: .55;
	margin-right: 4px;
}
.dv-price .woocommerce-Price-amount::after,
.dv-price .woocommerce-Price-amount.amount::after,
.dv-price .amount::after {
	content: none !important;
	display: none !important;
}
.dv-price .woocommerce-Price-currencySymbol {
	display: none !important;
}

/* ── Contact ── */
.dv-contact {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	font-weight: 700;
	color: #1a6fc4;
	margin-bottom: 8px;
}
.dv-contact::before {
	content: '';
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #1a6fc4;
	flex-shrink: 0;
}

/* ── Empty ── */
.wcdg-empty {
	text-align: center;
	padding: 28px 14px;
	border: 1px dashed #ddd;
	border-radius: 10px;
	color: #666;
	background: #fafafa;
	font-size: 13px;
	margin: 12px 0;
}

/* ── Inline filter ── */
.wcdg-inline-filter {
	padding: 4px 0;
	border-bottom: 1px solid #eee;
	margin: 0 0 4px;
}
.wcdg-inline-filter--empty {
	margin-bottom: 8px;
}
.wcdg-if-section {
	padding: 10px 0;
}
.wcdg-if-divider {
	height: 1px;
	background: #f0f0f0;
	margin: 0;
}

/* ── Search wrap ── */
.wcdg-search-wrap {
	position: relative;
}
.wcdg-search-wrap .wcdg-if-input {
	padding-left: 36px;
}
.wcdg-clear-search {
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 28px;
	height: 28px;
	display: none;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	color: #999;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	z-index: 2;
}
.wcdg-clear-search svg {
	width: 10px;
	height: 10px;
	display: block;
	pointer-events: none;
}
.wcdg-clear-search.is-visible {
	display: flex;
}

/* ── Inline filter inputs ── */
.wcdg-if-input[type="text"],
.wcdg-if-input[type="number"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
	direction: rtl;
	color: #333;
	background: #fafafa;
	-moz-appearance: textfield;
	appearance: textfield;
	min-height: 44px;
}
.wcdg-if-input[type="text"]:focus,
.wcdg-if-input[type="number"]:focus {
	outline: none;
	border-color: #1a6fc4;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(26, 111, 196, .1);
}
.wcdg-if-input[type="number"]::-webkit-inner-spin-button,
.wcdg-if-input[type="number"]::-webkit-outer-spin-button {
	opacity: 1;
}

/* ── Price inputs ── */
.wcdg-price-inputs {
	display: flex;
	align-items: center;
	gap: 8px;
}
.wcdg-price-inputs .wcdg-if-input {
	flex: 1;
	min-width: 0;
}
.wcdg-price-sep {
	font-size: 12px;
	color: #999;
	white-space: nowrap;
	flex-shrink: 0;
}

/* ── Toggle ── */
.wcdg-if-toggle-label {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	user-select: none;
	min-height: 44px;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}
.wcdg-if-toggle-input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}
.wcdg-if-toggle-track {
	position: relative;
	width: 44px;
	height: 26px;
	background: #ddd;
	border-radius: 100px;
	flex-shrink: 0;
	transition: background .25s ease;
}
.wcdg-if-toggle-thumb {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
	transition: right .25s ease;
}
.wcdg-if-toggle-input:checked ~ .wcdg-if-toggle-track {
	background: #1a6fc4;
}
.wcdg-if-toggle-input:checked ~ .wcdg-if-toggle-track .wcdg-if-toggle-thumb {
	right: calc(100% - 22px);
}
.wcdg-if-toggle-text {
	font-size: 13px;
	color: #444;
}
.wcdg-if-toggle-input:checked ~ .wcdg-if-toggle-text {
	color: #1a6fc4;
	font-weight: 500;
}

/* ── Chips ── */
.wcdg-if-chip-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.wcdg-if-chip {
	display: inline-flex;
	cursor: pointer;
	user-select: none;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}
.wcdg-if-chip input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}
.wcdg-if-chip-text {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	font-size: 12px;
	font-weight: 400;
	color: #555;
	background: #f5f5f5;
	border: 1.5px solid #e8e8e8;
	border-radius: 100px;
	white-space: nowrap;
	line-height: 1.5;
	min-height: 36px;
}
.wcdg-if-chip input[type="checkbox"]:checked + .wcdg-if-chip-text {
	background: #1a6fc4;
	border-color: #1a6fc4;
	color: #fff;
	font-weight: 500;
	padding-right: 10px;
	box-shadow: 0 2px 8px rgba(26, 111, 196, .25);
}
.wcdg-if-chip-x {
	display: none;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .25);
	flex-shrink: 0;
	pointer-events: auto;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}
.wcdg-if-chip-x svg {
	width: 8px;
	height: 8px;
	display: block;
	pointer-events: none;
}
.wcdg-if-chip input[type="checkbox"]:checked + .wcdg-if-chip-text .wcdg-if-chip-x {
	display: inline-flex;
}

/* ── Pagination ── */
.wcdg-pagination {
	margin-top: 20px;
	display: flex;
	gap: 6px;
	justify-content: center;
	flex-wrap: wrap;
}
.wcdg-page-btn {
	padding: 8px 14px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fff;
	color: #111;
	font-size: 13px;
	font-family: inherit;
	cursor: pointer;
	line-height: 1.5;
	min-height: 40px;
	min-width: 40px;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}
.wcdg-page-btn.current {
	background: #111;
	color: #fff;
	border-color: #111;
	cursor: default;
	pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
	.wcdg-page-btn {
		transition: background .2s, border-color .2s, color .2s;
	}
	.wcdg-page-btn:hover:not(.current) {
		background: #f5f5f5;
		border-color: #bbb;
	}
}
#wcdg-results.wcdg-loading {
	opacity: .4;
	pointer-events: none;
	transition: opacity .2s;
}

/* ════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════ */

@media (min-width: 768px) {
	.wc-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 18px;
	}
	.wc-content {
		padding: 14px;
	}
	.wc-title {
		font-size: 14px;
		min-height: 70px;
	}
	.wc-price-amount {
		font-size: 18px;
	}
	.wc-contact {
		font-size: 14px;
	}
	.wc-id,
	.wc-guarantee {
		font-size: 12px;
		min-height: 34px;
		padding: 6px 10px;
	}
	.dv-thumb {
		flex: 0 0 40%;
		width: 40%;
		max-width: 40%;
	}
	.dv-title {
		font-size: 14px;
	}
}

@media (max-width: 380px) {
	.wc-grid {
		gap: 8px;
	}
	.wc-content {
		padding: 8px;
	}
	.wc-title {
		font-size: 11px;
		min-height: 60px;
	}
	.wc-price-amount {
		font-size: 13px;
	}
	.wc-id,
	.wc-guarantee {
		font-size: 9px;
		padding: 3px 4px;
		min-height: 24px;
	}
	.dv-thumb {
		flex: 0 0 36%;
		width: 36%;
		max-width: 36%;
	}
	.wcdg-if-chip-text,
	.wcpg-chip-text {
		font-size: 11px;
		padding: 6px 10px;
		min-height: 34px;
	}
}