/* Afra CRO & SEO Fixes 1.1
   هماهنگ با قالب afra-tm: کارت‌ها ۲۰px، دکمه‌ها ۱۰px، رنگ‌های primary قالب، فونت YekanBakh.
   یک رنگ اکشن: primary-70. بدون نوار رنگی کناری، بدون کارت داخل کارت. */
:root {
	--afra-ink: #171725;
	--afra-text: #44444f;
	--afra-muted: #696974;
	--afra-brand: #2c6e5f;
	--afra-brand-deep: #1e4c42;
	--afra-brand-soft: #ebf7f4;
	--afra-brand-line: #d3ebe4;
	--afra-on-brand: #ebf7f4;
	--afra-surface: #ffffff;
	--afra-up: #1d7a4f;
	--afra-down: #b42318;
	--afra-focus: #1e4c42;
	--afra-shadow: 0 18px 40px -22px rgba(20, 60, 51, .55);
	--afra-ease: cubic-bezier(.16, 1, .3, 1);
}
html.dark {
	--afra-ink: #f1f1f5;
	--afra-text: #e2e2ea;
	--afra-muted: #afb1b6;
	--afra-brand-soft: #1d2b28;
	--afra-brand-line: #2c3f3a;
	--afra-surface: #1c1c24;
	--afra-up: #5fd39b;
	--afra-down: #ff8a7f;
	--afra-focus: #a9dbd0;
	--afra-shadow: 0 18px 40px -22px rgba(0, 0, 0, .8);
}

::selection { background: #a9dbd0; color: #171725; }

/* نام‌های لاتین با رقم لاتین (فونت FaNum قالب، رقم 20 را فارسی می‌کند) */
.afra-en { font-family: YekanBakhStandard, YekanBakh, Tahoma, sans-serif; unicode-bidi: isolate; }
.afra-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- دکمه‌ها (شعاع ۱۰ مثل rounded-10 قالب) ---------- */
.afra-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 22px; border-radius: 10px; border: 0;
	font-weight: 700; font-size: 15px; line-height: 1; white-space: nowrap;
	text-decoration: none !important;
	transition: transform .2s var(--afra-ease), background-color .2s var(--afra-ease), box-shadow .2s var(--afra-ease);
}
.afra-btn:active { transform: translateY(1px) scale(.985); }
.afra-btn--primary { background: var(--afra-brand); color: #fff !important; box-shadow: 0 8px 18px -10px rgba(44, 110, 95, .9); }
.afra-btn--primary:hover { background: var(--afra-brand-deep); }
.afra-btn--sm { min-height: 44px; min-width: 64px; padding: 0 16px; font-size: 14px; background: var(--afra-brand); color: #fff !important; }
.afra-btn--sm:hover { background: var(--afra-brand-deep); }
.afra-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--afra-brand) !important; font-weight: 600; text-decoration: underline !important; text-underline-offset: 5px; text-decoration-thickness: 1px; border: 0 !important; }
html.dark .afra-link { color: #a9dbd0 !important; }

/* ---------- تغییر ۲۴ ساعته ---------- */
.afra-chg { font-size: 13px; font-weight: 600; white-space: nowrap; }
.afra-chg--up { color: var(--afra-up); }
.afra-chg--down { color: var(--afra-down); }
.afra-chg--flat { color: var(--afra-muted); }

/* ---------- پیشنهاد وسط مقاله (جایگزین بنر قدیمی قالب) ---------- */
.the-content .afra-offer, .afra-offer {
	display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 28px; align-items: center;
	margin: 32px 0 !important; padding: 24px 26px; border-radius: 20px;
	background: var(--afra-brand-soft); text-align: right;
}
.afra-offer__title { margin: 0 0 6px !important; font-size: 18px; font-weight: 700; color: var(--afra-ink); line-height: 1.7; text-wrap: balance; }
.afra-offer__text { margin: 0 !important; font-size: 14.5px; color: var(--afra-muted); line-height: 1.95; }
.afra-quote { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 12px 0 0 !important; padding-top: 12px; border-top: 1px solid var(--afra-brand-line); font-size: 14px; color: var(--afra-text); }
.afra-quote__name { color: var(--afra-ink) !important; font-weight: 600; text-decoration: none !important; border: 0 !important; }
.afra-quote__name:hover { text-decoration: underline !important; text-underline-offset: 4px; }
.afra-quote__price b { font-size: 16px; color: var(--afra-ink); font-variant-numeric: tabular-nums; }
@media (max-width: 767px) {
	.the-content .afra-offer, .afra-offer { grid-template-columns: minmax(0, 1fr); padding: 20px 18px; }
	.afra-offer .afra-btn { width: 100%; }
}

/* بنرهای قدیمی که به لینک متنی تبدیل شدند */
.the-content .afra-inline-link { margin: 18px 0 !important; padding-inline-start: 14px; border-inline-start: 1px solid var(--afra-brand-line); }
.the-content .afra-inline-link a { font-weight: 600; color: var(--afra-brand) !important; }
html.dark .the-content .afra-inline-link a { color: #a9dbd0 !important; }

/* ---------- گام بعد (پایان مقاله) ---------- */
.afra-next {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
	margin: 36px 0 0 !important; padding: 20px 0 4px; border-top: 1px solid var(--afra-brand-line);
}
.afra-next__text { margin: 0 !important; font-size: 15px; color: var(--afra-text); flex: 1 1 280px; }
.afra-next__actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* ---------- مطالب مرتبط ---------- */
.afra-related { margin: 28px 0 0; }
.afra-related__title { margin: 0 0 6px !important; font-weight: 700; font-size: 17px !important; color: var(--afra-ink); }
.afra-related ul { list-style: none; margin: 0 !important; padding: 0 !important; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.afra-related li { margin: 0 !important; border-bottom: 1px solid var(--afra-brand-line); }
.afra-related a { display: block; padding: 12px 0; color: var(--afra-brand) !important; font-weight: 500; line-height: 1.8; text-decoration: none !important; border: 0 !important; }
.afra-related a:hover { color: var(--afra-brand-deep) !important; }
html.dark .afra-related a { color: #a9dbd0 !important; }
@media (max-width: 767px) { .afra-related ul { grid-template-columns: 1fr; } }

/* ---------- خط به‌روزرسانی ---------- */
.afra-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 10px !important; font-size: 13px; color: var(--afra-muted); }
.afra-meta span + span { padding-inline-start: 12px; border-inline-start: 1px solid var(--afra-brand-line); }
.afra-meta a { color: var(--afra-muted) !important; text-decoration: underline !important; text-underline-offset: 4px; border: 0 !important; }

/* ---------- جدول قیمت ---------- */
.afra-prices { background: var(--afra-surface); color: var(--afra-ink); border-radius: 20px; padding: 18px 20px 14px; box-shadow: var(--afra-shadow); direction: rtl; }
.afra-prices__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.afra-prices__title { margin: 0 !important; font-size: 17px !important; font-weight: 700; color: var(--afra-ink); }
.afra-prices__time { font-size: 12.5px; color: var(--afra-muted); }
.afra-prices__table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.afra-prices__table th, .afra-prices__table td { padding: 8px 4px; text-align: right; vertical-align: middle; }
.afra-prices__table thead th { font-size: 12.5px; font-weight: 500; color: var(--afra-muted); padding-top: 4px; padding-bottom: 6px; }
.afra-prices__table tbody tr + tr th, .afra-prices__table tbody tr + tr td { border-top: 1px solid var(--afra-brand-line); }
.afra-prices__table tbody th { font-weight: 600; font-size: 14.5px; }
.afra-prices__table tbody th a { color: var(--afra-ink) !important; text-decoration: none !important; border: 0 !important; }
.afra-prices__table tbody th a:hover { color: var(--afra-brand) !important; }
.afra-prices__table tbody th .afra-en { display: inline-block; margin-inline-start: 4px; font-size: 12px; font-weight: 500; color: var(--afra-muted); }
.afra-prices__table td.afra-num { font-weight: 700; font-size: 15px; }
.afra-prices__table td:last-child { text-align: left; width: 1%; }
.afra-prices__more { display: inline-flex; min-height: 44px; align-items: center; margin-top: 2px; font-size: 14px; font-weight: 600; color: var(--afra-brand) !important; text-decoration: underline !important; text-underline-offset: 5px; border: 0 !important; }
html.dark .afra-prices__more, html.dark .afra-prices__table tbody th a:hover { color: #a9dbd0 !important; }
@media (max-width: 480px) {
	.afra-prices { padding: 14px 14px 10px; }
	.afra-prices__table thead th:nth-child(3), .afra-prices__table td:nth-child(3) { display: none; }
	.afra-prices__table tbody th .afra-en { display: none; }
}

/* هیرو صفحهٔ اصلی */
.afra-trust { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; margin: 14px 0 0 !important; padding: 0 !important; color: var(--afra-on-brand); font-size: 14px; }
.afra-trust li { display: inline-flex; align-items: center; gap: 8px; margin: 0 !important; }
.afra-trust li::before { content: ""; width: 6px; height: 11px; margin-top: -3px; border: solid #a9dbd0; border-width: 0 2px 2px 0; transform: rotate(45deg); flex: none; }
.afra-hero-prices { margin: 28px 0 36px; max-width: 560px; }
body.afra-has-hero-prices .section-1 img[src*="hand-iphone"] { display: none !important; }
@media (min-width: 1180px) {
	.afra-hero-prices {
		position: absolute; z-index: 2; margin: 0; width: 440px; top: 50%; transform: translateY(-46%);
		left: max(24px, calc((100vw - 1280px) / 2 + 24px));
	}
}

/* صفحهٔ «قیمت ارز دیجیتال» */
.afra-archive-prices { padding-top: 40px; }
.afra-archive-prices .afra-prices { box-shadow: none; border: 1px solid var(--afra-brand-line); max-width: 920px; margin-inline: auto; }

/* ---------- باکس خرید صفحات قیمت ---------- */
.afra-coin-top { padding-top: 32px; }
.afra-buybox {
	display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: center;
	padding: 24px 28px; border-radius: 20px; background: var(--afra-surface); box-shadow: var(--afra-shadow); text-align: right;
}
.afra-buybox__title { margin: 0 0 4px !important; font-size: 17px !important; font-weight: 600; color: var(--afra-muted); }
.afra-buybox__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 !important; font-size: 15px; color: var(--afra-text); }
.afra-buybox__price b { font-size: clamp(26px, 4vw, 34px); line-height: 1.3; color: var(--afra-ink); font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.afra-buybox__meta { margin: 4px 0 0 !important; font-size: 12.5px; color: var(--afra-muted); }
.afra-buybox__actions { display: grid; justify-items: start; gap: 2px; }
.afra-buybox__steps { margin: 4px 0 0 !important; font-size: 12.5px; color: var(--afra-muted); }
@media (max-width: 767px) {
	.afra-coin-top { padding-top: 20px; }
	.afra-buybox { grid-template-columns: minmax(0, 1fr); padding: 20px 18px; }
	.afra-buybox__actions { justify-items: stretch; }
	.afra-buybox__actions .afra-btn { width: 100%; white-space: normal; text-align: center; }
	.afra-buybox__actions .afra-link { justify-content: center; }
}

/* ---------- منوی پایین موبایل ---------- */
#sticky-menu .icon-buy a {
	position: relative; top: -30px; display: flex; align-items: center; justify-content: center;
	width: 65px; height: 65px; margin: auto; padding: 0; border-radius: 9999px;
	background: var(--neutral-0, #fff) none; color: var(--afra-brand) !important;
	font-size: 15px; font-weight: 800; outline: 4px solid var(--afra-brand); outline-offset: -8px;
	box-shadow: 0 8px 16px -8px rgba(0, 0, 0, .35);
}
#sticky-menu .icon-buy a:hover { background-color: var(--afra-brand-soft); }
#sticky-menu .icon-house a { background-image: url(/wp-content/themes/afra-tm/theme/images/icon-home.png); background-size: 22px; filter: brightness(0) invert(1); }

/* ---------- نوار چسبان (پیش‌فرض خاموش) ---------- */
.afra-sticky {
	position: fixed; inset-inline: 0; bottom: calc(67px + env(safe-area-inset-bottom)); z-index: 9;
	display: flex; align-items: center; gap: 12px; padding: 8px 12px; padding-inline-start: 16px;
	background: var(--afra-surface); border-radius: 14px 14px 0 0; box-shadow: 0 -10px 24px -16px rgba(23, 23, 37, .45);
	transform: translateY(120%); opacity: 0; pointer-events: none;
	transition: transform .32s var(--afra-ease), opacity .2s var(--afra-ease);
}
.afra-sticky.is-visible { transform: none; opacity: 1; pointer-events: auto; }
.afra-sticky__note { flex: 1; font-size: 13px; color: var(--afra-muted); }
.afra-sticky__close { width: 44px; height: 44px; border: 0; background: none; color: var(--afra-muted); font-size: 22px; line-height: 1; cursor: pointer; border-radius: 10px; }

/* ---------- خوانایی و دسترس‌پذیری قالب ---------- */
@media (max-width: 767px) {
	.the-content, .text-justify { text-align: right !important; }
}
.the-content { line-height: 2.05 !important; }
.the-content h2 { margin-top: 2.2em !important; scroll-margin-top: 96px; }
.the-content a:not(.afra-btn):not(.afra-link):not(.afra-related a):not(.afra-quote__name):not(.call-action a) { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.text-justify { text-wrap: pretty; }
#commentform textarea, .comment-form textarea, .comment-form input { max-width: 100%; box-sizing: border-box; }

/* دکمه‌های سبز روشن قالب (کنتراست ۲.۶) */
a.bg-primary-50, button.bg-primary-50 { background-color: var(--afra-brand) !important; }
a.bg-primary-50:hover, button.bg-primary-50:hover { background-color: var(--afra-brand-deep) !important; }
html:not(.dark) .bg-neutral-0 .text-primary-50, html:not(.dark) .bg-neutral-10 .text-primary-50, html:not(.dark) button.text-primary-50 { color: var(--afra-brand) !important; }

/* حلقهٔ فوکوس: کنتراست ≥۳ روی زمینهٔ روشن و سبز، بدون تغییر شکل دکمه */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
	outline: 3px solid var(--afra-focus) !important; outline-offset: 2px;
}
.section-1 :focus-visible, header :focus-visible, footer :focus-visible, #sticky-menu :focus-visible, .bg-primary-70 :focus-visible { outline-color: #fff !important; }

/* بلوب بخش دعوت → گرادیان برند */
.section-11 img[style*="3023ae"] { background: linear-gradient(160deg, #46b199 0%, #1e4c42 100%) !important; }

@media (max-width: 767px) {
	.footer-menu a { display: inline-block; padding: 10px 0; }
}

/* فیلد موبایل هیرو */
#mobileInput, #mobileForm { direction: ltr; text-align: right; font-size: 16px; letter-spacing: .5px; }
#mobileInput::placeholder, #mobileForm::placeholder { direction: rtl; }

@media (prefers-reduced-motion: reduce) {
	.afra-sticky, .afra-btn { transition: none; }
}

/* ---------- 1.2: حالت «قیمت تتر مخفی» ---------- */
.afra-gate {
	display: inline-flex; align-items: center; gap: 6px;
	min-height: 32px; padding: 4px 12px;
	border-radius: 999px;
	background: var(--afra-brand-soft); color: var(--afra-brand-deep);
	font-size: 13px; font-weight: 600; line-height: 1.4;
	text-decoration: none; white-space: nowrap;
	transition: background-color .2s cubic-bezier(.16,1,.3,1);
}
.afra-gate::before {
	content: ""; width: 12px; height: 12px; flex: none;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
}
a.afra-gate:hover { background: #d9efe9; }
.afra-gate--inline { min-height: 0; padding: 2px 10px; font-size: 12px; }
html.dark .afra-gate { background: rgba(44,110,95,.22); color: #bfe6dc; }
.afra-row--gated td.afra-num { text-align: start; }
.afra-quote--gated .afra-quote__price { color: var(--afra-brand-deep); font-weight: 600; font-size: 13px; }
.afra-buybox__gate { margin: 8px 0 0; font-size: 15px; line-height: 1.9; max-width: 46ch; }
html.dark .afra-buybox__gate { color: #e4ece9; }
