/* Golden Home Cards 1.0.0 — همهٔ قواعد زیر .ghc / .ghc-* محدود شده تا با قالب و افزونه‌های دیگر تداخل نکند. */

/* ===== Tokens ===== */
.ghc {
	--ghc-accent: #006b3c;
	--ghc-gold: #d9a21b;
	--ghc-red: #d94747;
	--ghc-text: #20302a;
	--ghc-muted: #6f7874;
	--ghc-buy: #006b3c;
	--ghc-buy_hover: #00502d;
	--ghc-buy_text: #fff;
	--ghc-surface: #fff;
	--ghc-border: #e2e8e3;
	--ghc-star-empty: #d8dfda;
	--ghc-cols: 4;
	--ghc-view: 4;
	--ghc-gap: 18px;
	--ghc-radius: 18px;
	--ghc-speed: 300ms;
	--ghc-ease: cubic-bezier(.22, .61, .36, 1);
	--ghc-soft: rgba(0, 107, 60, .08);
	--ghc-glow: rgba(0, 107, 60, .26);
	--ghc-shadow: 0 1px 2px rgba(18, 38, 28, .04), 0 10px 26px -14px rgba(18, 38, 28, .16);
	--ghc-shadow-hover: 0 2px 4px rgba(18, 38, 28, .05), 0 26px 46px -18px var(--ghc-glow);
	color: var(--ghc-text);
	font-family: inherit;
	line-height: 1.7;
	box-sizing: border-box;
	width: 100%;
}

@supports (color: color-mix(in srgb, red, blue)) {
	.ghc {
		--ghc-soft: color-mix(in srgb, var(--ghc-accent) 8%, transparent);
		--ghc-glow: color-mix(in srgb, var(--ghc-accent) 32%, transparent);
	}
}

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

.ghc :focus-visible {
	outline: 2px solid var(--ghc-accent);
	outline-offset: 2px;
}

.ghc .ghc-svg {
	display: block;
	flex: none;
	width: 1.25em;
	height: 1.25em;
}

@keyframes ghc-spin { to { transform: rotate(360deg); } }
@keyframes ghc-in { from { opacity: 0; transform: translateY(12px); } }

/* ===== Head ===== */
.ghc .ghc-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	margin-bottom: 22px;
}

.ghc .ghc-head-text {
	margin-inline-end: auto;
	min-width: 0;
}

.ghc .ghc-head-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	color: var(--ghc-text);
	font-size: 1.35em;
	font-weight: 800;
	line-height: 1.5;
}

.ghc .ghc-head-title::before {
	content: "";
	flex: none;
	width: 6px;
	height: 24px;
	border-radius: 6px;
	background: linear-gradient(var(--ghc-gold), var(--ghc-accent));
}

.ghc .ghc-head-sub {
	margin: 2px 0 0;
	color: var(--ghc-muted);
	font-size: .92em;
}

.ghc a.ghc-all {
	color: var(--ghc-accent);
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.ghc a.ghc-all:hover,
.ghc a.ghc-all:focus {
	color: var(--ghc-accent);
	text-decoration: underline;
}

/* ===== Tabs ===== */
.ghc .ghc-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ghc button.ghc-tab {
	margin: 0;
	padding: 7px 18px;
	border: 1px solid var(--ghc-border);
	border-radius: 999px;
	background: var(--ghc-surface);
	color: var(--ghc-text);
	font: inherit;
	font-size: .92em;
	font-weight: 700;
	line-height: 1.6;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s;
}

.ghc button.ghc-tab:hover,
.ghc button.ghc-tab:focus-visible {
	background: var(--ghc-soft);
	border-color: var(--ghc-accent);
	color: var(--ghc-accent);
}

.ghc button.ghc-tab.is-active,
.ghc button.ghc-tab.is-active:hover,
.ghc button.ghc-tab.is-active:focus-visible {
	background: var(--ghc-accent);
	border-color: var(--ghc-accent);
	color: #fff;
	box-shadow: 0 10px 18px -10px var(--ghc-glow);
}

.ghc .ghc-panel[hidden] {
	display: none;
}

/* ===== Grid / Slider ===== */
.ghc .ghc-track {
	position: relative;
}

.ghc .ghc-grid {
	display: grid;
	grid-template-columns: repeat(var(--ghc-cols), minmax(0, 1fr));
	gap: var(--ghc-gap);
}

.ghc .ghc-empty {
	grid-column: 1 / -1;
	margin: 0;
	padding: 48px 16px;
	text-align: center;
	color: var(--ghc-muted);
}

.ghc[data-mode="slider"] .ghc-grid {
	display: flex;
	overflow-x: auto;
	margin: -8px -2px -24px;
	padding: 8px 2px 24px;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 2px;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.ghc[data-mode="slider"] .ghc-grid::-webkit-scrollbar {
	display: none;
}

.ghc[data-mode="slider"] .ghc-grid > .ghc-card {
	flex: 0 0 calc((100% - (var(--ghc-view) - 1) * var(--ghc-gap)) / var(--ghc-view));
	scroll-snap-align: start;
}

.ghc[data-mode="slider"] .ghc-grid > .ghc-empty {
	flex: 1 1 100%;
}

/* ===== Arrows ===== */
.ghc button.ghc-arrow {
	position: absolute;
	top: 40%;
	z-index: 4;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--ghc-border);
	border-radius: 50%;
	background: #fff;
	color: var(--ghc-text);
	box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .35);
	cursor: pointer;
	transform: translateY(-50%);
	transition: background-color .2s, color .2s, opacity .2s, border-color .2s;
}

.ghc button.ghc-arrow--prev { inset-inline-start: -14px; }
.ghc button.ghc-arrow--next { inset-inline-end: -14px; }

.ghc button.ghc-arrow:hover:not(:disabled),
.ghc button.ghc-arrow:focus-visible {
	background: var(--ghc-accent);
	border-color: var(--ghc-accent);
	color: #fff;
}

.ghc button.ghc-arrow:disabled {
	opacity: .35;
	cursor: default;
}

.ghc button.ghc-arrow .ghc-svg { width: 20px; height: 20px; }
.ghc button.ghc-arrow--prev .ghc-svg { transform: scaleX(-1); }
[dir="rtl"] .ghc button.ghc-arrow--prev .ghc-svg { transform: none; }
[dir="rtl"] .ghc button.ghc-arrow--next .ghc-svg { transform: scaleX(-1); }

/* ===== Card ===== */
.ghc .ghc-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	background: var(--ghc-surface);
	border: 1px solid var(--ghc-border);
	border-radius: var(--ghc-radius);
	box-shadow: var(--ghc-shadow);
	animation: ghc-in .5s var(--ghc-ease) backwards;
	transition:
		transform var(--ghc-speed) var(--ghc-ease),
		box-shadow var(--ghc-speed) var(--ghc-ease),
		border-color var(--ghc-speed) var(--ghc-ease),
		background-color var(--ghc-speed) var(--ghc-ease);
}

.ghc .ghc-card:hover,
.ghc .ghc-card:focus-within {
	transform: translateY(-5px);
	box-shadow: var(--ghc-shadow-hover);
}

.ghc .ghc-media {
	position: relative;
}

.ghc .ghc-media-link {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 240px;
	padding: 18px;
	overflow: hidden;
	background: linear-gradient(180deg, #fcfdfc 0%, #f1f5f2 100%);
	text-decoration: none;
}

.ghc .ghc-media-link img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: contain;
	mix-blend-mode: multiply;
	transition: transform calc(var(--ghc-speed) * 1.7) var(--ghc-ease);
}

.ghc .ghc-card:hover .ghc-media-link img {
	transform: scale(1.06);
}

/* ----- Badges ----- */
.ghc .ghc-badges {
	position: absolute;
	inset-block-start: 12px;
	inset-inline-start: 12px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	pointer-events: none;
}

.ghc .ghc-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 12px;
	border-radius: 999px;
	background: var(--ghc-red);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.7;
	box-shadow: 0 6px 12px -4px rgba(0, 0, 0, .25);
}

.ghc .ghc-badge--oos { background: var(--ghc-muted); }
.ghc .ghc-badge--new { background: var(--ghc-accent); }
.ghc .ghc-badge--best { background: var(--ghc-gold); }
.ghc .ghc-badge--pop { background: #e0457b; }

/* ----- Heart ----- */
.ghc button.ghc-heart {
	position: absolute;
	inset-block-start: 10px;
	inset-inline-end: 10px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .8);
	border-radius: 50%;
	background: rgba(255, 255, 255, .88);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: var(--ghc-muted);
	line-height: 1;
	box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .28);
	cursor: pointer;
	transition: transform .2s var(--ghc-ease), color .2s, background-color .2s, border-color .2s;
}

.ghc button.ghc-heart .ghc-svg {
	width: 18px;
	height: 18px;
}

.ghc button.ghc-heart:hover,
.ghc button.ghc-heart:focus-visible {
	background: #fff;
	border-color: #fff;
	color: var(--ghc-red);
	transform: scale(1.1);
}

.ghc button.ghc-heart.is-active,
.ghc button.ghc-heart.is-active:hover {
	color: var(--ghc-red);
}

.ghc button.ghc-heart.is-active .ghc-svg {
	fill: currentColor;
}

.ghc button.ghc-heart.is-pop {
	animation: ghc-pop .35s var(--ghc-ease);
}

@keyframes ghc-pop {
	50% { transform: scale(1.3); }
}

/* ----- Body ----- */
.ghc .ghc-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 8px;
	padding: 14px 16px 16px;
}

.ghc .ghc-brand {
	display: flex;
	align-items: center;
	gap: 7px;
	color: var(--ghc-muted);
	font-size: 12px;
	line-height: 1.5;
}

.ghc .ghc-brand::before {
	content: "";
	width: 14px;
	height: 2px;
	border-radius: 2px;
	background: var(--ghc-gold);
}

.ghc a.ghc-title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	color: var(--ghc-text);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.8;
	text-decoration: none;
	transition: color .2s;
}

.ghc a.ghc-title:hover,
.ghc a.ghc-title:focus {
	color: var(--ghc-accent);
	text-decoration: none;
}

.ghc .ghc-rating {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--ghc-muted);
	font-size: 12.5px;
	line-height: 1.4;
}

.ghc .ghc-stars {
	--ghc-fill: 0%;
	display: inline-block;
	font-size: 14px;
	line-height: 1;
	letter-spacing: 1px;
	background: linear-gradient(to right, var(--ghc-star, var(--ghc-gold)) var(--ghc-fill), var(--ghc-star-empty) var(--ghc-fill));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

[dir="rtl"] .ghc .ghc-stars {
	background: linear-gradient(to left, var(--ghc-star, var(--ghc-gold)) var(--ghc-fill), var(--ghc-star-empty) var(--ghc-fill));
	-webkit-background-clip: text;
	background-clip: text;
}

.ghc .ghc-rating-num {
	color: var(--ghc-text);
	font-weight: 700;
}

.ghc .ghc-price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 8px;
	margin-top: auto;
	color: var(--ghc-accent);
	font-size: 17px;
	font-weight: 800;
	line-height: 1.6;
}

.ghc .ghc-price del {
	order: 2;
	color: var(--ghc-muted);
	font-size: .78em;
	font-weight: 400;
	opacity: .85;
}

.ghc .ghc-price ins {
	order: 1;
	background: none;
	color: inherit;
	text-decoration: none;
}

.ghc .ghc-price .woocommerce-Price-currencySymbol {
	margin-inline-start: 3px;
	color: var(--ghc-muted);
	font-size: .68em;
	font-weight: 600;
}

/* ----- Buy ----- */
.ghc a.ghc-buy {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 46px;
	margin: 4px 0 0;
	padding: 10px;
	overflow: hidden;
	border: 0;
	border-radius: 12px;
	background-color: var(--ghc-buy);
	background-image: none;
	color: var(--ghc-buy_text);
	font: inherit;
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: normal;
	text-align: center;
	text-decoration: none;
	text-shadow: none;
	text-transform: none;
	cursor: pointer;
	box-shadow: 0 10px 18px -10px var(--ghc-glow);
	transition: background-color .2s, color .2s, transform .2s var(--ghc-ease), box-shadow .2s, opacity .2s;
}

.ghc a.ghc-buy:hover,
.ghc a.ghc-buy:focus-visible {
	background-color: var(--ghc-buy_hover);
	background-image: none;
	color: var(--ghc-buy_text);
	text-decoration: none;
	transform: translateY(-1px);
	box-shadow: 0 14px 22px -10px var(--ghc-glow);
}

.ghc a.ghc-buy:active {
	transform: none;
}

.ghc .ghc-buy-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	line-height: 1;
	transition: transform .25s var(--ghc-ease);
}

.ghc a.ghc-buy:hover .ghc-buy-icon {
	transform: translateX(-2px) rotate(-8deg);
}

.ghc a.ghc-buy.loading {
	cursor: progress;
}

.ghc a.ghc-buy.loading .ghc-buy-icon,
.ghc a.ghc-buy.loading .ghc-buy-label {
	opacity: .35;
}

.ghc a.ghc-buy.loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border: 2px solid currentColor;
	border-inline-end-color: transparent;
	border-radius: 50%;
	animation: ghc-spin .7s linear infinite;
}

.ghc a.ghc-buy.added,
.ghc a.ghc-buy.added:hover,
.ghc a.ghc-buy.added:focus-visible {
	background-color: var(--ghc-gold);
	color: #fff;
}

/* لینک «مشاهده سبد» که اسکریپت ووکامرس داخل کارت اضافه می‌کند (پیام ما به‌صورت toast نمایش داده می‌شود). */
.ghc .ghc-card a.added_to_cart {
	display: none !important;
}

/* دکمه فقط هنگام هاور (دسکتاپ) */
@media (hover: hover) and (min-width: 768px) {
	.ghc-btn-hover .ghc .ghc-card a.ghc-buy {
		opacity: 0;
		transform: translateY(10px);
		pointer-events: none;
	}

	.ghc-btn-hover .ghc .ghc-card:hover a.ghc-buy,
	.ghc-btn-hover .ghc .ghc-card:focus-within a.ghc-buy {
		opacity: 1;
		transform: none;
		pointer-events: auto;
	}
}

/* مخفی‌سازی بخش‌ها با کلیدهای المنتور */
.ghc-nobrand-yes .ghc .ghc-brand,
.ghc-norating-yes .ghc .ghc-rating,
.ghc-noheart-yes .ghc .ghc-heart,
.ghc-nobadge-yes .ghc .ghc-badges,
.ghc-nobtn-yes .ghc .ghc-buy,
.ghc-noicon-yes .ghc .ghc-buy-icon {
	display: none;
}

.ghc-noanim-yes .ghc .ghc-card {
	animation: none;
}

/* ===== Wishlist widget ===== */
/* فاصلهٔ صفحهٔ علاقه‌مندی از هدر و فوتر (فقط ریشهٔ همین بلوک؛ استایل عمومی قالب دست نمی‌خورد) */
.ghc.ghc-wl {
	padding-block: 48px 72px;
}

@media (max-width: 1024px) {
	.ghc.ghc-wl {
		padding-block: 36px 56px;
	}
}

@media (max-width: 767px) {
	.ghc.ghc-wl {
		padding-block: 24px 40px;
	}
}

.ghc-wl.is-loading .ghc-grid {
	opacity: .4;
	pointer-events: none;
	transition: opacity .2s;
}

.ghc .ghc-wl-empty {
	padding: 48px 16px;
	text-align: center;
	color: var(--ghc-muted);
}

.ghc .ghc-wl-empty[hidden] {
	display: none;
}

.ghc .ghc-wl-empty p {
	margin: 0 0 16px;
}

.ghc a.ghc-wl-shop {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 10px 22px;
	border-radius: 12px;
	background: var(--ghc-accent);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
}

.ghc a.ghc-wl-shop:hover,
.ghc a.ghc-wl-shop:focus {
	background: var(--ghc-accent);
	color: #fff;
	filter: brightness(.92);
}

/* شورت‌کد [ghc_wishlist_count] — بیرون از .ghc (مثلاً هدر) */
.ghc-wl-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: inherit;
	text-decoration: none;
	line-height: 1;
}

.ghc-wl-link .ghc-svg {
	width: 24px;
	height: 24px;
}

.ghc-wl-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: #d94747;
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	line-height: 1;
}

.ghc-wl-count.is-zero {
	display: none;
}

/* ===== Toast ===== */
.ghc-toast {
	position: fixed;
	inset-inline-start: 24px;
	bottom: 24px;
	z-index: 100000;
	display: flex;
	align-items: center;
	gap: 14px;
	max-width: calc(100% - 48px);
	padding: 13px 18px;
	border-radius: 14px;
	background: #20302a;
	color: #fff;
	font-size: 14px;
	line-height: 1.6;
	box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .4);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity .2s, transform .2s, visibility .2s;
}

.ghc-toast.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.ghc-toast a {
	color: #d9a21b;
	font-weight: 700;
	text-decoration: underline;
	white-space: nowrap;
}

/* ===== Tablet ===== */
@media (min-width: 768px) and (max-width: 1024px) {
	.ghc .ghc-grid {
		grid-template-columns: repeat(var(--ghc-cols-t, var(--ghc-cols)), minmax(0, 1fr));
	}

	.ghc {
		--ghc-cols: 3;
		--ghc-view: 3;
	}
}

/* ===== Mobile ===== */
@media (max-width: 767px) {
	.ghc {
		--ghc-cols: 2;
		--ghc-view: 2.2;
		--ghc-gap: 12px;
	}

	.ghc .ghc-grid {
		grid-template-columns: repeat(var(--ghc-cols-m, var(--ghc-cols)), minmax(0, 1fr));
	}

	.ghc .ghc-media-link {
		height: 180px;
		padding: 12px;
	}

	.ghc .ghc-card-body {
		padding: 10px 12px 12px;
	}

	.ghc .ghc-head {
		gap: 10px;
	}

	.ghc .ghc-tabs {
		flex: 1 1 100%;
		order: 3;
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: 4px;
		scrollbar-width: none;
	}

	.ghc .ghc-tabs::-webkit-scrollbar {
		display: none;
	}

	.ghc button.ghc-tab {
		flex: none;
	}

	.ghc button.ghc-arrow--prev { inset-inline-start: -6px; }
	.ghc button.ghc-arrow--next { inset-inline-end: -6px; }

	.ghc-noarrow-m-yes .ghc button.ghc-arrow {
		display: none;
	}

	.ghc-toast {
		inset-inline: 12px;
		bottom: 12px;
		max-width: none;
	}
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
	.ghc *,
	.ghc *::before,
	.ghc *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}

	.ghc .ghc-card:hover,
	.ghc .ghc-card:focus-within,
	.ghc .ghc-card:hover .ghc-media-link img {
		transform: none;
	}
}
