/**
 * EduNexa — ادونکسا
 * Advanced Course & Product Grid Stylesheet
 * Responsive Grid, Educational Course Cards, Infinite Scroll, Load More & Numbered Pagination
 *
 * @package EduNexa
 * @author  امیر حسین بناوند (Amir Hossein Banavand)
 * @link    https://npocto.ir
 */

.edunexa-shop-grid-wrapper {
	width: 100%;
	direction: rtl;
	box-sizing: border-box;
	position: relative;
}

/* ==========================================================================
   1. PRODUCTS / COURSES GRID CONTAINER
   ========================================================================== */
.edunexa-shop-products-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.25rem;
	width: 100%;
	box-sizing: border-box;
	transition: opacity 0.25s ease;
}

.edunexa-shop-grid-wrapper.is-loading .edunexa-shop-products-grid {
	opacity: 0.55;
	pointer-events: none;
}

/* ==========================================================================
   2. EDUNEXA COURSE CARD DESIGN
   ========================================================================== */
.edunexa-course-card {
	background: #ffffff;
	border: 1px solid #eef1f6;
	border-radius: 16px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
	box-shadow: 0 4px 18px rgba(34, 39, 51, 0.04);
	position: relative;
	box-sizing: border-box;
}

.edunexa-course-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 12px 30px rgba(34, 39, 51, 0.1);
	border-color: rgba(250, 178, 55, 0.4);
}

/* Thumbnail Wrap - 700x700 1:1 Square Native Support */
.edunexa-card-thumb-wrap {
	position: relative;
	width: 100%;
	padding-top: 100%; /* 1:1 square ratio default optimized for 700x700 */
	aspect-ratio: 1 / 1;
	background: #1e2430;
	overflow: hidden;
	border-radius: 14px 14px 0 0;
}

.edunexa-card-thumb-wrap.ratio-1-1 {
	padding-top: 100%;
	aspect-ratio: 1 / 1;
}

.edunexa-card-thumb-wrap.ratio-16-9 {
	padding-top: 56.25%;
	aspect-ratio: 16 / 9;
}

.edunexa-card-thumb-wrap.ratio-4-3 {
	padding-top: 75%;
	aspect-ratio: 4 / 3;
}

.edunexa-card-thumb-link {
	position: absolute;
	inset: 0;
	display: block;
}

.edunexa-card-thumb-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	transition: transform 0.4s ease;
}

.edunexa-course-card:hover .edunexa-card-thumb-img {
	transform: scale(1.06);
}

/* Badges on Thumbnail */
.edunexa-card-badges {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	flex-direction: column;
	gap: 5px;
	z-index: 2;
}

.edunexa-badge {
	font-size: 0.6875rem;
	font-weight: 800;
	padding: 0.2rem 0.55rem;
	border-radius: 6px;
	white-space: nowrap;
	line-height: 1.4;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.edunexa-badge-discount {
	background: #ef4444;
	color: #ffffff;
}

.edunexa-badge-level,
.edunexa-cms-badge-level {
	display: none !important;
}

.edunexa-badge-featured {
	background: #fab237;
	color: #1e2430;
}

/* Category Pill on Image Bottom */
.edunexa-card-category-pill {
	position: absolute;
	bottom: 10px;
	right: 10px;
	background: rgba(30, 36, 48, 0.85);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	color: #e2e8f0;
	font-size: 0.6875rem;
	font-weight: 700;
	padding: 0.2rem 0.6rem;
	border-radius: 6px;
	z-index: 2;
	text-decoration: none;
	transition: all 0.2s ease;
}

.edunexa-card-category-pill:hover {
	background: #fab237;
	color: #1e2430;
}

/* Course Card Body */
.edunexa-card-body {
	padding: 1.15rem 1.15rem 1rem;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

/* Course Title */
.edunexa-card-title {
	font-size: 0.9375rem;
	font-weight: 800;
	line-height: 1.55;
	margin: 0 0 0.75rem 0;
	color: #0f172a;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	height: 2.9em;
}

.edunexa-card-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s ease;
}

.edunexa-card-title a:hover {
	color: #fab237;
}

/* Instructor Row */
.edunexa-card-instructor {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.8125rem;
	color: #64748b;
	margin-block-end: 0.85rem;
}

.edunexa-card-instructor-icon {
	font-size: 1rem;
	line-height: 1;
}

.edunexa-card-instructor-name {
	font-weight: 600;
}

/* Meta Row (Duration & Lessons) */
.edunexa-card-meta-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-block: 0.65rem;
	border-block: 1px dashed #f1f5f9;
	margin-block-end: 0.85rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: #64748b;
}

.edunexa-card-meta-item {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.edunexa-card-meta-item svg {
	width: 14px;
	height: 14px;
	stroke: #fab237;
}

/* Rating Row */
.edunexa-card-rating-row {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin-block-end: 0.85rem;
	font-size: 0.8125rem;
}

.edunexa-card-stars {
	color: #fab237;
	display: inline-flex;
	letter-spacing: 1px;
	font-size: 0.875rem;
}

.edunexa-card-rating-num {
	font-weight: 800;
	color: #1e293b;
}

.edunexa-card-rating-count {
	font-size: 0.75rem;
	color: #94a3b8;
}

/* Footer Row: Price & Action Button */
.edunexa-card-footer {
	margin-block-start: auto;
	padding-block-start: 0.75rem;
	border-block-start: 1px solid #f8fafc;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.edunexa-card-price-col {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.edunexa-price-regular {
	font-size: 0.75rem;
	color: #94a3b8;
	text-decoration: line-through;
}

.edunexa-price-current {
	font-size: 1.05rem;
	font-weight: 900;
	color: #0f172a;
	display: inline-flex;
	align-items: baseline;
	gap: 0.25rem;
}

.edunexa-price-currency {
	font-size: 0.75rem;
	font-weight: 600;
	color: #64748b;
}

.edunexa-price-free {
	font-size: 1rem;
	font-weight: 900;
	color: #10b981;
}

.edunexa-card-btn-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem 0.95rem;
	background: #1e2430;
	color: #ffffff;
	border-radius: 10px;
	font-size: 0.8125rem;
	font-weight: 700;
	text-decoration: none;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.edunexa-card-btn-action:hover {
	background: #fab237;
	color: #1e2430;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(250, 178, 55, 0.35);
}

/* ==========================================================================
   3. PAGINATION MODES: INFINITE SCROLL, LOAD MORE & NUMBERED
   ========================================================================== */
.edunexa-shop-pagination-wrap {
	margin-block-start: 2rem;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
}

/* Infinite Scroll */
.edunexa-infinite-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	width: 100%;
}

.edunexa-infinite-loader {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.65rem;
	padding: 1rem;
	color: #64748b;
	font-size: 0.875rem;
	font-weight: 700;
}

.edunexa-infinite-spinner,
.edunexa-btn-spinner {
	width: 22px;
	height: 22px;
	border: 2.5px solid #e2e8f0;
	border-top-color: #fab237;
	border-radius: 50%;
	animation: edunexaSpin 0.7s linear infinite;
	display: inline-block;
}

@keyframes edunexaSpin {
	to { transform: rotate(360deg); }
}

.edunexa-infinite-sentinel {
	height: 10px;
	width: 100%;
	visibility: hidden;
}

.edunexa-all-loaded-text {
	font-size: 0.8125rem;
	font-weight: 700;
	color: #94a3b8;
	padding: 0.5rem 1rem;
	border-radius: 99px;
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
}

/* Load More Button */
.edunexa-load-more-wrap {
	display: flex;
	justify-content: center;
	width: 100%;
}

.edunexa-btn-load-more {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.75rem 2rem;
	background: #ffffff;
	border: 2px solid #fab237;
	color: #1e2430;
	border-radius: 12px;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 800;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 4px 14px rgba(250, 178, 55, 0.2);
}

.edunexa-btn-load-more:hover {
	background: #fab237;
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(250, 178, 55, 0.35);
}

.edunexa-btn-load-more.is-loading {
	pointer-events: none;
	opacity: 0.75;
}

/* Numbered Pagination */
.edunexa-numbered-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

.edunexa-page-item {
	display: inline-block;
}

.edunexa-page-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	color: #334155;
	font-size: 0.875rem;
	font-weight: 700;
	text-decoration: none;
	transition: all 0.2s ease;
	cursor: pointer;
}

.edunexa-page-link:hover {
	background: rgba(250, 178, 55, 0.12);
	border-color: #fab237;
	color: #1e2430;
}

.edunexa-page-item.is-current .edunexa-page-link {
	background: #fab237;
	border-color: #fab237;
	color: #1e2430;
	font-weight: 900;
	box-shadow: 0 4px 12px rgba(250, 178, 55, 0.35);
}

/* Empty State */
.edunexa-no-courses-found {
	grid-column: 1 / -1;
	text-align: center;
	padding: 3rem 1.5rem;
	background: #ffffff;
	border: 1px dashed #cbd5e1;
	border-radius: 16px;
}

.edunexa-no-courses-found svg {
	width: 56px;
	height: 56px;
	fill: #cbd5e1;
	margin-block-end: 1rem;
}

.edunexa-no-courses-found h4 {
	font-size: 1.15rem;
	font-weight: 800;
	color: #0f172a;
	margin: 0 0 0.5rem 0;
}

.edunexa-no-courses-found p {
	font-size: 0.875rem;
	color: #64748b;
	margin: 0;
}

/* ==========================================================================
   4. RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 991px) {
	.edunexa-shop-products-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1rem;
	}
}

@media (max-width: 640px) {
	.edunexa-shop-products-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.edunexa-card-body {
		padding: 1rem;
	}

	.edunexa-card-title {
		font-size: 0.9rem;
	}
}
