/*
 * JustDSL Quick View window. The buy box (price, sizes, quantity, button)
 * comes from product.css through .jdsl-pd / .jdsl-pd__summary; this file
 * is the window and its photos.
 */

/* Card button: white next to the black "Επιλογή". */
.jdsl-shop ul.products li.product .jdsl-card__actions .button.jdsl-qv-btn {
	background: #fff !important;
	color: var(--jd-black) !important;
}

.jdsl-shop ul.products li.product .jdsl-card__actions .button.jdsl-qv-btn:hover,
.jdsl-shop ul.products li.product .jdsl-card__actions .button.jdsl-qv-btn:focus-visible {
	background: var(--jd-black) !important;
	color: #fff !important;
}

/* ------------------------------------------------------------------ *
 * Window
 * ------------------------------------------------------------------ */

html.jdsl-qv-open {
	overflow: hidden;
}

.jdsl-qv {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.jdsl-qv[hidden] {
	display: none;
}

.jdsl-qv__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 17, 17, .55);
	opacity: 0;
	transition: opacity .2s ease;
}

.jdsl-qv.is-open .jdsl-qv__backdrop {
	opacity: 1;
}

.jdsl-shop.jdsl-pd.jdsl-qv__panel {
	--jd-radius: 8px;
	position: relative;
	width: min(1000px, 100%);
	max-width: none;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	margin: 0;
	padding: 0;
	overflow: hidden;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
	opacity: 0;
	transform: translateY(12px) scale(.985);
	transition: opacity .2s ease, transform .2s ease;
}

.jdsl-qv.is-open .jdsl-qv__panel {
	opacity: 1;
	transform: none;
}

.jdsl-qv__panel:focus {
	outline: none;
}

.jdsl-shop .jdsl-qv__close,
.jdsl-shop .jdsl-qv__close:hover,
.jdsl-shop .jdsl-qv__close:focus {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--jd-line);
	border-radius: 50%;
	background: #fff;
	color: var(--jd-black);
	cursor: pointer;
	transition: background .15s, color .15s, border-color .15s;
}

.jdsl-shop .jdsl-qv__close:hover,
.jdsl-shop .jdsl-qv__close:focus-visible {
	border-color: var(--jd-black);
	background: var(--jd-black);
	color: #fff;
}

.jdsl-qv__body {
	max-height: inherit;
}

.jdsl-qv__loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 320px;
	color: var(--jd-muted);
	font-size: 14px;
}

.jdsl-qv__spinner {
	width: 22px;
	height: 22px;
	border: 2px solid var(--jd-line);
	border-top-color: var(--jd-black);
	border-radius: 50%;
	animation: jdsl-qv-spin .7s linear infinite;
}

@keyframes jdsl-qv-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Layout: photos | buy box */
.jdsl-qv__product {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	max-height: inherit;
}

/* ------------------------------------------------------------------ *
 * Photos
 * ------------------------------------------------------------------ */

.jdsl-qv__media {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 0;
	padding: 20px;
	background: var(--jd-soft);
}

.jdsl-qv__stage {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
	border-radius: var(--jd-radius);
	background: #fff;
}

.jdsl-qv__stage .jdsl-qv__img {
	display: block;
	width: 100%;
	height: 100%;
	max-height: calc(100vh - 200px);
	max-height: calc(100dvh - 200px);
	aspect-ratio: 4 / 5;
	object-fit: cover;
	border-radius: 0;
}

.jdsl-shop .jdsl-qv__nav,
.jdsl-shop .jdsl-qv__nav:hover,
.jdsl-shop .jdsl-qv__nav:focus {
	position: absolute;
	top: 50%;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	margin-top: -19px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: var(--jd-black);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
	cursor: pointer;
	opacity: 0;
	transition: opacity .15s, background .15s, color .15s;
}

.jdsl-shop .jdsl-qv__nav--prev {
	left: 12px;
}

.jdsl-shop .jdsl-qv__nav--next {
	right: 12px;
}

.jdsl-qv__stage:hover .jdsl-qv__nav,
.jdsl-shop .jdsl-qv__nav:focus-visible {
	opacity: 1;
}

.jdsl-shop .jdsl-qv__nav:hover {
	background: var(--jd-black);
	color: #fff;
}

.jdsl-qv__thumbs {
	display: flex;
	gap: 8px;
	flex: 0 0 auto;
	overflow-x: auto;
	scrollbar-width: none;
}

.jdsl-qv__thumbs::-webkit-scrollbar {
	display: none;
}

.jdsl-shop .jdsl-qv__thumb,
.jdsl-shop .jdsl-qv__thumb:hover,
.jdsl-shop .jdsl-qv__thumb:focus {
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	padding: 0;
	overflow: hidden;
	border: 1px solid transparent;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	opacity: .6;
	transition: opacity .15s, border-color .15s;
}

.jdsl-shop .jdsl-qv__thumb:hover,
.jdsl-shop .jdsl-qv__thumb.is-active {
	opacity: 1;
}

.jdsl-shop .jdsl-qv__thumb.is-active {
	border-color: var(--jd-black);
}

.jdsl-qv__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ------------------------------------------------------------------ *
 * Buy box (most of it from product.css)
 * ------------------------------------------------------------------ */

/* WooCommerce's single-product layout (.woocommerce div.product div.summary
   { float; width: 48% }) applies on shop pages; the grid sizes the columns. */
.jdsl-qv .jdsl-qv__product div.summary,
.jdsl-qv .jdsl-qv__product div.images {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
}

.jdsl-pd .jdsl-pd__summary.jdsl-qv__summary {
	position: static;
	min-height: 0;
	padding: 40px 36px 32px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.jdsl-qv__cat {
	margin: 0 48px 8px 0;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--jd-muted);
}

.jdsl-qv .product_title {
	margin-right: 40px;
	font-size: clamp(20px, 2vw, 26px);
}

.jdsl-qv .jdsl-pd__summary p.price,
.jdsl-qv .jdsl-pd__summary .woocommerce-variation-price .price {
	font-size: 22px;
}

.jdsl-qv .jdsl-qv__excerpt {
	margin-bottom: 20px;
	font-size: 14px;
	line-height: 1.6;
	color: var(--jd-muted);
}

.jdsl-qv form.cart {
	margin-bottom: 16px !important;
}

.jdsl-qv button.single_add_to_cart_button.loading {
	opacity: .6;
	pointer-events: none;
}

/* Result of add to cart */
.jdsl-qv__msg {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
	margin: 0 0 16px;
	padding: 12px 14px;
	border-radius: var(--jd-radius);
	font-size: 14px;
	line-height: 1.45;
}

.jdsl-qv__msg[hidden] {
	display: none;
}

.jdsl-qv__msg.is-added {
	background: #eef7f0;
	color: #1d5f32;
}

.jdsl-qv__msg.is-error {
	background: #fdeeee;
	color: #9b1c1c;
}

.jdsl-qv__msg-text {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
}

.jdsl-qv__msg-actions {
	display: inline-flex;
	align-items: center;
	gap: 14px;
}

.jdsl-shop a.jdsl-qv__msg-cart {
	font-weight: 600;
	color: var(--jd-black);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.jdsl-shop .jdsl-qv__msg-continue,
.jdsl-shop .jdsl-qv__msg-continue:hover,
.jdsl-shop .jdsl-qv__msg-continue:focus {
	padding: 0;
	border: 0;
	background: none;
	color: var(--jd-muted);
	font: inherit;
	cursor: pointer;
}

.jdsl-shop .jdsl-qv__msg-continue:hover {
	color: var(--jd-black);
}

.jdsl-shop a.jdsl-qv__more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	align-self: flex-start;
	margin-top: 4px;
	padding-top: 16px;
	border-top: 1px solid var(--jd-line);
	width: 100%;
	font-size: 14px;
	font-weight: 600;
	color: var(--jd-black);
}

.jdsl-shop a.jdsl-qv__more:hover {
	color: var(--jd-red);
}

.jdsl-shop a.jdsl-qv__more svg {
	transition: transform .15s;
}

.jdsl-shop a.jdsl-qv__more:hover svg {
	transform: translateX(3px);
}

/* ------------------------------------------------------------------ *
 * Phones: a sheet from the bottom, photo on top
 * ------------------------------------------------------------------ */

@media (max-width: 760px) {
	.jdsl-qv {
		align-items: flex-end;
		padding: 0;
	}

	.jdsl-shop.jdsl-pd.jdsl-qv__panel {
		width: 100%;
		max-height: 92vh;
		max-height: 92dvh;
		border-radius: 16px 16px 0 0;
		transform: translateY(40px);
	}

	.jdsl-qv__body {
		overflow-y: auto;
		overscroll-behavior: contain;
		max-height: 92vh;
		max-height: 92dvh;
	}

	.jdsl-qv__product {
		display: block;
		max-height: none;
	}

	.jdsl-qv__media {
		padding: 12px 12px 10px;
	}

	/* Portrait photo, as tall as half the screen allows. */
	.jdsl-qv__stage {
		align-self: center;
		height: min(52vh, calc((100vw - 24px) * 1.25));
		height: min(52dvh, calc((100vw - 24px) * 1.25));
		aspect-ratio: 4 / 5;
	}

	.jdsl-qv__stage .jdsl-qv__img {
		max-height: none;
		aspect-ratio: auto;
	}

	.jdsl-qv__thumbs {
		justify-content: center;
	}

	/* No hover on touch: arrows always shown. */
	.jdsl-shop .jdsl-qv__nav {
		opacity: 1;
	}

	.jdsl-shop .jdsl-qv__thumb {
		flex-basis: 52px;
		width: 52px;
		height: 52px;
	}

	.jdsl-pd .jdsl-pd__summary.jdsl-qv__summary {
		padding: 20px 18px 28px;
		overflow: visible;
	}

	.jdsl-shop .jdsl-qv__close {
		top: 10px;
		right: 10px;
		width: 36px;
		height: 36px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jdsl-qv__backdrop,
	.jdsl-shop.jdsl-pd.jdsl-qv__panel {
		transition: none;
	}
}
