/*
 * HorecaDepot live-compatible Amazon-style gallery module.
 * Contract: #hg-wrap, #hg-main-box, #hg-img, .hg-lens, .hg-zoom-win.
 */

.hg-wrap {
	width: 100%;
	max-width: 680px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
	position: relative;
}

.hg-main-box {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 6px;
	overflow: hidden;
	cursor: zoom-in !important;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: auto !important;
	user-select: none;
}

.hg-img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
	transition: opacity 160ms ease;
}

.hg-img.hg-loading {
	opacity: .4;
}

.hg-click-hint {
	position: absolute;
	right: 12px;
	bottom: 10px;
	z-index: 1;
	font-size: 18px;
	opacity: .35;
	pointer-events: none !important;
	transition: opacity 220ms ease;
}

.hg-main-box:hover .hg-click-hint {
	opacity: .7;
}

.hg-thumbs-row,
.hg-modal-thumbs {
	display: flex;
	flex-direction: row;
	overflow-x: auto;
	scrollbar-width: thin;
}

.hg-thumbs-row {
	gap: 6px;
	padding: 2px 1px 4px;
	scrollbar-color: #ccc transparent;
}

.hg-thumbs-row::-webkit-scrollbar,
.hg-modal-thumbs::-webkit-scrollbar {
	height: 3px;
}

.hg-thumbs-row::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 3px;
}

.hg-t {
	flex-shrink: 0;
	width: 120px;
	height: 120px;
	padding: 2px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
	transition: border-color 160ms ease, box-shadow 160ms ease;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hg-t img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.hg-t:hover {
	border-color: #999;
}

.hg-t:focus-visible {
	outline: 2px solid #fdb913;
	outline-offset: 2px;
}

.hg-t-active {
	border-color: #498be3 !important;
	border-width: 1.5px !important;
}

.hg-lens {
	position: absolute;
	width: 188px;
	height: 188px;
	z-index: 50;
	border: 1px solid rgba(35, 47, 62, .34);
	border-radius: 4px;
	background: rgba(253, 185, 19, .16);
	box-shadow: 0 4px 16px rgba(35, 47, 62, .12);
	pointer-events: none !important;
	opacity: 0;
	visibility: hidden;
	transition: opacity 160ms ease, visibility 160ms ease;
}

.hg-lens.hg-on {
	opacity: 1;
	visibility: visible;
}

.hg-zoom-win {
	position: fixed;
	z-index: 99999;
	background-color: #fff;
	background-repeat: no-repeat;
	border: 1px solid rgba(35, 47, 62, .16);
	border-radius: 8px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
	overflow: hidden;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity 160ms ease, visibility 160ms ease;
}

.hg-zoom-win.hg-on {
	opacity: 1;
	visibility: visible;
}

.hg-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgb(230, 230, 230);
	align-items: stretch;
	justify-content: center;
}

.hg-modal.hg-modal-open {
	display: flex;
}

.hg-modal-inner {
	display: flex;
	flex-direction: row;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.hg-modal-gallery {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 40px 30px 30px;
	min-width: 0;
	background: #f7f7f7;
}

.hg-modal-main-wrap {
	flex: 1 1 auto;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	min-height: 0;
}

.hg-modal-img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
	border-radius: 4px;
	transition: opacity 160ms ease;
}

.hg-modal-img.hg-loading {
	opacity: .3;
}

.hg-modal-thumbs {
	gap: 8px;
	padding: 2px 4px 6px;
	max-width: 100%;
	scrollbar-color: #555 transparent;
}

.hg-modal-thumbs::-webkit-scrollbar-thumb {
	background: #555;
	border-radius: 3px;
}

.hg-mt {
	width: 120px;
	height: 120px;
	border: 1px solid #507196;
	background: #222;
	border-radius: 4px;
}

.hg-mt img {
	filter: brightness(.9);
}

.hg-mt:hover {
	border-color: #888;
}

.hg-mt.hg-t-active {
	border-color: #fff !important;
	border-width: 1.5px !important;
}

.hg-modal-info {
	width: 380px;
	min-width: 320px;
	max-width: 420px;
	background: #fff;
	display: flex;
	flex-direction: column;
	padding: 60px 32px 32px;
	overflow-y: auto;
	position: relative;
	flex-shrink: 0;
}

.hg-modal-close {
	position: absolute;
	top: 16px;
	right: 18px;
	width: 36px;
	height: 36px;
	border: none;
	background: #f2f2f2;
	border-radius: 50%;
	font-size: 16px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #333;
	transition: background 160ms ease;
	z-index: 10;
}

.hg-modal-close:hover {
	background: #e0e0e0;
}

.hg-modal-title h1,
.hg-modal-title .product_title {
	font-size: 20px !important;
	line-height: 1.3 !important;
	margin: 0 0 16px !important;
	color: #111 !important;
}

.hg-modal-price {
	margin-bottom: 20px;
	font-size: 22px;
}

.hg-modal-cart .quantity {
	display: flex;
	align-items: center;
	gap: 8px;
}

.hg-modal-cart .single_add_to_cart_button {
	width: 100% !important;
	margin-top: 12px !important;
	text-align: center !important;
}

@media (hover: none), (pointer: coarse) {
	.hg-main-box {
		cursor: default !important;
	}

	.hg-lens,
	.hg-zoom-win,
	.hg-click-hint {
		opacity: 0 !important;
		visibility: hidden !important;
	}
}

@media (max-width: 768px) {
	.hg-modal-inner {
		flex-direction: column;
	}

	.hg-modal-info {
		width: 100%;
		max-width: 100%;
		min-width: 0;
		padding: 20px 20px 80px;
		max-height: 50vh;
	}

	.hg-modal-gallery {
		padding: 20px 16px 10px;
	}
}

@media (max-width: 600px) {
	.hg-t {
		width: 56px;
		height: 56px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hg-img,
	.hg-click-hint,
	.hg-t,
	.hg-lens,
	.hg-zoom-win,
	.hg-modal-img,
	.hg-modal-close {
		transition: none !important;
	}
}
