/* =======================================================
   Voucher product page (Vouchers\ProductPage)
   Loaded only on voucher product pages; everything is
   scoped to body.mt-voucher-product.
   ======================================================= */

.mt-voucher-product {
	--mt-v-accent: var(--mf-color-brand, #ff3c00);
	--mt-v-surface: var(--mf-color-surface, #111);
	--mt-v-raised: #1c1c1c;
	--mt-v-raised-hover: #262626;
	--mt-v-muted: #9a9a9a;
	--mt-v-soft: #cfcfcf;

	/* Pixel corners as on monkeyfactory.at (.button-primary-pixel). */
	--mt-v-pix: polygon(0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px));
}

/* ---------- Layout: image left, summary right ---------- */
.mt-voucher-product div.product {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 56px;
	align-items: start;

	/* Side padding as on the rest of the site (.section: 20px), so the content
	   lines up with header and footer on smaller screens. Max width narrower
	   than the site content (1400px) on purpose: a full-width product card
	   looked too large (operator's decision). */
	max-width: 1240px;
	margin: 0 auto;
	padding: 48px 20px 72px;
	text-align: left;

	/* WooCommerce's hidden ".reset_variations_alert" (screen-reader text) gets the
	   viewport width here and would cause horizontal page scrolling. */
	overflow-x: clip;
}

.mt-voucher-product div.product > * {
	grid-column: 1 / -1;
}

/*
 * The theme sizes the gallery with an ID selector
 * (".woocommerce-page #content div.product div.images { width: 50% }"),
 * hence body + #content here.
 */
body.mt-voucher-product #content div.product div.images,
body.mt-voucher-product #content div.product div.summary {
	grid-column: auto;
	float: none;
	width: auto;
	margin: 0;
}

.mt-voucher-product div.product div.images {
	clip-path: var(--mt-v-pix);
}

/* Notices above the product (width in wc-notices.css): less space below. */
.mt-voucher-product .woocommerce-notices-wrapper:not(:empty) ~ div.product {
	padding-top: 32px;
}

/* ---------- Summary ---------- */
.mt-voucher-product div.product .product_title {
	margin: 0 0 12px;
}

.mt-voucher-product .mt-voucher-lead {
	margin: 0 0 28px;
	color: var(--mt-v-soft);
	font-size: 17px;
}

.mt-voucher-product .mt-voucher-lead p {
	margin: 0 0 0.6em;
}

/* German Market: no shipping or delivery time for vouchers. */
.mt-voucher-product .woocommerce_de_versandkosten,
.mt-voucher-product .shipping_de {
	display: none;
}

/* Variable vouchers: price of the chosen option replaces the range. */
.mt-voucher-product .product-type-variable .legacy-itemprop-offers {
	display: none;
}

.mt-voucher-product div.product .summary .price,
.mt-voucher-product .woocommerce-variation-price .price {
	display: inline-block;
	margin: 0 12px 0 0;
	color: #fff;
	font-size: 40px;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.03em;
}

.mt-voucher-product .woocommerce-de_price_taxrate {
	display: inline-block;
	color: var(--mt-v-muted);
	font-size: 14px;
}

.mt-voucher-product .woocommerce-variation-price,
.mt-voucher-product div.product .summary > .legacy-itemprop-offers {
	margin: 0 0 22px;
}

/* ---------- Options (variations as buttons) ---------- */
.mt-voucher-product .mt-voucher-options-label {
	display: block;
	margin: 0 0 10px;
	color: var(--mt-v-muted);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.mt-voucher-product .mt-voucher-options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
	gap: 10px;
	margin: 0 0 26px;
}

.mt-voucher-product .mt-voucher-option {
	clip-path: var(--mt-v-pix);
	padding: 14px 10px 12px;
	border: 0;
	border-radius: 0;
	background: var(--mt-v-raised);
	color: #fff;
	font: inherit;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.mt-voucher-product .mt-voucher-option:hover {
	background: var(--mt-v-raised-hover);
}

.mt-voucher-product .mt-voucher-option:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -4px;
}

.mt-voucher-product .mt-voucher-option__name {
	display: block;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.1;
}

.mt-voucher-product .mt-voucher-option__price {
	display: block;
	margin-top: 4px;
	color: var(--mt-v-muted);
	font-size: 15px;
}

.mt-voucher-product .mt-voucher-option.is-active {
	background: var(--mt-v-accent);
	color: #000;
}

.mt-voucher-product .mt-voucher-option.is-active .mt-voucher-option__price {
	color: #000;
	opacity: 0.75;
}

.mt-voucher-product form.mt-has-options table.variations,
.mt-voucher-product form.mt-has-options .reset_variations {
	display: none;
}

/* ---------- Quantity + add to cart ---------- */
.mt-voucher-product .woocommerce-variation-add-to-cart,
.mt-voucher-product div.product form.cart:not(.variations_form) {
	display: flex;
	gap: 12px;
	align-items: stretch;
}

.mt-voucher-product div.product form.cart .quantity {
	display: flex;
	align-items: stretch;
	float: none;
	margin: 0;
	clip-path: var(--mt-v-pix);
	background: var(--mt-v-raised);
}

.mt-voucher-product div.product form.cart .quantity .qty {
	width: 44px;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	line-height: 1;
	color: #fff;
	font-size: 20px;
	font-weight: 700;
	text-align: center;
	appearance: textfield;
}

.mt-voucher-product div.product form.cart .quantity .qty::-webkit-outer-spin-button,
.mt-voucher-product div.product form.cart .quantity .qty::-webkit-inner-spin-button {
	margin: 0;
	appearance: none;
}

.mt-voucher-product .mt-voucher-qty-btn {
	width: 52px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #fff;
	font: inherit;
	font-size: 24px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
}

.mt-voucher-product .mt-voucher-qty-btn:hover,
.mt-voucher-product .mt-voucher-qty-btn:focus-visible {
	color: var(--mt-v-accent);
}

.mt-voucher-product .mt-voucher-qty-btn:disabled {
	opacity: 0.3;
	cursor: default;
}

.mt-voucher-product div.product form.cart .single_add_to_cart_button {
	flex: 1;
	clip-path: var(--mt-v-pix);
	float: none;
	padding: 20px 24px;
	border: 0;
	border-radius: 0;
	background: var(--mt-v-accent);
	color: #000;
	font-size: 17px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

/* Hover as the primary buttons on monkeyfactory.at: white. */
.mt-voucher-product div.product form.cart .single_add_to_cart_button:not(.disabled):hover,
.mt-voucher-product div.product form.cart .single_add_to_cart_button:not(.disabled):focus-visible {
	background: #fff;
	color: #000;
}

.mt-voucher-product div.product form.cart .single_add_to_cart_button.disabled {
	opacity: 0.5;
}

/* ---------- Hints ---------- */
.mt-voucher-product .mt-voucher-hint,
.mt-voucher-product .mt-voucher-legal,
.mt-voucher-product .german-market-summary-gpsr {
	display: block;
	margin: 12px 0 0;
	color: var(--mt-v-muted);
	font-size: 14px;
}

.mt-voucher-product .mt-voucher-legal {
	font-size: 13px;
}

.mt-voucher-product .mt-voucher-legal a {
	color: inherit;
	text-decoration: underline;
	transition: color 0.15s ease;
}

.mt-voucher-product .mt-voucher-legal a:hover,
.mt-voucher-product .mt-voucher-legal a:focus-visible {
	color: #fff;
}

/* ---------- Description ----------
   The steps below the product come from a GeneratePress block element. */
.mt-voucher-product .mt-voucher-description {
	max-width: 760px;
	color: var(--mt-v-soft);
	font-size: 17px;
}

/* ---------- Small desktops / laptops ---------- */
@media (max-width: 1200px) {

	.mt-voucher-product div.product {
		gap: 40px;
	}
}

/* ---------- Tablet and mobile (compact purchase block) ----------
   Breakpoints as in GenerateBlocks (site content): tablet up to 1024px,
   mobile up to 767px. */
@media (max-width: 1024px) {

	.mt-voucher-product div.product {
		gap: 28px;
		padding-top: 32px;
	}

	.mt-voucher-product div.product .product_title {
		font-size: 30px;
	}

	/* 3 options in one row, 4 options as 2 × 2. */
	.mt-voucher-product .mt-voucher-options {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 8px;
	}

	.mt-voucher-product .mt-voucher-options[data-count="2"],
	.mt-voucher-product .mt-voucher-options[data-count="4"] {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mt-voucher-product .mt-voucher-option {
		padding: 12px 6px 10px;
	}

	.mt-voucher-product .mt-voucher-option__name {
		font-size: 18px;
	}

	/* Mobile: quantity on its own full-width row, button full width below. */
	.mt-voucher-product .woocommerce-variation-add-to-cart,
	.mt-voucher-product div.product form.cart:not(.variations_form) {
		flex-direction: column;
	}

	.mt-voucher-product div.product form.cart .quantity {
		justify-content: space-between;
		width: 100%;
	}

	.mt-voucher-product div.product form.cart .quantity .qty {
		flex: 1;
	}

	.mt-voucher-product .mt-voucher-qty-btn {
		width: 64px;
		min-height: 56px;
	}

	.mt-voucher-product div.product form.cart .single_add_to_cart_button {
		width: 100%;
		padding: 20px 14px;
		font-size: 16px;
	}
}

/* ---------- Mobile (GenerateBlocks: up to 767px): one column ---------- */
@media (max-width: 767px) {

	.mt-voucher-product div.product {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}

	.mt-voucher-product div.product .product_title {
		font-size: 34px;
	}
}
