/* ===== فونت‌ها (از هدر طراحی نمونه page.html) =====
   فایل‌های woff2 داخل همین افزونه نیستند؛ برای فعال شدن فونت‌ها فایل‌های زیر را
   در مسیر assets/fonts/ همین افزونه آپلود کنید: GramophoneFa.woff2, dana-thin.woff2,
   dana-extralight.woff2, dana-light.woff2, dana-regular.woff2, dana-medium.woff2,
   dana-demibold.woff2, dana-bold.woff2, dana-extrabold.woff2, dana-ultrabold.woff2,
   dana-black.woff2. تا قبل از آپلود، مرورگر به‌صورت خودکار فونت پیش‌فرض سیستم را
   نشان می‌دهد و ظاهر صفحه خراب نمی‌شود. */
@font-face { font-family: 'GramophoneFa'; font-style: normal; font-weight: 300; src: url('../fonts/GramophoneFa.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'ultrabold';    font-style: normal; src: url('../fonts/dana-ultrabold.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'thin';         font-style: normal; src: url('../fonts/dana-thin.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'regular';      font-style: normal; src: url('../fonts/dana-regular.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'medium';       font-style: normal; src: url('../fonts/dana-medium.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'light';        font-style: normal; src: url('../fonts/dana-light.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'extralight';   font-style: normal; src: url('../fonts/dana-extralight.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'extrabold';    font-style: normal; src: url('../fonts/dana-extrabold.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'demibold';     font-style: normal; src: url('../fonts/dana-demibold.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'bold';         font-style: normal; src: url('../fonts/dana-bold.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'black';        font-style: normal; src: url('../fonts/dana-black.woff2') format('woff2'); font-display: swap; }

/* ===== متغیرهای رنگی (مطابق طرح نمونه) ===== */
.cm-course-wrap {
	font-family: 'medium', inherit;
	--cm-green: #3c9e64;
	--cm-green-dark: #2c5a2e;
	--cm-yellow: #ffd966;
	--cm-bg-light: #f3f3f3;
	--cm-text-dark: #1e2a1e;
	--cm-border-light: #d0d9c9;
	--cm-card-bg: #ffffff;
	direction: rtl;
	text-align: right;
}

/* ===== چیدمان دو ستونه ===== */
.cm-page-container {
	max-width: 1400px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 70% 28%;
	gap: 20px;
	align-items: start;
	padding: 20px 0 40px;
}
@media (max-width: 992px) {
	.cm-page-container { grid-template-columns: 1fr; }
}

/* ===== سایدبار ===== */
.cm-smart-sidebar {
	position: sticky;
	top: 30px;
	align-self: start;
	background: var(--cm-card-bg);
	border-radius: 20px;
	box-shadow: 0 15px 30px rgba(76, 121, 78, .08);
	overflow: hidden;
	border: 1px solid var(--cm-border-light);
}
.cm-sidebar-inner { padding: 24px 18px 32px; }

/* ===== محتوای اصلی ===== */
.cm-main-page {
	background: var(--cm-card-bg);
	border-radius: 20px;
	box-shadow: 0 15px 30px rgba(76, 121, 78, .06);
	padding: 32px 30px;
	border: 1px solid var(--cm-border-light);
}
@media (max-width: 768px) {
	.cm-main-page { padding: 20px; }
}

.cm-page-category {
	display: inline-block;
	background: #dbdbdb;
	color: #6c6c6c;
	font-size: .9rem;
	font-weight: 800;
	padding: 7px 12px;
	border-radius: 10px 0 0 10px;
	border-right: 5px solid var(--cm-green); font-family: 'regular'; }

.cm-page-title {
	font-size: 1.8rem;
	color: #1a3c2c;
	border-right: 5px solid var(--cm-green);
	padding-right: 18px;
	padding-top: 10px;
	margin: 10px 0 0;
	font-weight: 900; font-family: 'black'; }

.cm-featured-image img {
	width: 100%;
	border-radius: 20px;
	margin: 20px 0;
	object-fit: cover;
	max-height: 400px;
}

.cm-featured-video {
	margin: 20px 0;
}

.cm-featured-video video {
	width: 100%;
	border-radius: 20px;
	max-height: 400px;
	background: #000;
}

.hidden {
	display: none !important;
}

/* ===== نوار ورود / ثبت‌نام ===== */
.cm-auth-bar {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	margin-bottom: 14px;
	font-size: 14px;
}
.cm-link-btn {
	background: none;
	border: none;
	color: var(--cm-green);
	cursor: pointer;
	font-size: 14px;
	padding: 4px 0;
	text-decoration: underline;
	font-family: inherit;
}
.cm-auth-status { color: #444; }

/* ===== باکس‌های مزیت ===== */
.cm-benefits-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 25px;
	margin: 30px 0;
}
@media (max-width: 768px) {
	.cm-benefits-grid { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; }
	.cm-benefit-card { width: calc(48% - 8px); }
}
.cm-benefit-card {
	background: #fefcf5;
	border-radius: 24px;
	padding: 20px 15px;
	text-align: center;
	border: 1px solid var(--cm-border-light);
}
.cm-benefit-card i { font-size: 42px; color: var(--cm-green); margin-bottom: 12px; }
.cm-benefit-card h3 { font-size: 1.3rem; color: var(--cm-green); margin-bottom: 8px; }
.cm-benefit-card p { color: #4a5a44; font-size: .9rem; margin: 0; }

/* ===== محتوای متنی ===== */
.cm-main-page p,
.cm-main-page ul,
.cm-main-page ol { line-height: 1.9; color: #333; }

/* ===== جدول مشخصات دوره ===== */
.cm-extra-fields-table {
	width: 100%;
	border-collapse: collapse;
	margin: 30px 0;
	background: #fff;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 5px 15px rgba(0,0,0,.03);
}
.cm-extra-fields-table tr { border-bottom: 1px solid var(--cm-border-light); background-color: #fefcf7; }
.cm-extra-fields-table tr:nth-child(even) { background-color: #f9faf5; }
.cm-extra-fields-table th {
	text-align: right;
	padding: 14px 20px;
	font-weight: 700;
	color: var(--cm-green);
	width: 30%;
	border-left: 1px solid var(--cm-border-light);
}
.cm-extra-fields-table td { padding: 14px 20px; color: var(--cm-text-dark); }

/* ===== عنوان بخش‌ها ===== */
.cm-section-title {
	font-size: 1.6rem;
	margin: 35px 0 20px;
	color: var(--cm-green);
	border-bottom: 2px solid var(--cm-green);
	display: inline-block;
	padding-bottom: 5px;
}

/* ===== بخش «توضیحات بیشتر» (متن آزاد از ویرایشگر وردپرس) ===== */
.cm-extra-section { margin: 20px 0; }
.cm-extra-content { color: var(--cm-text-dark); line-height: 2; }
.cm-extra-content p { margin: 0 0 16px; }
.cm-extra-content ul, .cm-extra-content ol { margin: 0 0 16px; padding-inline-start: 24px; }
.cm-extra-content img { max-width: 100%; height: auto; border-radius: 8px; }
.cm-extra-content a { color: var(--cm-green); }

/* ===== سرفصل‌های دوره ===== */
.cm-course-topics-section { background: #ddd; border-radius: 20px; padding: 35px 30px; margin: 40px 0 20px; }
.cm-course-topics-section h2 {
	color: var(--cm-green);
	font-size: 1.8rem;
	margin: 0 0 30px;
	padding-right: 15px;
	border-right: 4px solid var(--cm-green);
	font-weight: 900; font-family: 'black'; }
.cm-topics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 768px) {
	.cm-course-topics-section { padding: 25px 20px; }
	.cm-course-topics-section h2 { font-size: 1.4rem; }
	.cm-topics-grid { grid-template-columns: 1fr; gap: 15px; }
}
.cm-topic-item {
	background: #fff;
	border-radius: 16px;
	padding: 18px 20px;
	display: flex;
	align-items: center;
	gap: 15px;
	border: 1px solid #e0e0e0;
	box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.cm-topic-number {
	background: var(--cm-green);
	color: #fff;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2rem;
	font-weight: bold;
	flex-shrink: 0; font-family: 'bold'; }
.cm-topic-content { flex: 1; }
.cm-topic-title { font-size: 1rem; font-weight: bold; color: #1a3c2c; margin-bottom: 5px; font-family: 'bold'; }
.cm-topic-desc { font-size: .8rem; color: #666; line-height: 1.4; }
.cm-topic-icon { color: var(--cm-green); font-size: 1.2rem; flex-shrink: 0; }

/* ===== کادر «آیا درباره دوره سوالی دارید؟» ===== */
.cm-ask-question-box {
	background: #f1f1f1;
	border-radius: 20px;
	padding: 25px;
	text-align: center;
	margin: 30px 0;
	border: 1px solid #ddd;
}
.cm-ask-question-box h3 { margin-top: 0; }
.cm-ask-question-box textarea,
.cm-ask-question-box input[type="email"] {
	width: 98%;
	padding: 12px;
	border-radius: 10px;
	border: 1px solid var(--cm-border-light);
	margin-top: 12px;
	background: #fff;
	font-family: inherit;
	box-sizing: border-box;
}
@media (max-width: 768px) {
	.cm-ask-question-box textarea,
	.cm-ask-question-box input[type="email"] { width: 90%; }
}
.cm-btn-submit {
	background: var(--cm-green);
	color: #fff;
	border: none;
	padding: 10px 25px;
	border-radius: 10px;
	margin-top: 12px;
	cursor: pointer;
	font-weight: bold;
	width: 100%;
	font-family: inherit;
}
.cm-btn-submit:hover { background: #3a613c; }
.cm-question-result { margin-top: 10px; font-size: 14px; }

/* ===== اعتراضات رایج ===== */
.cm-objections-wrapper { background: #ebebeb; border-radius: 24px; padding: 20px; margin: 30px 0; }
.cm-objection-item {
	padding: 12px 0;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	border-bottom: 1px solid #ccd6be;
}
.cm-objection-item:last-child { border-bottom: none; }
.cm-objection-item i { font-size: 24px; color: var(--cm-green); margin-top: 4px; }
.cm-objection-item strong { color: var(--cm-green-dark); }

/* ===== باکس دریافتی‌های دوره ===== */
.cm-receive-box { margin: 30px 0; }
.cm-receive-box h3 {
	font-size: 1.8rem;
	color: var(--cm-green);
	margin-bottom: 25px;
	border-right: 4px solid var(--cm-green);
	padding-right: 15px;
	font-weight: 900; font-family: 'black'; }
.cm-receive-grid { display: flex; flex-wrap: wrap; gap: 24px; }
.cm-receive-card {
	background: #fff;
	border-radius: 20px;
	padding: 25px 20px;
	text-align: center;
	box-shadow: 0 8px 20px rgba(0,0,0,.06);
	border: 1px solid var(--cm-border-light);
	width: calc(28.333% - 14px);
}
.cm-receive-card:hover { border-color: var(--cm-green); }
.cm-receive-card i { font-size: 42px; color: var(--cm-green); margin-bottom: 15px; }
.cm-receive-card h4 { font-size: 1.1rem; color: var(--cm-text-dark); margin-bottom: 10px; font-weight: bold; font-family: 'bold'; }
.cm-receive-card p { font-size: .85rem; color: #666; line-height: 1.5; margin: 0; font-family: 'regular'; }
@media (max-width: 768px) {
	.cm-receive-grid { gap: 20px; justify-content: center; }
	.cm-receive-card { width: calc(45% - 10px); padding: 20px 15px; }
	.cm-receive-box h3 { font-size: 1.4rem; }
}
@media (max-width: 480px) {
	.cm-receive-card { width: 100%; }
}

/* ===== سوالات متداول ===== */
.cm-faq-item {
	background: #f1f1f1;
	margin-bottom: 15px;
	border-radius: 16px;
	padding: 18px;
	border-right: 4px solid var(--cm-green);
}
.cm-faq-question {
	font-size: 1rem;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	color: var(--cm-text-dark);
	font-weight: bold; font-family: 'bold'; }
.cm-faq-answer { display: none; margin-top: 12px; color: #4a5a44; border-top: 1px dashed var(--cm-border-light); padding-top: 10px; }
.cm-faq-item.open .cm-faq-answer { display: block; }

/* ===== نظرات دانش‌پذیران ===== */
.cm-testimonials-box { background: #f9faf5; border-radius: 20px; padding: 20px; margin-top: 10px; }
.cm-testimonials-box p { margin: 0; line-height: 1.8; }
.cm-testimonials-box i { color: var(--cm-green); margin-left: 6px; }
.cm-testimonials-box hr { margin: 15px 0; border: none; border-top: 1px solid var(--cm-border-light); }

/* ===== کارت مشخصات دوره در سایدبار ===== */
.cm-course-spec-card {
	background: #fff;
	border-radius: 20px;
	padding: 20px;
	box-shadow: 0 8px 20px rgba(0,0,0,.04);
	border: 1px solid var(--cm-border-light);
}
.cm-course-spec-card h3 {
	color: var(--cm-green);
	border-right: 3px solid var(--cm-green);
	padding-right: 12px;
	margin: 0 0 20px;
	font-size: 1.4rem; font-family: 'regular'; }
.cm-spec-list { list-style: none; padding: 0; margin: 0; }
.cm-spec-list li {
	display: flex;
	gap: 5px;
	margin-bottom: 14px;
	align-items: center;
	border-bottom: 1px solid #ddd;
	padding-bottom: 8px;
	font-size: 14px;
}
.cm-spec-list li i { width: 28px; color: var(--cm-green); text-align: center; }

.cm-price-box { font-size: 25px; font-weight: bold; color: var(--cm-green); margin: 15px 0; text-align: center; font-family: 'black'; }
.cm-old-price { text-decoration: line-through; color: #f00; font-size: 16px; margin-left: 10px; font-weight: normal; font-family: 'medium'; }

.cm-btn-add-to-cart {
	background: var(--cm-green);
	color: #fff;
	width: 100%;
	padding: 14px;
	border: none;
	border-radius: 10px;
	font-size: 1.1rem;
	font-weight: bold;
	cursor: pointer;
	margin-bottom: 12px;
	box-sizing: border-box;
	font-family: 'medium';
}
.cm-btn-add-to-cart:hover { background: #38bb3f; }
.cm-btn-outline {
	background: transparent;
	color: var(--cm-green);
	width: 100%;
	padding: 14px;
	border: 1px solid var(--cm-green);
	border-radius: 10px;
	font-size: 1rem;
	font-weight: bold;
	cursor: pointer;
	margin-bottom: 12px;
	box-sizing: border-box;
	font-family: inherit;
}
.cm-btn-outline:hover { background: #f0f6f2; }

.cm-gift-box {
	border-radius: 20px 20px 0 0;
	padding: 15px;
	display: flex;
	align-items: center;
	gap: 12px;
	border: 2px dashed var(--cm-green);
	margin: 15px 0 0;
	position: relative;
	background: repeating-linear-gradient(to bottom, var(--cm-yellow), var(--cm-yellow) 2px, var(--cm-green) 2px, var(--cm-green) 2px);
	border-bottom: none;
}
.cm-gift-box::before {
	content: '';
	position: absolute;
	bottom: 0; right: 0; left: 0;
	height: 2px;
	background: repeating-linear-gradient(to right, var(--cm-yellow), var(--cm-yellow) 8px, var(--cm-green) 8px, var(--cm-green) 16px);
	pointer-events: none;
}
.cm-gift-box i { font-size: 32px; color: var(--cm-green); }
.cm-gift-box div { font-size: 13px; }

/* ===== نوتیفیکیشن نتیجه پرداخت ===== */
.cm-notice { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; max-width: 1400px; margin-left: auto; margin-right: auto; }
.cm-notice-success { background: #eafaf0; color: #1e7e34; border: 1px solid #b7e6c6; }
.cm-notice-error { background: #fdecec; color: #b02a2a; border: 1px solid #f3c1c1; }

/* ===== منوی ثابت موبایل ===== */
.cm-mobile-bottom-bar {
	position: fixed;
	bottom: 0; left: 0; right: 0;
	background: rgba(255,255,255,.98);
	backdrop-filter: blur(12px);
	box-shadow: 0 -5px 25px rgba(0,0,0,.1);
	border-top: 1px solid #d0d9c9;
	padding: 12px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	z-index: 99999;
	transform: translateY(100%);
	transition: transform .35s cubic-bezier(.2,.9,.4,1.1);
	direction: rtl;
}
.cm-mobile-bottom-bar.show { transform: translateY(0); }
.cm-mobile-price { font-size: 1.3rem; font-weight: 800; color: var(--cm-green); }
.cm-mobile-oldprice { font-size: .85rem; text-decoration: line-through; color: #999; margin-right: 6px; }
.cm-mobile-cart-btn {
	background: var(--cm-green);
	color: #fff;
	border: none;
	padding: 10px 24px;
	border-radius: 40px;
	font-weight: bold;
	font-size: 1rem;
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}
@media (min-width: 769px) {
	.cm-mobile-bottom-bar { display: none !important; }
}

/* ===== مودال‌ها (ثبت‌نام دوره / ورود و ثبت‌نام کاربر) ===== */
.cm-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.55);
	z-index: 100000;
	align-items: center;
	justify-content: center;
}
.cm-modal-overlay.active { display: flex; }
.cm-modal {
	background: #fff;
	max-width: 420px;
	width: 92%;
	border-radius: 16px;
	padding: 28px 24px;
	position: relative;
	direction: rtl;
	max-height: 88vh;
	overflow-y: auto;
}
.cm-modal-close {
	position: absolute;
	top: 10px;
	left: 14px;
	background: none;
	border: none;
	font-size: 26px;
	cursor: pointer;
	color: #888;
}
.cm-modal h3 { margin-top: 0; color: var(--cm-green, #1a3c2c); }
.cm-modal-price { margin-bottom: 18px; }
.cm-registration-form p,
.cm-receipt-form p,
.cm-auth-panel form p { margin-bottom: 14px; }
.cm-registration-form label,
.cm-receipt-form label,
.cm-auth-panel label { display: block; margin-bottom: 6px; font-size: 14px; }
.cm-registration-form input,
.cm-receipt-form input,
.cm-auth-panel input {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	box-sizing: border-box;
	font-family: inherit;
}
.cm-payment-methods { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.cm-card-info { background: #f7f8fa; border-radius: 8px; padding: 14px; margin-bottom: 16px; }
.cm-card-info p { margin: 4px 0; }
.cm-form-error, .cm-payment-error, .cm-receipt-error, .cm-auth-error { color: #b02a2a; font-size: 13px; }
.cm-done-message, .cm-auth-success { text-align: center; padding: 20px 0; font-size: 16px; }

.cm-auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.cm-auth-tab {
	flex: 1;
	background: #f0f2f5;
	border: none;
	padding: 10px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-family: inherit;
}
.cm-auth-tab.active { background: var(--cm-green, #3c9e64); color: #fff; }
.cm-verify-email { color: var(--cm-green, #3c9e64); }

/* ===== متاباکس‌های تکرارشونده در ادمین ===== */
.cm-repeater-row {
	border: 1px solid #ddd;
	padding: 12px;
	border-radius: 6px;
	margin-bottom: 12px;
	background: #fafafa;
}
.cm-repeater-field { margin-bottom: 8px; }
.cm-repeater-field label { display: block; font-size: 12px; color: #555; margin-bottom: 3px; }
.cm-repeater-row input[type="text"],
.cm-repeater-row textarea { display: block; width: 100%; box-sizing: border-box; }

/* ===== هدر: زمینه موقعیت‌دهی برای عناصر فرزند (نوار ثابت هنگام اسکرول و ...) ===== */
#mainHeader.header {
	position: relative;
}

/* ===== هدر دسکتاپ: با اسکرول فقط نوار منو (main-nav) بالای صفحه ثابت بماند ===== */
@media (min-width: 769px) {
	#mainHeader.cm-header-scrolled .top-bar,
	#mainHeader.cm-header-scrolled .middle-bar {
		display: none;
	}
	#mainHeader.cm-header-scrolled .main-nav {
		position: fixed;
		top: 0;
		right: 0;
		left: 0;
		z-index: 9999;
		background: #fff;
		box-shadow: 0 4px 16px rgba(0, 0, 0, .1);
	}
	body.cm-header-fixed-space {
		padding-top: var(--cm-nav-height, 60px);
	}
}
