/**
 * MarketUp Legal Guarantee & GARAN Label for WooCommerce — frontend.
 *
 * The official notice and GARAN label are never recoloured, cropped or
 * resized below a legible size; only the trigger box around them is styled.
 */

/* Inter (SIL OFL 1.1), the font required for the label's editable fields. */
@font-face {
	font-family: "ELG Inter";
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url("../fonts/inter-cyrillic-ext-wght-normal.woff2") format("woff2-variations");
	unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
	font-family: "ELG Inter";
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url("../fonts/inter-cyrillic-wght-normal.woff2") format("woff2-variations");
	unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
	font-family: "ELG Inter";
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url("../fonts/inter-greek-wght-normal.woff2") format("woff2-variations");
	unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
	font-family: "ELG Inter";
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
	unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "ELG Inter";
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.elg-screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Legal guarantee notice trigger ---------- */

.elg-notice {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 16px;
	margin: 16px 0;
	padding: 12px 16px;
	background: var(--elg-trigger-bg, #f0f4ff);
	border: 2px solid var(--elg-trigger-border, #003399);
	border-radius: 6px;
	color: #1a1a1a;
	font-size: 14px;
	line-height: 1.5;
	clear: both;
}

.elg-notice__trigger,
.elg-notice__trigger:visited {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: #003399;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.elg-notice__trigger:hover,
.elg-notice__trigger:focus-visible {
	color: #001f66;
}

.elg-notice__flag {
	display: block;
	flex: none;
	width: 27px;
	height: 18px;
}

.elg-notice__link,
.elg-notice__link:visited {
	color: #1a1a1a;
	font-size: 13px;
	word-break: break-word;
}

.elg-notice--cart,
.elg-notice--checkout {
	margin: 16px 0 24px;
}

/* ---------- Notice dialog ---------- */

.elg-dialog {
	width: min(680px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	overflow: auto;
	border: 0;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
}

.elg-dialog::backdrop {
	background: rgba(0, 0, 0, 0.6);
}

.elg-dialog__inner {
	position: relative;
	padding: 16px;
}

/*
 * The notice must stay legible at default display size. On narrow screens it
 * keeps a 600px minimum width and the dialog scrolls instead of shrinking it.
 */
.elg-dialog__notice {
	display: block;
	width: 100%;
	min-width: 600px;
	height: auto;
	max-width: none;
}

.elg-dialog__swipe {
	position: sticky;
	left: 0;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 10px;
	padding: 6px 12px;
	border-radius: 999px;
	background: #003399;
	color: #fff;
	font-size: 13px;
	line-height: 1.3;
}

.elg-dialog__swipe[hidden] {
	display: none;
}

.elg-dialog__swipe span {
	display: inline-block;
	animation: elg-swipe 1.2s ease-in-out infinite;
}

@keyframes elg-swipe {
	0%, 100% { transform: translateX(0); }
	50% { transform: translateX(5px); }
}

@media (prefers-reduced-motion: reduce) {
	.elg-dialog__swipe span {
		animation: none;
	}
}

.elg-dialog__close {
	position: sticky;
	top: 0;
	float: right;
	z-index: 1;
	width: 40px;
	height: 40px;
	margin: -8px -8px 8px 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #003399;
	color: #fff;
	font-size: 26px;
	line-height: 40px;
	cursor: pointer;
}

.elg-dialog__close:focus-visible {
	outline: 3px solid #ffed00;
	outline-offset: 2px;
}

.elg-dialog__link {
	margin: 12px 0 0;
	font-size: 14px;
	text-align: center;
}

/* ---------- GARAN label ---------- */

.elg-garan {
	position: relative;
	display: block;
	margin: 12px 0;
	max-width: 100%;
}

.elg-garan__details {
	display: inline-block;
	max-width: 100%;
}

.elg-garan__summary {
	display: block;
	list-style: none;
	cursor: pointer;
}

.elg-garan__summary::-webkit-details-marker {
	display: none;
}

.elg-garan__summary:focus-visible {
	outline: 3px solid #003399;
	outline-offset: 2px;
}

.elg-garan__nested {
	display: block;
	width: 220px;
	max-width: 100%;
	height: auto;
	border: 1px solid #231f20;
}

/*
 * Full label: 320px wide keeps the QR code above the 2 x 2 cm minimum.
 */
.elg-garan__full {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 1000;
	width: 336px;
	max-width: calc(100vw - 32px);
	padding: 8px;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
	box-sizing: border-box;
}

.elg-garan__label {
	display: block;
	width: 320px;
	max-width: 100%;
	height: auto;
}

.elg-garan__link {
	margin: 8px 0 0;
	font-size: 13px;
}

.elg-garan__terms {
	margin-top: 8px;
	font-size: 13px;
	line-height: 1.5;
}

.elg-garan__terms p {
	margin: 4px 0 0;
}

/* Cart and checkout: expand in place rather than as a popover. */
.elg-garan--cart .elg-garan__full,
.elg-garan--checkout .elg-garan__full {
	position: static;
	margin-top: 6px;
	box-shadow: none;
	border: 1px solid #ddd;
}

.elg-garan--cart .elg-garan__nested,
.elg-garan--checkout .elg-garan__nested {
	width: 180px;
}

.elg-garan-checkout {
	margin: 0 0 16px;
	padding: 12px 16px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
}

.elg-garan-checkout__title {
	margin: 0 0 8px;
	font-weight: 600;
}

.elg-garan-checkout__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.elg-garan-checkout__list li {
	margin: 0 0 8px;
}

.elg-garan-checkout__name {
	display: block;
	font-size: 14px;
}

@media (max-width: 768px) {
	.elg-notice {
		flex-direction: column;
		align-items: flex-start;
	}

	.elg-garan__full {
		position: static;
		margin-top: 6px;
		box-shadow: none;
		border: 1px solid #ddd;
	}
}
