/* EU GARAN label: nested-display strip under the gallery and the full label dialog. */

.tm-garan-strip {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	flex: none;
	width: 100%;
	max-width: 320px;
	height: auto;
	min-height: 0;
	margin: 10px auto 0;
	padding: 0;
	border: 0 !important;
	border-radius: 0;
	background: #fff;
	box-shadow: 0 0 0 1px #e3e3e3;
	cursor: pointer;
	line-height: 0;
}

/*
 * Desktop: the gallery is a 440px-high flex row (thumbs + viewport, row-reverse), so the strip is
 * taken out of the flow and sits under the main image, in the empty space of the left column.
 */
@media (min-width: 801px) {
	/* Room for the strip (12px gap + ~49px), for when the summary column is shorter than the gallery. */
	.single-product div.product .woocommerce-product-gallery:has(> .tm-garan-strip) {
		margin-bottom: 70px;
	}

	.single-product div.product .woocommerce-product-gallery > .tm-garan-strip {
		position: absolute;
		top: calc(100% + 12px);
		right: 60px; /* centred under the 440px viewport, which is right-aligned */
		width: 320px;
		margin: 0;
	}
}

/*
 * Mobile: flexslider inserts its viewport after the strip, and changing the gallery's display breaks
 * the slider, so space is reserved at the bottom of the gallery and the strip is placed in it.
 */
@media (max-width: 800px) {
	.single-product div.product .woocommerce-product-gallery:has(> .tm-garan-strip) {
		padding-bottom: 58px;
	}

	.single-product div.product .woocommerce-product-gallery > .tm-garan-strip {
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		width: calc(100% - 32px);
		margin: 0 auto;
	}
}

.tm-garan-strip svg {
	display: block;
	width: 100%;
	height: auto;
}

.tm-garan-strip:focus-visible,
.tm-garan-open:focus-visible,
.tm-garan-dialog__close:focus-visible {
	outline: 2px solid #034ea2;
	outline-offset: 2px;
}

.tm-garan-open {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: underline dotted;
	text-underline-offset: 3px;
	cursor: pointer;
}

.tm-garan-link {
	display: inline-block;
	margin-top: 2px;
	font-size: 12px;
	text-decoration: underline;
}

.tm-garan-dialog {
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: #fff;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
	max-width: 90vw;
	max-height: 90vh;
	overflow: auto;
}

.tm-garan-dialog::backdrop {
	background: rgba(0, 0, 0, 0.55);
}

.tm-garan-dialog__bar {
	display: flex;
	justify-content: flex-end;
	margin: 0;
	padding: 6px 6px 0;
}

.tm-garan-dialog__close {
	padding: 6px 10px;
	border: 0;
	background: none;
	color: #231f20;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
}

/* Full label at a size where the QR code scans from a screen; never distorted. */
.tm-garan-dialog__img {
	display: block;
	width: min(560px, calc(90vw - 24px), calc((90vh - 52px) * 0.95));
	min-width: min(300px, calc(90vw - 24px));
	height: auto;
	aspect-ratio: 269.29 / 283.46;
	margin: 0 auto;
	padding: 6px 12px 12px;
	box-sizing: content-box;
}

@media (max-width: 480px) {
	.tm-garan-dialog__img {
		width: calc(90vw - 24px);
		min-width: 0;
	}
}

/* ---------- EU legal guarantee notice (shares the GARAN dialog styles) ---------- */

.tm-legal-guarantee {
	max-width: 800px;
	margin: 0 0 24px;
}

.tm-legal-guarantee__img {
	display: block;
	width: 100%;
	height: auto;
}

.tm-legal-guarantee figcaption {
	margin-top: 8px;
}

.tm-legal-guarantee__pdf {
	font-size: 14px;
	text-decoration: underline;
}

.tm-legal-guarantee-open {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: underline dotted;
	text-underline-offset: 3px;
	cursor: pointer;
}

.tm-legal-guarantee-open:focus-visible {
	outline: 2px solid #034ea2;
	outline-offset: 2px;
}

/* 2-year products: the warranty row opens the notice; the icon sits a bit closer so it fits one line on desktop. */
.entry-summary .information-container .legal-guarantee {
	display: flex;
	align-items: flex-start;
}

.entry-summary .information-container .legal-guarantee i {
	flex: none;
	margin-right: 9px;
}

.entry-summary .information-container .legal-guarantee .tm-legal-guarantee-open {
	text-align: left;
}

/* Checkout: same size and indent as the terms / marketing checkbox rows above it. */
.tm-legal-guarantee-line {
	position: relative;
	margin: 0 0 12px;
	padding-left: 34px; /* checkbox rows: 3px .form-row padding + 30px label indent, +1px for the "З" side bearing */
	font-size: 16px;
	font-weight: 500;
	line-height: 2;
}

.tm-legal-guarantee-line i {
	position: absolute;
	top: 0;
	left: 6px;
	width: 20px;
	font-size: 20px;
	line-height: 32px;
	text-align: center;
	/* Same gradient as the "Поръчване" button. */
	color: #F06D50;
	background: linear-gradient(90deg, #F04F50 0%, #F08B50 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.tm-legal-guarantee-dialog .tm-garan-dialog__bar {
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 6px 0 12px;
}

/* A4 portrait, never distorted, readable on phones (zoomable inside the dialog). */
.tm-legal-guarantee-dialog__img {
	display: block;
	width: min(800px, calc(90vw - 24px), calc((90vh - 52px) * 0.707));
	min-width: min(320px, calc(90vw - 24px));
	height: auto;
	aspect-ratio: 595.28 / 841.89;
	margin: 0 auto;
	padding: 6px 12px 12px;
	box-sizing: content-box;
}
