/* ===== PDP gallery (template: woocommerce/single-product/product-image.php, JS: assets/js/pdp-gallery.js) ===== */

.single-product div.product .lino-gallery {
	--lg-accent: #972f67;
	--lg-border: #e3d7de;
	--lg-soft: #faf2f6;
	--lg-radius: 10px;
	--lg-thumb: 68px;
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 12px;
	float: none !important;
	width: 100% !important;
	min-width: 0;
	margin: 0 0 24px !important;
	padding: 0;
	border: 0;
	box-shadow: none;
	opacity: 1 !important;
}

/* --- Σκηνή (κύρια εικόνα) --- */
.lino-gallery__stage {
	position: relative;
	min-width: 0;
	aspect-ratio: var(--lg-ratio, 1 / 1);
	border: 1px solid var(--lg-border);
	border-radius: var(--lg-radius);
	background: #fff;
	overflow: hidden;
}
.lino-gallery__track {
	position: absolute;
	inset: 0;
	display: flex;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	outline: 0;
}
.lino-gallery__track::-webkit-scrollbar {
	display: none;
}
.lino-gallery__track:focus-visible {
	box-shadow: inset 0 0 0 2px var(--lg-accent);
	border-radius: var(--lg-radius);
}
.lino-gallery .woocommerce-product-gallery__image,
.lino-gallery .woocommerce-product-gallery__image--placeholder {
	position: relative;
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	margin: 0;
	overflow: hidden;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}
.lino-gallery .woocommerce-product-gallery__image a {
	display: block;
	width: 100%;
	height: 100%;
	cursor: zoom-in;
	outline: 0;
	-webkit-tap-highlight-color: transparent;
}
.single-product div.product .lino-gallery .lino-gallery__track img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	object-fit: contain;
	border-radius: 0;
	-webkit-user-select: none;
	user-select: none;
}

/* Hover zoom (desktop): η μεγάλη εικόνα πάνω από την κανονική, με κέντρο μεγέθυνσης τον κέρσορα */
.single-product div.product .lino-gallery .lino-gallery__track img.lino-gallery__zoom {
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	transform: scale(1);
	transition: opacity .18s ease, transform .22s ease;
	will-change: transform;
	background: #fff;
}
.single-product div.product .lino-gallery .is-zooming img.lino-gallery__zoom.is-loaded {
	opacity: 1;
	transform: scale(var(--lg-zoom, 2));
}

/* --- Κουμπιά πάνω στη σκηνή --- */
.lino-gallery__nav,
.lino-gallery__expand,
.lino-lightbox__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--lg-border, #e3d7de);
	border-radius: 50%;
	background: rgba(255, 255, 255, .94);
	color: var(--lg-accent, #972f67);
	box-shadow: 0 1px 4px rgba(60, 20, 40, .1);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background-color .15s ease, border-color .15s ease, opacity .15s ease, transform .15s ease;
}
.lino-gallery__nav:hover,
.lino-gallery__expand:hover,
.lino-lightbox__btn:hover {
	background: var(--lg-soft, #faf2f6);
	border-color: #d3b9c6;
	color: var(--lg-accent, #972f67);
}
.lino-gallery__nav:focus,
.lino-gallery__expand:focus,
.lino-lightbox__btn:focus,
.lino-gallery__thumb:focus {
	outline: 0;
}
.lino-gallery__nav:focus-visible,
.lino-gallery__expand:focus-visible,
.lino-lightbox__btn:focus-visible {
	border-color: var(--lg-accent, #972f67);
	box-shadow: 0 0 0 3px rgba(151, 47, 103, .18);
}
.lino-gallery__nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	margin-top: -20px;
}
.lino-gallery__nav--prev {
	left: 10px;
}
.lino-gallery__nav--next {
	right: 10px;
}
.lino-gallery__nav[disabled] {
	opacity: 0 !important;
	pointer-events: none;
}
.lino-gallery__expand {
	position: absolute;
	right: 10px;
	bottom: 10px;
	z-index: 3;
}
.lino-gallery__counter {
	position: absolute;
	left: 10px;
	bottom: 10px;
	z-index: 3;
	padding: 4px 10px;
	border: 1px solid var(--lg-border);
	border-radius: 999px;
	background: rgba(255, 255, 255, .94);
	color: #54595f;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	font-variant-numeric: tabular-nums;
	pointer-events: none;
}
/* σήματα που κρεμιούνται στο woocommerce_product_thumbnails / μεταφέρονται στη σκηνή */
.lino-gallery__stage .sale-perc,
.lino-gallery__stage .discount-percentage,
.lino-gallery__stage .wecom-sheets-pdp-badge {
	z-index: 3;
	pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
	.lino-gallery__nav {
		opacity: 0;
	}
	.lino-gallery__stage:hover .lino-gallery__nav,
	.lino-gallery__nav:focus-visible {
		opacity: 1;
	}
}

/* --- Thumbnails --- */
.lino-gallery__thumbs {
	position: relative;
	min-width: 0;
}
.lino-gallery__thumbs-scroll {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 2px;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.lino-gallery__thumbs-scroll::-webkit-scrollbar {
	display: none;
}
.lino-gallery__thumb,
.lino-lightbox__thumb {
	flex: 0 0 auto;
	width: var(--lg-thumb, 68px);
	height: var(--lg-thumb, 68px);
	padding: 0;
	border: 1px solid var(--lg-border, #e3d7de);
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
	cursor: pointer;
	opacity: .78;
	-webkit-tap-highlight-color: transparent;
	transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.lino-gallery__thumb:hover,
.lino-lightbox__thumb:hover {
	border-color: #d3b9c6;
	background: #fff;
	opacity: 1;
}
.lino-gallery__thumb[aria-current="true"],
.lino-lightbox__thumb[aria-current="true"] {
	border-color: var(--lg-accent, #972f67);
	box-shadow: 0 0 0 1px var(--lg-accent, #972f67);
	opacity: 1;
}
.lino-gallery__thumb:focus-visible,
.lino-lightbox__thumb:focus-visible {
	outline: 0;
	border-color: var(--lg-accent, #972f67);
	box-shadow: 0 0 0 3px rgba(151, 47, 103, .22);
	opacity: 1;
}
.single-product div.product .lino-gallery .lino-gallery__thumb img,
.lino-lightbox__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	max-height: none;
	margin: 0;
	object-fit: cover;
	border-radius: 0;
}

/* Desktop: thumbnails σε στήλη αριστερά, στο ύψος της σκηνής· το gallery χωρά στην οθόνη και μένει sticky */
@media (min-width: 992px) {
	.single-product div.product .lino-gallery {
		grid-column: 1;
		position: sticky;
		top: 118px;
		align-self: start;
		justify-self: center; /* όταν στενεύει (π.χ. κάθετη φωτογραφία) μένει στο κέντρο της στήλης του */
		margin-bottom: 30px !important;
		/* Για να χωρά στην οθόνη στενεύει ΟΛΟ το gallery (όχι μόνο το ύψος της σκηνής): η σκηνή κρατά πάντα
		   την αναλογία της εικόνας, άρα δεν μένουν κενά δεξιά-αριστερά. */
		--lg-stage-h: max(420px, calc(100vh - 235px));
		max-width: calc(var(--lg-stage-h) * var(--lg-ratio, 1));
	}
	.single-product div.product .lino-gallery--multi {
		grid-template-columns: calc(var(--lg-thumb) + 4px) minmax(0, 1fr);
		max-width: calc(var(--lg-stage-h) * var(--lg-ratio, 1) + var(--lg-thumb) + 16px);
	}
	.lino-gallery__thumbs-scroll {
		position: absolute;
		inset: 0;
		flex-direction: column;
		overflow-x: hidden;
		overflow-y: auto;
	}
	.lino-gallery__counter {
		display: none;
	}
}

/* Tablet / κινητό: σκηνή πάνω, thumbnails σε οριζόντια λωρίδα από κάτω */
@media (max-width: 991px) {
	.single-product div.product .lino-gallery {
		max-width: 560px;
		margin-left: auto !important;
		margin-right: auto !important;
		--lg-thumb: 60px;
	}
	.lino-gallery__thumbs {
		order: 2;
	}
	.lino-gallery__nav {
		display: none;
	}
}

/* ===== Lightbox με zoom ===== */
html.lino-lightbox-open {
	overflow: hidden;
}
.lino-lightbox {
	--lg-accent: #972f67;
	--lg-border: #e3d7de;
	--lg-soft: #faf2f6;
	--lg-thumb: 60px;
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	flex-direction: column;
	background: #fff;
	color: #54595f;
	opacity: 0;
	transition: opacity .18s ease;
}
.lino-lightbox[hidden] {
	display: none;
}
.lino-lightbox.is-open {
	opacity: 1;
}
.lino-lightbox__bar {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border-bottom: 1px solid #f1e8ed;
}
.lino-lightbox__counter {
	margin-right: auto;
	font-size: 14px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.lino-lightbox__viewport {
	position: relative;
	flex: 1 1 0;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	touch-action: none;
	cursor: zoom-in;
	-webkit-user-select: none;
	user-select: none;
}
.lino-lightbox.is-zoomed .lino-lightbox__viewport {
	cursor: zoom-out;
}
.lino-lightbox__viewport img.lino-lightbox__img {
	flex: 0 0 auto;
	display: block;
	max-width: none;
	max-height: none;
	margin: 0;
	border-radius: 0;
	transform-origin: 50% 50%;
	will-change: transform;
	-webkit-user-drag: none;
	pointer-events: none;
}
.lino-lightbox__img.is-animated {
	transition: transform .22s ease;
}
.lino-lightbox__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	margin-top: -20px;
}
.lino-lightbox__nav--prev {
	left: 14px;
}
.lino-lightbox__nav--next {
	right: 14px;
}
.lino-lightbox__nav[disabled] {
	opacity: .35;
	pointer-events: none;
}
.lino-lightbox__thumbs {
	flex: 0 0 auto;
	display: flex;
	gap: 8px;
	justify-content: safe center;
	padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid #f1e8ed;
	overflow-x: auto;
	scrollbar-width: none;
}
.lino-lightbox__thumbs::-webkit-scrollbar {
	display: none;
}
@media (max-width: 767px) {
	.lino-lightbox__nav {
		display: none;
	}
	.lino-lightbox {
		--lg-thumb: 52px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lino-gallery__track {
		scroll-behavior: auto;
	}
	.lino-lightbox,
	.lino-lightbox__img.is-animated,
	.single-product div.product .lino-gallery .lino-gallery__track img.lino-gallery__zoom {
		transition: none;
	}
}
