/* =====================================================================
   BizDir Theme — استایل لایت‌باکس تصاویر (نسخه ۲.۰)
   زوم + اسلاید بین تصاویر + دکمه بستن + نوار تصاویر بندانگشتی
   ===================================================================== */

.bdt-lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	opacity: 0;
	visibility: hidden;
	transition: opacity .28s ease, visibility .28s ease;
}
.bdt-lb.is-open { opacity: 1; visibility: visible; }

/* پس‌زمینه تار */
.bdt-lb__backdrop {
	position: absolute;
	inset: 0;
	background: radial-gradient(1200px 800px at 50% 42%, rgba(20, 40, 66, .92), rgba(8, 16, 28, .97));
	-webkit-backdrop-filter: blur(10px) saturate(1.2);
	backdrop-filter: blur(10px) saturate(1.2);
}

/* نوار بالا: شمارنده + ابزارها */
.bdt-lb__bar {
	position: relative;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	color: #fff;
	transition: opacity .3s ease;
}
.bdt-lb__counter {
	background: rgba(255, 255, 255, .14);
	border: 1px solid rgba(255, 255, 255, .16);
	padding: 6px 16px;
	border-radius: 999px;
	font-size: .85rem;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	white-space: nowrap;
}
.bdt-lb__tools { display: flex; gap: 8px; flex-wrap: wrap; }
.bdt-lb__btn {
	width: 42px;
	height: 42px;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 14px;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	cursor: pointer;
	display: grid;
	place-items: center;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	transition: background .18s ease, transform .18s ease;
	flex: 0 0 auto;
}
.bdt-lb__btn:hover { background: rgba(255, 255, 255, .26); transform: translateY(-2px); }
.bdt-lb__btn:active { transform: scale(.94); }
.bdt-lb__btn--close { background: rgba(229, 72, 77, .85); border-color: transparent; }
.bdt-lb__btn--close:hover { background: #e5484d; }

/* صحنه اصلی تصویر */
.bdt-lb__stage {
	position: relative;
	z-index: 2;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 6px 16px;
	touch-action: none;
}
.bdt-lb__figure {
	margin: 0;
	max-width: min(1240px, 96vw);
	max-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}
.bdt-lb__img {
	max-width: 100%;
	max-height: calc(100vh - 230px);
	border-radius: 18px;
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .65);
	transform-origin: center center;
	transition: transform .22s ease, opacity .25s ease;
	user-select: none;
	-webkit-user-drag: none;
	background: #0b1626;
	will-change: transform;
}
.bdt-lb.is-panning .bdt-lb__img { transition: none; }
.bdt-lb__img.is-loading { opacity: .35; }

.bdt-lb__caption {
	max-width: 92%;
	text-align: center;
	color: #e7eef7;
	background: rgba(255, 255, 255, .1);
	border: 1px solid rgba(255, 255, 255, .15);
	padding: 7px 18px;
	border-radius: 999px;
	font-size: .86rem;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	transition: opacity .3s ease;
}
.bdt-lb__caption:empty { display: none; }

/* دکمه‌های قبلی/بعدی */
.bdt-lb__nav {
	position: absolute;
	top: 50%;
	margin-top: -27px;
	z-index: 4;
	width: 54px;
	height: 54px;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	cursor: pointer;
	display: grid;
	place-items: center;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	transition: background .18s ease, transform .18s ease;
}
.bdt-lb__nav:hover { background: rgba(255, 255, 255, .28); transform: scale(1.06); }
.bdt-lb__nav:active { transform: scale(.95); }
.bdt-lb__nav--next { inset-inline-end: 18px; }
.bdt-lb__nav--prev { inset-inline-start: 18px; }

/* نوار بندانگشتی‌ها */
.bdt-lb__thumbs {
	position: relative;
	z-index: 3;
	display: flex;
	gap: 10px;
	justify-content: center;
	padding: 12px 16px 18px;
	overflow-x: auto;
	scrollbar-width: none;
	transition: opacity .3s ease;
}
.bdt-lb__thumbs::-webkit-scrollbar { display: none; }
.bdt-lb__thumbs:empty { display: none; }
.bdt-lb__thumb {
	flex: 0 0 auto;
	width: 66px;
	height: 48px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 12px;
	overflow: hidden;
	background: none;
	opacity: .55;
	cursor: pointer;
	transition: all .18s ease;
}
.bdt-lb__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bdt-lb__thumb:hover { opacity: .9; }
.bdt-lb__thumb.is-active { border-color: #0fb5a6; opacity: 1; transform: translateY(-3px); }

/* لودر */
.bdt-lb__loader {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 46px;
	height: 46px;
	margin: -23px 0 0 -23px;
	border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, .22);
	border-top-color: #0fb5a6;
	animation: bdtSpin .8s linear infinite;
	z-index: 5;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
}
.bdt-lb.is-loading .bdt-lb__loader { opacity: 1; }
@keyframes bdtSpin { to { transform: rotate(360deg); } }

/* قفل اسکرول صفحه پشت لایت‌باکس */
html.bdt-lb-open { overflow: hidden; }

/* حالت بی‌حرکتی: پنهان‌شدن تدریجی رابط پس از چند ثانیه */
.bdt-lb__bar, .bdt-lb__nav, .bdt-lb__thumbs, .bdt-lb__caption { transition-property: opacity, background, transform, border-color; }
.bdt-lb--idle .bdt-lb__bar,
.bdt-lb--idle .bdt-lb__nav,
.bdt-lb--idle .bdt-lb__thumbs,
.bdt-lb--idle .bdt-lb__caption { opacity: 0; pointer-events: none; }

/* ریسپانسیو */
@media (max-width: 640px) {
	.bdt-lb__btn { width: 38px; height: 38px; border-radius: 12px; }
	.bdt-lb__nav { width: 44px; height: 44px; margin-top: -22px; }
	.bdt-lb__nav--next { inset-inline-end: 10px; }
	.bdt-lb__nav--prev { inset-inline-start: 10px; }
	.bdt-lb__img { max-height: calc(100vh - 195px); border-radius: 14px; }
	.bdt-lb__thumbs { padding-bottom: 10px; gap: 8px; }
	.bdt-lb__thumb { width: 54px; height: 40px; }
	.bdt-lb__bar { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
	.bdt-lb, .bdt-lb__img, .bdt-lb__btn, .bdt-lb__nav, .bdt-lb__thumb { transition: none !important; }
}
