/* ==========================================================================
   EDD AgTheme v1.2.0
   رنگ‌ها را از «دانلودها ← AgTheme» تنظیم کن یا این متغیرها را override کن.
   ========================================================================== */
:root {
	--agedd-c1: #935152;      /* رنگ اصلی دکمه‌ها */
	--agedd-c2: #727f9f;      /* رنگ دوم گرادیان دکمه‌ها */
	--agedd-accent: #7ed1b7;  /* لیبل‌ها */
	--agedd-accent-ink: #1d3a31; /* رنگ متن روی لیبل‌ها */
	--agedd-text: #24243a;
	--agedd-muted: #858595;
	--agedd-border: #e8e8ee;
	--agedd-bg: #ffffff;
	--agedd-soft: #f7f7fb;
	--agedd-radius: 14px;
	--agedd-ratio: 271 / 221;      /* نسبت تصویر شاخص (صفحه محصول) */
	--agedd-card-ratio: 271 / 310; /* نسبت کارت محصول؛ عدد دوم بزرگ‌تر = کارت کشیده‌تر */
	--agedd-shadow: 0 3px 12px rgba(0, 0, 0, .05);
	--agedd-shadow-hover: 0 14px 30px rgba(36, 36, 58, .16);
}

.agedd-box, .agedd-card, .agedd-single, .agedd-shop, .agedd-grid { direction: rtl; box-sizing: border-box; }
.agedd-box *, .agedd-card *, .agedd-single *, .agedd-shop * { box-sizing: border-box; }

/* ---------- قیمت + دکمه آیکنی ---------- */
.agedd-box {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	width: 100%; padding: 10px 12px;
	background: var(--agedd-bg); border: 1px solid var(--agedd-border);
	border-radius: 12px; box-shadow: var(--agedd-shadow);
}
.agedd-box__price, .agedd-buybox__price {
	display: flex; align-items: baseline; gap: 5px; color: var(--agedd-text); white-space: nowrap;
}
.agedd-amount { font-size: 19px; font-weight: 800; line-height: 1; }
.agedd-currency { font-size: 11px; font-weight: 500; color: var(--agedd-muted); }
.agedd-from { font-size: 12px; color: var(--agedd-muted); }
.agedd-price-free { font-size: 17px; font-weight: 800; color: var(--agedd-c1); }
.agedd-price-inline { display: inline-flex; align-items: baseline; gap: 5px; }

.agedd-icon-btn {
	display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
	width: 42px; height: 42px; border-radius: 11px;
	background: linear-gradient(135deg, var(--agedd-c1), var(--agedd-c2));
	color: #fff !important; text-decoration: none !important;
	box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
	transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}
.agedd-icon-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0, 0, 0, .22); filter: brightness(1.08); }
.agedd-icon-btn:active { transform: translateY(-1px); }
.agedd-icon-btn:focus-visible { outline: 3px solid var(--agedd-c1); outline-offset: 2px; }

/* ---------- کارت محصول: تصویر کل کارت را می‌پوشاند ---------- */
.agedd-card {
	position: relative; display: block; overflow: hidden;
	aspect-ratio: var(--agedd-card-ratio);
	border-radius: var(--agedd-radius);
	background: linear-gradient(135deg, var(--agedd-c1), var(--agedd-c2));
	box-shadow: var(--agedd-shadow);
	transition: transform .3s ease, box-shadow .3s ease;
	isolation: isolate;
}
.agedd-card:hover { transform: translateY(-4px); box-shadow: var(--agedd-shadow-hover); }

.agedd-card__media { position: absolute; inset: 0; display: block; z-index: 0; }
.agedd-card__img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.agedd-card:hover .agedd-card__img { transform: scale(1.06); }
.agedd-card__placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: rgba(255, 255, 255, .8); }
.agedd-card__placeholder .agedd-icon { width: 48px; height: 48px; }

/* دسته‌بندی: دکمه روی تصویر */
.agedd-card__cat {
	position: absolute; top: 12px; right: 12px; z-index: 3;
	max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
	padding: 5px 14px; border-radius: 999px;
	background: var(--agedd-accent);
	color: var(--agedd-accent-ink) !important; font-size: 11.5px; font-weight: 800; line-height: 1.6;
	text-decoration: none !important; box-shadow: 0 3px 8px rgba(0, 0, 0, .25);
	transition: filter .2s ease;
}
.agedd-card__cat:hover { filter: brightness(1.12); }

/* پایین کارت: عنوان + باکس قیمت */
.agedd-card__overlay {
	position: absolute; right: 0; left: 0; bottom: 0; z-index: 2;
	display: flex; flex-direction: column; gap: 10px;
	padding: 90px 12px 14px;
	background: linear-gradient(to top, rgba(12, 12, 28, .94) 0%, rgba(12, 12, 28, .78) 50%, rgba(12, 12, 28, 0) 100%);
	pointer-events: none;
}
.agedd-card__overlay a { pointer-events: auto; }
.agedd-card__title { margin: 0; padding: 0 4px; font-size: 14px; line-height: 1.7; font-weight: 700; }
.agedd-card__title a {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	color: #fff !important; text-decoration: none !important;
}
.agedd-card .agedd-box {
	pointer-events: auto; padding: 7px 10px; gap: 8px;
	background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22);
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	box-shadow: none;
}
.agedd-card .agedd-box__price { color: #fff; }
.agedd-card .agedd-amount { font-size: 17px; }
.agedd-card .agedd-currency, .agedd-card .agedd-from { color: rgba(255, 255, 255, .78); }
.agedd-card .agedd-price-free { color: #fff; }
.agedd-card .agedd-icon-btn { width: 38px; height: 38px; border-radius: 10px; }

/* ---------- گرید ---------- */
.agedd-grid { display: grid; gap: 20px; }
.agedd-cols-1 { grid-template-columns: 1fr; }
.agedd-cols-2 { grid-template-columns: repeat(2, 1fr); }
.agedd-cols-3 { grid-template-columns: repeat(3, 1fr); }
.agedd-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- فیلتر فروشگاه ---------- */
.agedd-filters {
	display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; padding: 12px;
	background: var(--agedd-bg); border: 1px solid var(--agedd-border); border-radius: var(--agedd-radius);
}
.agedd-filters input[type="search"] { flex: 1 1 220px; }
.agedd-filters input, .agedd-filters select {
	height: 44px; padding: 0 14px; border: 1px solid var(--agedd-border); border-radius: 10px;
	background: #fff; font-size: 14px; color: var(--agedd-text);
}
.agedd-filters button {
	height: 44px; padding: 0 24px; border: 0; border-radius: 10px;
	background: linear-gradient(135deg, var(--agedd-c1), var(--agedd-c2));
	color: #fff; font-weight: 700; cursor: pointer;
}
.agedd-empty { padding: 40px; text-align: center; color: var(--agedd-muted); }

.agedd-pagination { margin-top: 28px; }
.agedd-pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.agedd-pagination a, .agedd-pagination span {
	display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px;
	border: 1px solid var(--agedd-border); border-radius: 10px; background: #fff; color: var(--agedd-text); text-decoration: none;
}
.agedd-pagination .current { background: linear-gradient(135deg, var(--agedd-c1), var(--agedd-c2)); border-color: transparent; color: #fff; }

/* ==========================================================================
   صفحه محصول
   ========================================================================== */
.agedd-single { width: 100%; }

.agedd-single__head { margin-bottom: 22px; }
.agedd-single__cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.agedd-chip {
	padding: 4px 14px; border-radius: 999px; color: var(--agedd-accent-ink) !important; font-size: 12px; font-weight: 800;
	background: var(--agedd-accent); text-decoration: none !important;
}
.agedd-single__title { margin: 0; font-size: 26px; line-height: 1.7; color: var(--agedd-text); }

/* ستون اول (راست در RTL) = کارت محصول */
.agedd-single__layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 28px; align-items: start; }

.agedd-single__side { position: sticky; top: 24px; }

.agedd-product {
	overflow: hidden; background: var(--agedd-bg);
	border: 1px solid var(--agedd-border); border-radius: 18px;
	box-shadow: 0 10px 30px rgba(36, 36, 58, .08);
}

/* تصویر: لبه‌تالبه بالای کارت، با همان نسبت ۲۷۱×۲۲۱ */
.agedd-product__media { aspect-ratio: var(--agedd-ratio); background: var(--agedd-soft); overflow: hidden; }
.agedd-product__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.agedd-product__placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--agedd-muted); }
.agedd-product__placeholder .agedd-icon { width: 56px; height: 56px; }

.agedd-product__body { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 20px; border-bottom: 1px solid var(--agedd-border); }
.agedd-buybox__price .agedd-amount { font-size: 30px; }
.agedd-buybox__price .agedd-currency { font-size: 14px; }
.agedd-buybox__price .agedd-price-free { font-size: 28px; }

/* ---- دکمه خرید EDD ---- */
.agedd-buybox__action .edd_purchase_submit_wrapper { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.agedd-buybox__action .edd-no-js { display: none !important; } /* دکمه بدون‌جاوااسکریپت EDD */
.agedd-buybox__action .edd_price_options { margin: 0 0 14px; padding: 0; list-style: none; }
.agedd-buybox__action .edd_price_options li { margin: 0 0 8px; }
.agedd-buybox__action .edd_price_options label {
	display: flex; align-items: center; gap: 8px; padding: 10px 12px;
	border: 1px solid var(--agedd-border); border-radius: 10px; cursor: pointer; font-size: 14px;
}

.agedd-buybox__action .edd-add-to-cart,
.agedd-buybox__action .edd_go_to_checkout {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	width: 100%; min-height: 50px; padding: 12px 18px; margin: 0;
	border: 0; border-radius: 12px;
	background: linear-gradient(135deg, var(--agedd-c1), var(--agedd-c2));
	color: #fff; font-size: 15px; font-weight: 700; line-height: 1.4; text-decoration: none;
	box-shadow: 0 6px 14px rgba(0, 0, 0, .16);
	cursor: pointer; transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}
.agedd-buybox__action .edd-add-to-cart:hover,
.agedd-buybox__action .edd_go_to_checkout:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0, 0, 0, .22); filter: brightness(1.08); color: #fff; }

/* بعد از افزودن به سبد: لینک «نهایی کردن خرید» (display را EDD با inline-style کنترل می‌کند) */
.agedd-buybox__action .edd_go_to_checkout { background: var(--agedd-accent); color: var(--agedd-accent-ink); }
.agedd-buybox__action .edd_go_to_checkout:hover { color: var(--agedd-accent-ink); }
.agedd-buybox__action .edd-loading, .agedd-buybox__action .edd-loading-ajax { margin: 0; }
.agedd-buybox__action .edd-cart-added-alert { margin-top: 6px; font-size: 13px; }

/* ---- مشخصات ---- */
.agedd-info { margin: 0; padding: 6px 20px 8px; list-style: none; }
.agedd-info li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--agedd-border); font-size: 13.5px; }
.agedd-info li:last-child { border-bottom: 0; }
.agedd-info__label { display: inline-flex; align-items: center; gap: 10px; color: var(--agedd-muted); }
.agedd-info__ico {
	display: inline-flex; align-items: center; justify-content: center;
	width: 30px; height: 30px; border-radius: 9px; color: var(--agedd-accent-ink);
	background: color-mix(in srgb, var(--agedd-accent) 35%, transparent);
}
.agedd-info__ico .agedd-icon { width: 16px; height: 16px; }
.agedd-info__value { font-weight: 700; color: var(--agedd-text); text-align: left; }

/* ---- راهنمای دانلود (زیر کارت محصول) ---- */
.agedd-guide {
	display: flex; gap: 12px; align-items: flex-start; margin: 16px 0 0; padding: 16px;
	background: color-mix(in srgb, var(--agedd-accent) 14%, #fff);
	border: 1px solid color-mix(in srgb, var(--agedd-accent) 55%, transparent);
	border-right: 4px solid var(--agedd-accent);
	border-radius: var(--agedd-radius);
}
.agedd-guide__icon {
	display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
	width: 38px; height: 38px; border-radius: 11px; color: var(--agedd-accent-ink);
	background: var(--agedd-accent);
}
.agedd-guide__icon .agedd-icon { width: 20px; height: 20px; }
.agedd-guide__title { margin: 2px 0 6px; font-size: 15px; font-weight: 800; color: var(--agedd-text); }
.agedd-guide__body p { margin: 0 0 6px; font-size: 13px; line-height: 2; color: var(--agedd-text); }
.agedd-guide__body p:last-child { margin-bottom: 0; }

/* ---- تب‌ها ---- */
.agedd-tabs { background: var(--agedd-bg); border: 1px solid var(--agedd-border); border-radius: var(--agedd-radius); overflow: hidden; }
.agedd-tabs__nav { display: flex; gap: 4px; padding: 8px; background: var(--agedd-soft); border-bottom: 1px solid var(--agedd-border); overflow-x: auto; }
.agedd-tabs__btn {
	padding: 10px 20px; border: 0; border-radius: 10px; background: transparent;
	color: var(--agedd-muted); font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; transition: all .2s ease;
}
.agedd-tabs__btn:hover { color: var(--agedd-text); }
.agedd-tabs__btn.is-active { background: #fff; color: var(--agedd-c1); box-shadow: var(--agedd-shadow); }
.agedd-tabs__panel { display: none; padding: 24px; }
.agedd-tabs__panel.is-active { display: block; }
.agedd-content { line-height: 2; color: var(--agedd-text); }
.agedd-content img { max-width: 100%; height: auto; border-radius: 10px; }

.agedd-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; margin: 0; padding: 0; list-style: none; }
.agedd-features li { display: flex; align-items: flex-start; gap: 10px; line-height: 1.8; }
.agedd-features .agedd-icon {
	flex: 0 0 auto; width: 20px; height: 20px; margin-top: 4px; padding: 3px; border-radius: 50%; color: var(--agedd-accent-ink);
	background: color-mix(in srgb, var(--agedd-accent) 45%, transparent);
}

.agedd-related { margin-top: 44px; }
.agedd-related__title { margin: 0 0 18px; font-size: 20px; color: var(--agedd-text); }

/* ---------- ریسپانسیو ---------- */
@media (max-width: 1024px) {
	.agedd-cols-4 { grid-template-columns: repeat(3, 1fr); }
	.agedd-single__layout { grid-template-columns: 290px minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 820px) {
	.agedd-cols-3, .agedd-cols-4 { grid-template-columns: repeat(2, 1fr); }
	.agedd-single__layout { grid-template-columns: 1fr; }
	.agedd-single__side { position: static; max-width: 420px; width: 100%; margin: 0 auto; }
	.agedd-single__title { font-size: 21px; }
}
@media (max-width: 520px) {
	.agedd-cols-2, .agedd-cols-3, .agedd-cols-4 { grid-template-columns: 1fr; }
	.agedd-features { grid-template-columns: 1fr; }
	.agedd-tabs__panel { padding: 16px; }
	.agedd-filters select, .agedd-filters button { flex: 1 1 100%; }
	.agedd-guide { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
	.agedd-card, .agedd-icon-btn, .agedd-card__img { transition: none; }
}
