/**
 * BK Gallery Product Widget Styles
 * Author: Bùi Đức Hạnh (https://buhaweb.com/)
 * Prefix: bdh-bk-
 * Kit 4 Global Design System Compliant (Tông Xanh Lá Chủ Đạo)
 */

/* ==========================================================================
   1. ROOT & MAIN WRAPPER
   ========================================================================== */
.bdh-bk-gallery-product {
	position: relative;
	width: 100%;
	box-sizing: border-box;
}

.bdh-bk-gallery-product *,
.bdh-bk-gallery-product *::before,
.bdh-bk-gallery-product *::after {
	box-sizing: border-box;
}

.bdh-bk-gallery-product__main-wrapper {
	position: relative;
	width: 100%;
	overflow: hidden;
	background-color: var(--e-global-color-8d5d81d, #ffffff);
	border: 1px solid var(--e-global-color-fcc82ce, #e5e7eb);
	border-radius: 12px;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.bdh-bk-gallery-product__main-wrapper:hover {
	border-color: var(--e-global-color-5c987e6, #7fcb98);
}

/* ==========================================================================
   2. ASPECT RATIOS & IMAGE BOX (ZERO-CLS)
   ========================================================================== */
.bdh-bk-gallery-product__image-box {
	position: relative;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background-color: var(--e-global-color-8d5d81d, #ffffff);
	cursor: zoom-in;
}

.bdh-bk-gallery-product--aspect-1-1 .bdh-bk-gallery-product__image-box {
	aspect-ratio: 1 / 1;
}

.bdh-bk-gallery-product--aspect-4-3 .bdh-bk-gallery-product__image-box {
	aspect-ratio: 4 / 3;
}

.bdh-bk-gallery-product--aspect-16-9 .bdh-bk-gallery-product__image-box {
	aspect-ratio: 16 / 9;
}

.bdh-bk-gallery-product--aspect-natural .bdh-bk-gallery-product__image-box {
	height: auto;
}

.bdh-bk-gallery-product__image-box img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	user-select: none;
	-webkit-user-drag: none;
}

.bdh-bk-gallery-product__image-box:hover img {
	transform: scale(1.03);
}

/* ==========================================================================
   3. BADGES (SALE / OUT OF STOCK)
   ========================================================================== */
.bdh-bk-gallery-product__badges {
	position: absolute;
	z-index: 10;
	display: flex;
	flex-direction: column;
	gap: 6px;
	pointer-events: none;
}

.bdh-bk-gallery-product__badges--top-left {
	top: 14px;
	left: 14px;
	align-items: flex-start;
}

.bdh-bk-gallery-product__badges--top-right {
	top: 14px;
	right: 14px;
	align-items: flex-end;
}

.bdh-bk-gallery-product__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 5px 12px;
	font-size: var(--e-global-typography-79e5d5b-font-size, 14px);
	font-weight: 700;
	line-height: 1.2;
	border-radius: 20px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.bdh-bk-gallery-product__badge--sale {
	background-color: var(--e-global-color-d0d47e8, #ee3338);
	color: var(--e-global-color-8d5d81d, #ffffff);
}

.bdh-bk-gallery-product__badge--stock {
	background-color: var(--e-global-color-76ff1c6, #4b5563);
	color: var(--e-global-color-8d5d81d, #ffffff);
}

/* ==========================================================================
   4. QUICK ZOOM BUTTON
   ========================================================================== */
.bdh-bk-gallery-product__zoom-btn {
	position: absolute;
	z-index: 10;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background-color: var(--e-global-color-8d5d81d, #ffffff);
	color: var(--e-global-color-97923db, #1e6b3a);
	border: 1px solid var(--e-global-color-fcc82ce, #e5e7eb);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	outline: none;
	transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bdh-bk-gallery-product__zoom-btn svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
	transition: transform 0.25s ease;
}

.bdh-bk-gallery-product__zoom-btn:hover {
	background-color: var(--e-global-color-938e6c1, #1C7D38);
	color: var(--e-global-color-8d5d81d, #ffffff);
	border-color: var(--e-global-color-938e6c1, #1C7D38);
	transform: scale(1.1);
	box-shadow: 0 6px 16px rgba(42, 145, 80, 0.25);
}

.bdh-bk-gallery-product__zoom-btn:hover svg {
	transform: scale(1.1);
}

.bdh-bk-gallery-product__zoom-btn--bottom-left {
	bottom: 14px;
	left: 14px;
}

.bdh-bk-gallery-product__zoom-btn--bottom-right {
	bottom: 14px;
	right: 14px;
}

.bdh-bk-gallery-product__zoom-btn--top-right {
	top: 14px;
	right: 14px;
}

.bdh-bk-gallery-product__zoom-btn--top-left {
	top: 14px;
	left: 14px;
}

/* ==========================================================================
   5. MAIN NAVIGATION ARROWS (SWIPER)
   ========================================================================== */
.bdh-bk-gallery-product__arrow {
	position: absolute;
	z-index: 15;
	top: 50%;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: var(--e-global-color-8d5d81d, #ffffff);
	color: var(--e-global-color-97923db, #1e6b3a);
	border: 1px solid var(--e-global-color-fcc82ce, #e5e7eb);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	outline: none;
	transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bdh-bk-gallery-product__arrow svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.bdh-bk-gallery-product__arrow--prev {
	left: 12px;
}

.bdh-bk-gallery-product__arrow--next {
	right: 12px;
}

.bdh-bk-gallery-product__arrow:hover {
	background-color: var(--e-global-color-938e6c1, #1C7D38);
	color: var(--e-global-color-8d5d81d, #ffffff);
	border-color: var(--e-global-color-938e6c1, #1C7D38);
	transform: translateY(-50%) scale(1.08);
	box-shadow: 0 6px 16px rgba(42, 145, 80, 0.3);
}

.bdh-bk-gallery-product__arrow.swiper-button-disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

/* Hover-only mode (Flatsome style) */
.bdh-bk-gallery-product--arrows-hover .bdh-bk-gallery-product__arrow {
	opacity: 0;
	pointer-events: none;
}

.bdh-bk-gallery-product--arrows-hover:hover .bdh-bk-gallery-product__arrow:not(.swiper-button-disabled) {
	opacity: 1;
	pointer-events: auto;
}

/* Dots pagination */
.bdh-bk-gallery-product__pagination {
	position: absolute;
	bottom: 12px;
	left: 0;
	width: 100%;
	display: flex;
	justify-content: center;
	gap: 6px;
	z-index: 10;
}

.bdh-bk-gallery-product__pagination .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--e-global-color-fcc82ce, #e5e7eb);
	opacity: 0.7;
	transition: all 0.25s ease;
	cursor: pointer;
}

.bdh-bk-gallery-product__pagination .swiper-pagination-bullet-active {
	background: var(--e-global-color-1070229, #2cac55);
	width: 22px;
	border-radius: 4px;
	opacity: 1;
}

/* ==========================================================================
   6. THUMBNAILS ALBUM (BELOW MAIN SLIDER)
   ========================================================================== */
.bdh-bk-gallery-product__thumbs-wrapper {
	position: relative;
	margin-top: 12px;
	width: 100%;
}

.bdh-bk-gallery-product__thumbs-slider {
	width: 100%;
	overflow: hidden;
}

.bdh-bk-gallery-product__thumb-item {
	position: relative;
	border: 2px solid var(--e-global-color-fcc82ce, #e5e7eb);
	border-radius: 8px;
	overflow: hidden;
	background-color: var(--e-global-color-8d5d81d, #ffffff);
	opacity: 0.7;
	cursor: pointer;
	transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bdh-bk-gallery-product__thumb-item:hover {
	opacity: 0.95;
	border-color: var(--e-global-color-5c987e6, #7fcb98);
	transform: translateY(-2px);
}

.bdh-bk-gallery-product__thumb-item.is-active,
.bdh-bk-gallery-product__thumb-item.swiper-slide-thumb-active {
	border-color: var(--e-global-color-1070229, #2cac55);
	opacity: 1;
	box-shadow: 0 4px 12px rgba(44, 172, 85, 0.2);
}

.bdh-bk-gallery-product__thumb-box {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
}

.bdh-bk-gallery-product__thumb-box img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

/* Thumbnails Navigation Arrows */
.bdh-bk-gallery-product__thumb-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 12;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--e-global-color-8d5d81d, #ffffff);
	border: 1px solid var(--e-global-color-fcc82ce, #e5e7eb);
	color: var(--e-global-color-97923db, #1e6b3a);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
	transition: all 0.2s ease;
	padding: 0;
}

.bdh-bk-gallery-product__thumb-arrow svg {
	width: 10px;
	height: 10px;
	fill: currentColor;
}

.bdh-bk-gallery-product__thumb-arrow--prev {
	left: -8px;
}

.bdh-bk-gallery-product__thumb-arrow--next {
	right: -8px;
}

.bdh-bk-gallery-product__thumb-arrow:hover {
	background: var(--e-global-color-938e6c1, #1C7D38);
	color: var(--e-global-color-8d5d81d, #ffffff);
	border-color: var(--e-global-color-938e6c1, #1C7D38);
}

.bdh-bk-gallery-product__thumb-arrow.swiper-button-disabled {
	opacity: 0;
	pointer-events: none;
}

/* ==========================================================================
   7. INTERACTIVE LIGHTBOX MODAL (FULLSCREEN & ZOOM)
   ========================================================================== */
.bdh-bk-gallery-product__lightbox {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bdh-bk-gallery-product__lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.bdh-bk-gallery-product__lightbox-backdrop {
	position: absolute;
	inset: 0;
	background-color: rgba(15, 23, 42, 0.94);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

/* Header bar */
.bdh-bk-gallery-product__lightbox-header {
	position: relative;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 24px;
	color: var(--e-global-color-8d5d81d, #ffffff);
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bdh-bk-gallery-product__lightbox-counter {
	font-size: var(--e-global-typography-fc3ef67-font-size, 16px);
	font-weight: 600;
	letter-spacing: 0.05em;
	color: var(--e-global-color-8d5d81d, #ffffff);
}

.bdh-bk-gallery-product__lightbox-title {
	font-size: var(--e-global-typography-fc3ef67-font-size, 16px);
	color: rgba(255, 255, 255, 0.8);
	max-width: 60%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: center;
}

.bdh-bk-gallery-product__lightbox-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.bdh-bk-gallery-product__lightbox-btn {
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.15);
	color: var(--e-global-color-8d5d81d, #ffffff);
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
	outline: none;
	padding: 0;
}

.bdh-bk-gallery-product__lightbox-btn:hover {
	background: var(--e-global-color-1070229, #2cac55);
	border-color: var(--e-global-color-1070229, #2cac55);
	color: var(--e-global-color-8d5d81d, #ffffff);
	transform: scale(1.08);
}

/* Lightbox Swiper */
.bdh-bk-gallery-product__lightbox-slider {
	position: relative;
	z-index: 10;
	flex: 1;
	width: 100%;
	height: calc(100vh - 170px);
	display: flex;
	align-items: center;
	justify-content: center;
}

.bdh-bk-gallery-product__lightbox-slide {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	user-select: none;
}

.bdh-bk-gallery-product__lightbox-slide .swiper-zoom-container {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bdh-bk-gallery-product__lightbox-slide img {
	max-width: 90vw;
	max-height: 75vh;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	transition: transform 0.3s ease;
}

/* Lightbox Arrows */
.bdh-bk-gallery-product__lightbox-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 25;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: var(--e-global-color-8d5d81d, #ffffff);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.25s ease;
	outline: none;
	padding: 0;
	backdrop-filter: blur(4px);
}

.bdh-bk-gallery-product__lightbox-arrow svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.bdh-bk-gallery-product__lightbox-arrow--prev {
	left: 24px;
}

.bdh-bk-gallery-product__lightbox-arrow--next {
	right: 24px;
}

.bdh-bk-gallery-product__lightbox-arrow:hover {
	background: var(--e-global-color-1070229, #2cac55);
	border-color: var(--e-global-color-1070229, #2cac55);
	transform: translateY(-50%) scale(1.1);
	box-shadow: 0 0 20px rgba(44, 172, 85, 0.4);
}

.bdh-bk-gallery-product__lightbox-arrow.swiper-button-disabled {
	opacity: 0.2;
	pointer-events: none;
}

/* Lightbox Bottom Thumbnails */
.bdh-bk-gallery-product__lightbox-thumbs {
	position: relative;
	z-index: 20;
	height: 80px;
	padding: 10px 20px;
	background: rgba(0, 0, 0, 0.4);
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	display: flex;
	align-items: center;
	justify-content: center;
}

.bdh-bk-gallery-product__lightbox-thumbs-slider {
	max-width: 600px;
	width: 100%;
	overflow: hidden;
}

.bdh-bk-gallery-product__lightbox-thumb {
	width: 56px !important;
	height: 56px;
	border-radius: 6px;
	overflow: hidden;
	border: 2px solid transparent;
	opacity: 0.5;
	cursor: pointer;
	transition: all 0.2s ease;
	background: #ffffff;
}

.bdh-bk-gallery-product__lightbox-thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.bdh-bk-gallery-product__lightbox-thumb:hover {
	opacity: 0.85;
}

.bdh-bk-gallery-product__lightbox-thumb.is-active,
.bdh-bk-gallery-product__lightbox-thumb.swiper-slide-thumb-active {
	border-color: var(--e-global-color-1070229, #2cac55);
	opacity: 1;
	transform: scale(1.05);
}

/* ==========================================================================
   8. RESPONSIVE BREAKPOINTS (Kit 4: Tablet <= 1024px, Mobile <= 767px)
   ========================================================================== */
@media (max-width: 1024px) {
	.bdh-bk-gallery-product__arrow {
		width: 36px;
		height: 36px;
	}
	.bdh-bk-gallery-product__lightbox-arrow {
		width: 44px;
		height: 44px;
	}
	.bdh-bk-gallery-product__lightbox-arrow--prev {
		left: 14px;
	}
	.bdh-bk-gallery-product__lightbox-arrow--next {
		right: 14px;
	}
}

@media (max-width: 767px) {
	/* Mobile: Always show navigation arrows */
	.bdh-bk-gallery-product--arrows-hover .bdh-bk-gallery-product__arrow {
		opacity: 1;
		pointer-events: auto;
	}

	.bdh-bk-gallery-product__arrow {
		width: 32px;
		height: 32px;
	}

	.bdh-bk-gallery-product__arrow svg {
		width: 12px;
		height: 12px;
	}

	.bdh-bk-gallery-product__zoom-btn {
		width: 32px;
		height: 32px;
	}

	.bdh-bk-gallery-product__zoom-btn svg {
		width: 15px;
		height: 15px;
	}

	.bdh-bk-gallery-product__badge {
		padding: 3px 8px;
		font-size: 11px;
	}

	.bdh-bk-gallery-product__lightbox-header {
		padding: 12px 16px;
	}

	.bdh-bk-gallery-product__lightbox-arrow {
		width: 38px;
		height: 38px;
	}

	.bdh-bk-gallery-product__lightbox-arrow--prev {
		left: 8px;
	}

	.bdh-bk-gallery-product__lightbox-arrow--next {
		right: 8px;
	}

	.bdh-bk-gallery-product__lightbox-thumbs {
		height: 70px;
		padding: 8px 10px;
	}

	.bdh-bk-gallery-product__lightbox-thumb {
		width: 48px !important;
		height: 48px;
	}
}
