/* استایل اختصاصی صفحه اصلی (فقط در صفحه اصلی بارگذاری می‌شود) */
.af-home-wrap { padding-top: 18px; }
.af-section { margin-top: 28px; }

/* اسلایدر اصلی و بنر کناری */
.af-hero-grid { display: grid; grid-template-columns: 2.35fr 1fr; gap: 16px; align-items: stretch; }
.af-hero-grid.af-hero-full { grid-template-columns: 1fr; }
.af-hero-slider { position: relative; border-radius: var(--af-radius); overflow: hidden; background: #fff; box-shadow: var(--af-shadow); min-height: 280px; }
.af-slides-track { position: relative; width: 100%; height: 100%; display: grid; }
.af-slide {
	grid-area: 1 / 1;
	width: 100%;
	height: 100%;
	opacity: 0;
	visibility: hidden;
	transform: scale(1.035);
	transition: opacity .65s cubic-bezier(.4, 0, .2, 1), transform .9s cubic-bezier(.22, 1, .36, 1), visibility .65s;
	z-index: 1;
	pointer-events: none;
}
.af-slide.is-active {
	opacity: 1;
	visibility: visible;
	transform: scale(1);
	z-index: 2;
	pointer-events: auto;
}
.af-slide img { width: 100%; height: 100%; object-fit: cover; max-height: 440px; }
@keyframes afFade { from { opacity: .3; } to { opacity: 1; } }
.af-hero-fallback {
	background: linear-gradient(135deg, #28510e 0%, #5fad35 100%); color: #fff;
	padding: 52px 38px; min-height: 340px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 12px;
}
.af-badge-pill { background: rgba(255,255,255,.18); padding: 4px 12px; border-radius: 99px; font-size: 12.5px; }
.af-hero-fallback h1 { margin: 0; font-size: 30px; }
.af-hero-fallback p { margin: 0; max-width: 560px; opacity: .94; }
.af-slider-arrow {
	position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
	border-radius: 50%; border: none; background: rgba(255,255,255,.9); color: var(--af-text);
	font-size: 22px; cursor: pointer; z-index: 4; display: grid; place-items: center;
}
.af-slider-arrow.af-prev { right: 12px; }
.af-slider-arrow.af-next { left: 12px; }
.af-slider-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 4; }
.af-slider-dots button { width: 9px; height: 9px; border-radius: 99px; border: none; background: rgba(255,255,255,.6); cursor: pointer; padding: 0; transition: width .2s; }
.af-slider-dots button.is-active { width: 24px; background: #fff; }
.af-hero-side .af-banner-card { height: 100%; }
.af-banner-card { display: block; border-radius: var(--af-radius); overflow: hidden; box-shadow: var(--af-shadow); }
.af-banner-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.af-banner-card:hover img { transform: scale(1.02); }

/* ۴ باکس سریع */
.af-quick-boxes-sec { margin-top: 18px; }
.af-quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.af-quick-card {
	background: #fff; border: 1px solid var(--af-border); border-radius: var(--af-radius);
	padding: 14px 16px; display: flex; align-items: center; gap: 12px; color: var(--af-text); transition: all .2s;
}
.af-quick-card:hover { border-color: var(--af-primary); transform: translateY(-2px); box-shadow: var(--af-shadow); }
.af-quick-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--af-primary-soft); display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.af-quick-card strong { display: block; font-size: 14px; }
.af-quick-card small { color: var(--af-muted); font-size: 12px; }
.af-quick-img { width: 100%; border-radius: 10px; }

/* بنرهای منعطف ۱، ۲ و ۴ ستونه */
.af-banners-grid { display: grid; gap: 16px; }
.af-banners-grid.af-cols-1 { grid-template-columns: 1fr; }
.af-banners-grid.af-cols-2 { grid-template-columns: repeat(2, 1fr); }
.af-banners-grid.af-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* کاروسل کتاب‌ها */
.af-carousel-box { background: #fff; border: 1px solid var(--af-border); border-radius: var(--af-radius); padding: 18px; }
.af-special-sec .af-carousel-box { background: linear-gradient(135deg, #ef394e 0%, #d32f2f 100%); border: none; }
.af-special-sec .af-sec-head h2, .af-special-sec .af-view-all { color: #fff; }
.af-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.af-sec-head h2 { margin: 0; font-size: 18px; color: var(--af-primary-dark); position: relative; padding-right: 12px; }
.af-sec-head h2::before { content: ''; position: absolute; right: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 4px; background: var(--af-primary); }
.af-special-sec .af-sec-head h2::before { background: #fff; }
.af-sec-controls { display: flex; align-items: center; gap: 12px; }
.af-view-all { font-size: 13.5px; font-weight: 700; color: var(--af-primary); }
.af-carousel-nav { display: flex; gap: 6px; }
.af-c-btn {
	width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--af-border);
	background: #fff; cursor: pointer; font-size: 18px; display: grid; place-items: center;
}
.af-carousel-track {
	display: grid; grid-auto-flow: column; grid-auto-columns: calc(20% - 12px); gap: 14px;
	overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px;
}
.af-carousel-track::-webkit-scrollbar { display: none; }
.af-carousel-track .af-book-card { scroll-snap-align: start; }

/* دسته‌بندی کتاب‌ها */
.af-cats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 14px; }
.af-cat-card {
	background: #fff; border: 1px solid var(--af-border); border-radius: var(--af-radius);
	padding: 16px 12px; text-align: center; transition: all .2s;
}
.af-cat-card:hover { border-color: var(--af-primary); transform: translateY(-3px); box-shadow: var(--af-shadow); }
.af-cat-thumb { width: 68px; height: 68px; margin: 0 auto 10px; border-radius: 50%; background: var(--af-primary-soft); display: grid; place-items: center; overflow: hidden; }
.af-cat-fallback-ico { font-size: 30px; }
.af-cat-card strong { display: block; font-size: 13.5px; color: var(--af-text); }
.af-cat-card small { color: var(--af-muted); font-size: 12px; }

@media (max-width: 1024px) {
	.af-hero-grid { grid-template-columns: 1fr; }
	.af-carousel-track { grid-auto-columns: calc(33.33% - 10px); }
	.af-quick-grid, .af-banners-grid.af-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
	.af-carousel-track { grid-auto-columns: calc(56% - 8px); }
	.af-banners-grid.af-cols-2 { grid-template-columns: 1fr; }
}

/* ارتقای زیبایی عنوان ردیف‌ها، بنر ۳ ستونه و اسلایدر دسته‌بندی کتاب‌ها در نسخه ۱.۸ */
.af-banners-grid.af-cols-3 { grid-template-columns: repeat(3, 1fr); }
.af-head-modern { padding-bottom: 14px; border-bottom: 1.5px solid #f1f5f9; margin-bottom: 18px; }
.af-special-sec .af-head-modern { border-bottom-color: rgba(255,255,255,.22); }
.af-sec-title-wrap h2 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.af-sec-sub { margin: 4px 12px 0 0; font-size: 12.8px; color: var(--af-muted); }
.af-special-sec .af-sec-sub { color: rgba(255,255,255,.88); }
.af-c-btn {
	width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid #e2e8f0;
	background: #fff; color: var(--af-text); font-weight: 800; transition: all .18s;
}
.af-c-btn:hover { background: var(--af-primary); color: #fff; border-color: var(--af-primary); }
.af-cats-track {
	display: grid; grid-auto-flow: column; grid-auto-columns: minmax(140px, calc(16.66% - 12px));
	gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 4px 2px 8px;
}
.af-cats-track::-webkit-scrollbar { display: none; }
.af-cats-track .af-cat-card { scroll-snap-align: start; }
@media (max-width: 768px) {
	.af-banners-grid.af-cols-3 { grid-template-columns: 1fr; }
	.af-cats-track { grid-auto-columns: 132px; }
}

/* نمایش شکیل و حرفه‌ای باکس‌های تصویری ۱ تایی (تمام‌عرض) و چندتایی صفحه اصلی */
.af-banners-sec .af-banner-card {
	position: relative;
	display: block;
	width: 100%;
	border-radius: 18px;
	overflow: hidden;
	background: #fff;
	border: 1px solid #e6ecf2;
	box-shadow: 0 8px 26px rgba(15, 23, 42, 0.07);
	transition: transform .25s ease, box-shadow .25s ease;
}
.af-banners-sec .af-banner-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}
.af-banners-sec .af-cols-1 .af-banner-card img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
}
.af-banners-sec .af-cols-2 .af-banner-card img,
.af-banners-sec .af-cols-3 .af-banner-card img,
.af-banners-sec .af-cols-4 .af-banner-card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
