/*
 * بخش‌های دیجی‌کالا برای المنتور — Digikala Sections
 */

.dk-section {
	position: relative;
	padding: 16px 0;
}

.dk-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.dk-title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	color: #23254e;
	line-height: 1.6;
}

.dk-viewall {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: #19bfd3;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}

.dk-viewall:hover {
	color: #ef394e;
}

[dir="rtl"] .dk-viewall .dk-chevron {
	transform: scaleX(-1);
}

/* ---- Carousel ---- */
.dk-carousel {
	position: relative;
}

.dk-viewport {
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-ms-overflow-style: none;
	cursor: grab;
}

.dk-viewport::-webkit-scrollbar {
	display: none;
}

.dk-viewport.dk-dragging {
	cursor: grabbing;
	scroll-snap-type: none;
}

.dk-viewport.dk-dragging a {
	pointer-events: none;
}

.dk-track {
	display: flex;
	gap: var(--dk-gap, 12px);
}

.dk-slide {
	flex: 0 0 calc((100% - (var(--dk-pv, 4) - 1) * var(--dk-gap, 12px)) / var(--dk-pv, 4));
	min-width: 0;
	scroll-snap-align: start;
}

.dk-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border-radius: 50%;
	background: #ffffff;
	border: 1px solid #e0e0e2;
	color: #23254e;
	cursor: pointer;
	z-index: 10;
	transition: opacity .2s ease;
}

.dk-prev {
	inset-inline-start: -6px;
}

.dk-next {
	inset-inline-end: -6px;
}

.dk-arrow.dk-disabled {
	opacity: 0;
	pointer-events: none;
}

/* ---- Cards ---- */
.dk-card {
	position: relative;
	height: 100%;
	box-sizing: border-box;
	padding: 12px;
	background: #ffffff;
	border: 1px solid #e0e0e2;
	border-radius: 12px;
}

.dk-product-card {
	display: flex;
	flex-direction: column;
	transition: box-shadow .25s ease;
}

.dk-product-card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}

.dk-rank {
	position: absolute;
	top: 8px;
	inset-inline-start: 12px;
	z-index: 2;
	font-size: 26px;
	font-weight: 800;
	color: #ef394e;
	line-height: 1;
}

.dk-new-badge {
	position: absolute;
	top: 8px;
	inset-inline-end: 8px;
	z-index: 2;
	padding: 2px 10px;
	border-radius: 8px;
	background: #19bfd3;
	color: #ffffff;
	font-size: 11px;
	font-weight: 600;
}

.dk-pimg {
	display: block;
	aspect-ratio: 1 / 1;
	margin: 0 auto 10px;
}

.dk-pimg img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform .3s ease;
}

.dk-product-card:hover .dk-pimg img {
	transform: scale(1.05);
}

.dk-ptitle {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.7;
}

.dk-ptitle a {
	color: inherit;
	text-decoration: none;
}

.dk-rating {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 8px;
	font-size: 12px;
}

.dk-stars {
	position: relative;
	display: inline-block;
	direction: ltr;
	color: #e0e0e2;
	letter-spacing: 1px;
	line-height: 1;
	white-space: nowrap;
}

.dk-stars-fill {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	color: #f9a825;
}

.dk-rcount {
	color: #a1a3a8;
}

.dk-pricing {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: auto;
}

.dk-oldprice {
	color: #a1a3a8;
	font-size: 12px;
	text-decoration: line-through;
}

.dk-off-badge {
	padding: 2px 6px;
	border-radius: 6px;
	background: #ef394e;
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
}

.dk-price {
	font-size: 15px;
	font-weight: 700;
	color: #23254e;
	text-decoration: none;
}

.dk-add {
	display: block;
	margin: 10px 0 0;
	padding: 8px 10px;
	border-radius: 8px;
	background: #ef394e;
	color: #ffffff;
	font-size: 13px;
	text-align: center;
	text-decoration: none;
	transition: filter .2s ease;
}

.dk-add:hover {
	filter: brightness(1.08);
	color: #ffffff;
}

/* ---- Brand card ---- */
.dk-brand-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 120px;
	padding: 20px 12px;
	text-decoration: none;
}

.dk-blogo {
	max-width: 100%;
	height: 56px;
	width: auto;
	object-fit: contain;
}

.dk-bname {
	color: #23254e;
	font-size: 14px;
	font-weight: 500;
	text-align: center;
}

.dk-brand-card.dk-no-logo .dk-bname {
	font-size: 16px;
	font-weight: 700;
}

/* ---- Categories grid ---- */
.dk-grid {
	display: grid;
	grid-template-columns: repeat(var(--dk-cols, 6), 1fr);
	gap: var(--dk-gap, 16px) 8px;
}

@media (max-width: 1024px) {
	.dk-grid {
		grid-template-columns: repeat(var(--dk-cols-t, 4), 1fr);
	}
}

@media (max-width: 600px) {
	.dk-grid {
		grid-template-columns: repeat(var(--dk-cols-m, 3), 1fr);
	}
}

.dk-cat {
	text-align: center;
}

.dk-cat-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-decoration: none;
}

.dk-cat-img {
	width: 96px;
	height: 96px;
	border-radius: 50%;
	object-fit: contain;
}

span.dk-cat-img {
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #e0e0e2;
	background: #ffffff;
	font-size: 28px;
	font-weight: 700;
	color: #ef394e;
}

.dk-cap {
	color: #23254e;
	font-size: 13px;
}

.dk-empty {
	margin: 0;
	padding: 24px;
	text-align: center;
	color: #a1a3a8;
	font-size: 14px;
}

/* ---- Amazing deals (شگفت‌انگیز) ---- */
.dk-amazing {
	/* Fallback look if the user hasn't picked a background/radius yet
	   in the Style tab (Section background now supports solid, gradient
	   or any image, including animated GIFs). */
	border-radius: 16px;
}

.dk-amazing .dk-title {
	color: #ffffff;
}

.dk-amazing .dk-viewall {
	color: #ffffff;
}

.dk-amazing .dk-viewall:hover {
	color: #ffffff;
	opacity: .8;
}

.dk-amazing .dk-arrow {
	background: #ffffff;
	border-color: transparent;
}

/* ---- Countdown timer (segmented, Digikala style) ---- */
.dk-timer {
	position: absolute;
	top: 0;
	inset-inline: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 5px 6px;
	border-radius: 10px 10px 0 0;
	overflow: hidden;
}

.dk-timer-bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: var(--dk-timer-bg, #ffffff);
	opacity: var(--dk-timer-opacity, .85);
}

.dk-t-seg {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 26px;
	line-height: 1.2;
}

.dk-t-num {
	font-size: 13px;
	font-weight: 700;
	color: var(--dk-timer-num, #23254e);
}

.dk-t-lab {
	font-size: 9px;
	color: var(--dk-timer-lab, #8a8d98);
}

.dk-t-accent .dk-t-lab {
	color: var(--dk-timer-accent, #ef394e);
	font-weight: 600;
}

.dk-t-sep {
	position: relative;
	z-index: 1;
	align-self: flex-start;
	margin-top: 1px;
	font-size: 13px;
	font-weight: 700;
	color: var(--dk-timer-num, #23254e);
}

.dk-promo-slide {
	flex: 0 0 200px;
}

.dk-promo {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	height: 100%;
	min-height: 220px;
	overflow: hidden;
	border-radius: 12px;
	text-decoration: none;
	background: rgba(255, 255, 255, .08);
}

.dk-promo-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.dk-promo-text {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px;
	background: rgba(0, 0, 0, .35);
}

.dk-promo-title {
	color: #ffffff;
	font-size: 14px;
	font-weight: 700;
}

.dk-promo-sub {
	color: #ffffff;
	font-size: 12px;
	opacity: .9;
}
