/**
 * قالب فارسی غلِب — استایل پایه (RTL)
 * سبک و بهینه برای عملکرد سریع
 */

/* متغیرهای پایه (توسط تم رنگی override می‌شوند) */
:root {
	--ghaleb-font: "Vazirmatn", "Tahoma", "Arial", sans-serif;
	--ghaleb-fs-base: 1rem;
	--ghaleb-fs-sm: 0.875rem;
	--ghaleb-fs-lg: 1.125rem;
	--ghaleb-fs-xl: 1.25rem;
	--ghaleb-fs-2xl: 1.5rem;
	--ghaleb-radius: 6px;
	--ghaleb-shadow: 0 1px 3px rgba(0,0,0,0.08);
	--ghaleb-transition: 0.2s ease;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	font-family: var(--ghaleb-font);
	font-size: var(--ghaleb-fs-base);
	line-height: 1.6;
	margin: 0;
	direction: rtl;
	text-align: right;
	background: var(--ghaleb-bg, #fff);
	color: var(--ghaleb-color-text, #333);
}

.ghaleb-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1rem;
}

/* هدر */
.ghaleb-header {
	padding: 0.75rem 0;
	box-shadow: var(--ghaleb-shadow);
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--ghaleb-bg-header, #fff);
}

.ghaleb-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
}

.ghaleb-brand a,
.ghaleb-logo-link {
	font-size: var(--ghaleb-fs-xl);
	font-weight: 700;
	text-decoration: none;
	color: var(--ghaleb-color-heading, #1a1a1a);
}

.ghaleb-nav-toggle {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.5rem;
}

.ghaleb-nav-toggle-bar {
	display: block;
	width: 22px;
	height: 2px;
	background: currentColor;
	margin: 4px 0;
	transition: var(--ghaleb-transition);
}

.ghaleb-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.ghaleb-menu a {
	text-decoration: none;
	padding: 0.5rem 0.75rem;
	color: var(--ghaleb-color-link, #333);
	border-radius: var(--ghaleb-radius);
	transition: var(--ghaleb-transition);
}

.ghaleb-menu a:hover {
	background: var(--ghaleb-bg-hover, #f0f0f0);
	color: var(--ghaleb-color-accent, #333);
}

/* محتوا */
.ghaleb-main {
	min-height: 50vh;
	padding: 1.5rem 0;
}

.ghaleb-content-wrap {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

/* کارت‌ها */
.ghaleb-card {
	background: var(--ghaleb-bg-card, #fff);
	border-radius: var(--ghaleb-radius);
	box-shadow: var(--ghaleb-shadow);
	overflow: hidden;
	margin-bottom: 1.5rem;
	transition: var(--ghaleb-transition);
}

.ghaleb-card:hover {
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ghaleb-card-thumb {
	display: block;
	overflow: hidden;
}

.ghaleb-card-thumb img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
}

.ghaleb-card-body { padding: 1rem; }

.ghaleb-card-title {
	margin: 0 0 0.5rem;
	font-size: var(--ghaleb-fs-lg);
}

.ghaleb-card-title a {
	color: var(--ghaleb-color-heading, #1a1a1a);
	text-decoration: none;
}

.ghaleb-card-title a:hover {
	color: var(--ghaleb-color-accent, #555);
}

.ghaleb-card-meta {
	font-size: var(--ghaleb-fs-sm);
	color: var(--ghaleb-color-meta, #666);
	margin-bottom: 0.5rem;
}

.ghaleb-card-excerpt {
	margin: 0;
	color: var(--ghaleb-color-text, #444);
}

/* صفحه تکی */
.ghaleb-single-header,
.ghaleb-page-header {
	margin-bottom: 1rem;
}

.ghaleb-single-title,
.ghaleb-page-title {
	margin: 0 0 0.5rem;
	font-size: var(--ghaleb-fs-2xl);
	color: var(--ghaleb-color-heading, #1a1a1a);
}

.ghaleb-single-meta {
	font-size: var(--ghaleb-fs-sm);
	color: var(--ghaleb-color-meta, #666);
}

.ghaleb-single-thumb img,
.ghaleb-page-thumb img {
	width: 100%;
	height: auto;
	border-radius: var(--ghaleb-radius);
	margin-bottom: 1rem;
}

.ghaleb-single-content,
.ghaleb-page-content {
	color: var(--ghaleb-color-text, #444);
}

.ghaleb-single-content img,
.ghaleb-page-content img {
	max-width: 100%;
	height: auto;
}

/* صفحهٔ اول */
.ghaleb-front .ghaleb-container {
	padding-top: 0.5rem;
}

/* بنر صفحهٔ اول */
.ghaleb-banner {
	margin-bottom: 2rem;
	border-radius: var(--ghaleb-radius);
	overflow: hidden;
}

.ghaleb-banner-inner {
	position: relative;
	overflow: hidden;
	border-radius: var(--ghaleb-radius);
	background: var(--ghaleb-bg-banner, #f5f5f5);
	min-height: 280px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ghaleb-banner-img {
	width: 100%;
	height: auto;
	min-height: 280px;
	object-fit: cover;
	display: block;
}

.ghaleb-banner-placeholder {
	min-height: 280px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	background: var(--ghaleb-bg-banner, #eee);
}

.ghaleb-banner-placeholder-text {
	font-size: var(--ghaleb-fs-sm);
	color: var(--ghaleb-color-meta, #666);
	text-align: center;
	max-width: 400px;
}

.ghaleb-banner-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: rgba(0,0,0,0.35);
	color: #fff;
	text-align: center;
	padding: 1.5rem;
}

.ghaleb-banner-title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.5rem, 4vw, 2.25rem);
}

.ghaleb-banner-desc {
	margin: 0;
	font-size: var(--ghaleb-fs-lg);
	opacity: 0.95;
}

/* محصولات و کاروسل */
.ghaleb-products-section {
	margin-bottom: 2.5rem;
}

.ghaleb-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-bottom: 1.25rem;
}

.ghaleb-section-title {
	margin: 0;
	font-size: var(--ghaleb-fs-xl);
	color: var(--ghaleb-color-heading, #1a1a1a);
}

.ghaleb-carousel-nav {
	display: flex;
	gap: 0.5rem;
}

.ghaleb-carousel-prev,
.ghaleb-carousel-next {
	width: 2.5rem;
	height: 2.5rem;
	border: 1px solid var(--ghaleb-bg-hover, #eee);
	background: var(--ghaleb-bg-card, #fff);
	border-radius: var(--ghaleb-radius);
	cursor: pointer;
	font-size: 1.25rem;
	line-height: 1;
	transition: var(--ghaleb-transition);
	color: var(--ghaleb-color-heading, #1a1a1a);
}

.ghaleb-carousel-prev:hover,
.ghaleb-carousel-next:hover {
	background: var(--ghaleb-bg-hover, #f0f0f0);
}

.ghaleb-carousel-wrap {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 0.5rem;
}

.ghaleb-carousel-wrap::-webkit-scrollbar {
	height: 6px;
}

.ghaleb-carousel-wrap::-webkit-scrollbar-thumb {
	background: var(--ghaleb-color-meta, #999);
	border-radius: 3px;
}

.ghaleb-products-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 1.25rem;
}

.ghaleb-products-grid.ghaleb-carousel {
	display: flex;
	flex-wrap: nowrap;
	grid-template-columns: unset;
	gap: 1rem;
	padding: 0 0.25rem;
}

.ghaleb-products-grid.ghaleb-carousel .ghaleb-product-card {
	flex: 0 0 200px;
	scroll-snap-align: start;
}

/* بخش گرید باکس محصولات (صفحهٔ اول) */
.ghaleb-products-grid-section {
	margin-bottom: 2.5rem;
}

.ghaleb-products-grid-section .ghaleb-section-title {
	text-align: center;
	margin-bottom: 1.25rem;
}

.ghaleb-products-grid.ghaleb-product-boxes {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1.25rem;
	flex-wrap: wrap;
}

.ghaleb-product-box {
	background: var(--ghaleb-bg-card, #fff);
	border-radius: var(--ghaleb-radius);
	box-shadow: var(--ghaleb-shadow);
	overflow: hidden;
	transition: var(--ghaleb-transition);
}

.ghaleb-product-card {
	background: var(--ghaleb-bg-card, #fff);
	border-radius: var(--ghaleb-radius);
	box-shadow: var(--ghaleb-shadow);
	overflow: hidden;
	transition: var(--ghaleb-transition);
}

.ghaleb-product-card:hover {
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
	transform: translateY(-2px);
}

.ghaleb-product-link {
	display: block;
	padding: 1rem;
	text-decoration: none;
	color: inherit;
}

.ghaleb-product-link img {
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: var(--ghaleb-radius);
	display: block;
	margin-bottom: 0.75rem;
}

.ghaleb-product-img-placeholder {
	aspect-ratio: 1;
	background: var(--ghaleb-bg-banner, #eee);
	border-radius: var(--ghaleb-radius);
	margin-bottom: 0.75rem;
}

.ghaleb-product-title {
	margin: 0 0 0.5rem;
	font-size: var(--ghaleb-fs-base);
	font-weight: 600;
	color: var(--ghaleb-color-heading, #1a1a1a);
}

.ghaleb-product-price {
	font-size: var(--ghaleb-fs-sm);
	color: var(--ghaleb-color-accent, #333);
	font-weight: 600;
}

.ghaleb-product-stock {
	display: inline-block;
	padding: 0.2rem 0.5rem;
	border-radius: var(--ghaleb-radius);
	font-size: 0.75rem;
	font-weight: 600;
	margin-bottom: 0.5rem;
}

.ghaleb-product-stock.ghaleb-in-stock {
	background: #e8f5e9;
	color: #2e7d32;
}

.ghaleb-product-stock.ghaleb-out-of-stock {
	background: #ffebee;
	color: #c62828;
}

/* معرفی */
.ghaleb-intro-section {
	text-align: center;
	padding: 2rem 1rem;
	background: var(--ghaleb-bg-hover, #f8f8f8);
	border-radius: var(--ghaleb-radius);
	margin-top: 2rem;
}

.ghaleb-intro-text {
	margin: 0;
	max-width: 600px;
	margin-left: auto;
	margin-right: auto;
	color: var(--ghaleb-color-text, #444);
	font-size: var(--ghaleb-fs-lg);
	line-height: 1.7;
}

/* صفحه‌بندی */
.pagination,
.nav-links {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin: 2rem 0;
	flex-wrap: wrap;
}

.pagination a,
.pagination span,
.nav-links a,
.nav-links span {
	padding: 0.5rem 0.75rem;
	text-decoration: none;
	border-radius: var(--ghaleb-radius);
	background: var(--ghaleb-bg-card, #fff);
	color: var(--ghaleb-color-link, #333);
	box-shadow: var(--ghaleb-shadow);
	transition: var(--ghaleb-transition);
}

.pagination a:hover,
.nav-links a:hover {
	background: var(--ghaleb-bg-hover, #f0f0f0);
}

.pagination .current,
.nav-links .current {
	background: var(--ghaleb-color-accent, #333);
	color: #fff;
}

/* هیچ محتوا */
.ghaleb-none {
	text-align: center;
	padding: 3rem 1rem;
}

.ghaleb-none-title {
	margin: 0 0 0.5rem;
	color: var(--ghaleb-color-heading, #1a1a1a);
}

.ghaleb-none-text {
	margin: 0;
	color: var(--ghaleb-color-meta, #666);
}

/* ۴۰۴ */
.ghaleb-404-inner {
	text-align: center;
	padding: 3rem 1rem;
}

.ghaleb-404-title {
	font-size: 4rem;
	margin: 0 0 0.5rem;
	color: var(--ghaleb-color-heading, #1a1a1a);
}

.ghaleb-404-text {
	margin: 0 0 1.5rem;
	color: var(--ghaleb-color-text, #444);
}

.ghaleb-btn {
	display: inline-block;
	padding: 0.6rem 1.25rem;
	background: var(--ghaleb-color-accent, #333);
	color: #fff !important;
	text-decoration: none;
	border-radius: var(--ghaleb-radius);
	transition: var(--ghaleb-transition);
}

.ghaleb-btn:hover {
	opacity: 0.9;
}

/* حالت لود دکمه — کاربر متوجه شود کلیک ثبت شده و در حال بارگذاری است */
.ghaleb-btn.loading,
button.ghaleb-btn.loading {
	position: relative;
	color: transparent !important;
	pointer-events: none;
	opacity: 0.9;
}

.ghaleb-btn.loading::after,
button.ghaleb-btn.loading::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 22px;
	height: 22px;
	border: 2px solid rgba(255,255,255,0.35);
	border-right-color: #fff;
	border-radius: 50%;
	animation: ghaleb-spin 0.6s linear infinite;
}

@keyframes ghaleb-spin {
	to { transform: rotate(360deg); }
}

/* آرشیو */
.ghaleb-archive-header {
	margin-bottom: 1.5rem;
}

.ghaleb-archive-title {
	margin: 0 0 0.5rem;
	color: var(--ghaleb-color-heading, #1a1a1a);
}

.ghaleb-archive-desc {
	margin: 0;
	color: var(--ghaleb-color-meta, #666);
}

/* سایدبار */
.ghaleb-sidebar {
	padding: 1rem 0;
}

.ghaleb-sidebar .widget {
	margin-bottom: 1.5rem;
}

/* فوتر */
.ghaleb-footer {
	padding: 2rem 0 1rem;
	margin-top: 2rem;
	background: var(--ghaleb-bg-footer, #1a1a1a);
	color: var(--ghaleb-color-footer, #ccc);
}

.ghaleb-footer-inner {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1.5rem;
	margin-bottom: 1.5rem;
}

.ghaleb-footer-title {
	font-size: var(--ghaleb-fs-lg);
	margin: 0 0 0.75rem;
	color: #fff;
}

.ghaleb-footer-text,
.ghaleb-footer-menu {
	margin: 0;
	font-size: var(--ghaleb-fs-sm);
}

.ghaleb-footer-menu {
	list-style: none;
	padding: 0;
}

.ghaleb-footer-menu a {
	color: var(--ghaleb-color-footer, #ccc);
	text-decoration: none;
}

.ghaleb-footer-menu a:hover {
	color: #fff;
}

.ghaleb-footer-bottom {
	border-top: 1px solid rgba(255,255,255,0.1);
	padding-top: 1rem;
	text-align: center;
}

.ghaleb-copyright {
	margin: 0;
	font-size: var(--ghaleb-fs-sm);
	opacity: 0.9;
}

/* لایه‌بندی با سایدبار */
.ghaleb-content-wrap {
	display: block;
}

.ghaleb-content-wrap:has(.ghaleb-sidebar) {
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
}

.ghaleb-content-wrap:has(.ghaleb-sidebar) .ghaleb-main {
	flex: 1;
	min-width: 0;
}

.ghaleb-sidebar {
	flex: 0 0 280px;
}

/* ========== ریسپانسیو — تبلت و موبایل ========== */
@media (max-width: 1024px) {
	.ghaleb-container {
		padding-left: 1rem;
		padding-right: 1rem;
	}
	.ghaleb-content-wrap:has(.ghaleb-sidebar) {
		flex-direction: column;
	}
	.ghaleb-sidebar {
		flex: 1 1 100%;
		max-width: 100%;
	}
}

@media (max-width: 768px) {
	html {
		overflow-x: hidden;
	}
	body {
		overflow-x: hidden;
	}

	/* هدر موبایل */
	.ghaleb-header {
		padding: 0.5rem 0;
	}
	.ghaleb-header-inner {
		display: flex;
		flex-wrap: nowrap;
		align-items: center;
		justify-content: space-between;
		gap: 0.5rem;
		min-height: 48px;
	}
	.ghaleb-brand {
		flex: 0 0 auto;
		min-width: 0;
	}
	.ghaleb-brand a,
	.ghaleb-logo-link {
		font-size: var(--ghaleb-fs-lg);
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		max-width: 140px;
		display: inline-block;
	}
	.ghaleb-brand .custom-logo-link img {
		max-height: 40px;
		width: auto;
		height: auto;
		object-fit: contain;
	}
	.ghaleb-nav-wrap {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		gap: 0.5rem;
		flex: 1;
		min-width: 0;
	}
	.ghaleb-nav-toggle {
		display: block;
		min-width: 44px;
		min-height: 44px;
		padding: 10px;
		margin: 0;
		border: none;
		background: transparent;
	}
	.ghaleb-nav-toggle-bar {
		display: block;
		width: 22px;
		height: 2px;
		margin: 4px auto;
	}
	.ghaleb-nav {
		display: flex;
		flex-wrap: wrap;
		justify-content: flex-end;
		align-items: center;
		gap: 0.5rem;
		flex: 1;
		min-width: 0;
	}
	.ghaleb-menu {
		display: none;
		flex-direction: column;
		width: 100%;
		margin: 0;
		padding: 0 1rem;
		order: 10;
		background: var(--ghaleb-bg-header, #fff);
		box-shadow: 0 4px 12px rgba(0,0,0,0.08);
		border-radius: 0 0 var(--ghaleb-radius) var(--ghaleb-radius);
	}
	.ghaleb-menu.is-open {
		display: flex;
	}
	.ghaleb-menu li {
		width: 100%;
		border-bottom: 1px solid var(--ghaleb-bg-hover, #eee);
	}
	.ghaleb-menu a {
		display: block;
		padding: 0.75rem 0;
		min-height: 44px;
		line-height: 1.4;
	}
	.ghaleb-cart-link {
		min-height: 44px;
		min-width: 44px;
		padding: 0.5rem 0.75rem;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		font-size: var(--ghaleb-fs-sm);
	}

	/* محتوا */
	.ghaleb-main {
		padding: 1rem 0;
	}
	.ghaleb-container {
		padding-left: 0.75rem;
		padding-right: 0.75rem;
		max-width: 100%;
	}

	/* بنر */
	.ghaleb-banner-inner,
	.ghaleb-banner-placeholder {
		min-height: 200px;
	}
	.ghaleb-banner-img {
		min-height: 200px;
	}
	.ghaleb-banner-overlay {
		padding: 1rem;
	}
	.ghaleb-banner-title {
		font-size: 1.35rem;
	}
	.ghaleb-banner-desc {
		font-size: var(--ghaleb-fs-base);
	}

	/* کاروسل و محصولات */
	.ghaleb-section-head {
		flex-direction: column;
		align-items: stretch;
		gap: 0.5rem;
	}
	.ghaleb-carousel-nav {
		align-self: flex-end;
	}
	.ghaleb-products-grid:not(.ghaleb-carousel):not(.ghaleb-product-boxes) {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.75rem;
	}
	.ghaleb-products-grid.ghaleb-carousel .ghaleb-product-card {
		flex: 0 0 160px;
	}
	.ghaleb-product-card {
		transform: none;
	}
	.ghaleb-product-link {
		padding: 0.75rem;
	}
	.ghaleb-product-title {
		font-size: var(--ghaleb-fs-sm);
	}

	/* معرفی و فوتر */
	.ghaleb-intro-section {
		padding: 1.25rem 0.75rem;
		margin-top: 1.5rem;
	}
	.ghaleb-intro-text {
		font-size: var(--ghaleb-fs-base);
	}
	.ghaleb-footer-inner {
		grid-template-columns: 1fr;
		gap: 1.25rem;
		text-align: center;
	}
	.ghaleb-footer {
		padding: 1.5rem 0 1rem;
		margin-top: 1.5rem;
	}
	.pagination a,
	.pagination span,
	.nav-links a,
	.nav-links span {
		padding: 0.5rem 0.6rem;
		font-size: var(--ghaleb-fs-sm);
	}
	.ghaleb-404-title {
		font-size: 3rem;
	}
	body:has(.ghaleb-sidebar) .ghaleb-main .ghaleb-container {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	.ghaleb-container {
		padding-left: 0.5rem;
		padding-right: 0.5rem;
	}
	.ghaleb-brand a,
	.ghaleb-logo-link {
		max-width: 110px;
		font-size: var(--ghaleb-fs-base);
	}
	.ghaleb-banner-inner,
	.ghaleb-banner-placeholder {
		min-height: 160px;
	}
	.ghaleb-banner-img {
		min-height: 160px;
	}
	.ghaleb-section-title {
		font-size: var(--ghaleb-fs-lg);
	}
	.ghaleb-products-grid:not(.ghaleb-carousel):not(.ghaleb-product-boxes) {
		grid-template-columns: 1fr;
		gap: 0.75rem;
	}
	.ghaleb-products-grid.ghaleb-carousel .ghaleb-product-card {
		flex: 0 0 140px;
	}
	.ghaleb-btn {
		display: block;
		text-align: center;
		padding: 0.75rem 1rem;
	}
}
