/* Voucher storefront — face value + Our best offer + product media */

.cv-offer {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.35rem;
	line-height: 1.25;
	width: 100%;
}

.cv-offer__face {
	display: block;
	font-size: 0.8rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: #5b6570;
	letter-spacing: 0.01em;
}

.cv-offer__best {
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-start;
	gap: 0.15rem;
	width: 100%;
}

.cv-offer__label {
	display: block !important;
	width: 100%;
	font-size: 0.62rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #8a7350;
}

.cv-offer__price {
	display: block !important;
	width: 100%;
	font-size: 1.05rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: #1a7a4c;
	letter-spacing: -0.02em;
}

.cv-offer__price .woocommerce-Price-amount,
.cv-offer__price .amount {
	font-weight: inherit;
	color: inherit;
}

.cv-offer__price del {
	display: inline-block;
	margin-right: 0.4rem;
	font-size: 0.85em;
	font-weight: 500;
	color: #9aa5b1;
}

.cv-offer__price ins {
	text-decoration: none;
}

/* Catalog cards nest .cv-offer inside .cv-card__price */
.cv-card__price .cv-offer {
	gap: 0.3rem;
}

.cv-card__price .cv-offer__face {
	color: #9aa5b1;
	font-size: 0.85rem;
}

.cv-card__price .cv-offer__label {
	color: #d4a84b;
}

.cv-card__price .cv-offer__price {
	font-size: 1.1rem;
	color: #f0b429;
}

/* —— Shop / product collection / classic loop: equal-height cards, aligned CTAs —— */

/* Force equal-height rows (theme uses floats; height:100% alone is not enough) */
.woocommerce ul.products,
ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.75rem 1.25rem;
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
	clear: both;
	width: 100%;
}

.woocommerce ul.products.columns-2,
ul.products.columns-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.woocommerce ul.products.columns-3,
ul.products.columns-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.woocommerce ul.products.columns-5,
ul.products.columns-5 {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.woocommerce ul.products.columns-6,
ul.products.columns-6 {
	grid-template-columns: repeat(6, minmax(0, 1fr));
}

.woocommerce ul.products::before,
.woocommerce ul.products::after,
ul.products::before,
ul.products::after {
	content: none !important;
	display: none !important;
}

@media (max-width: 900px) {
	.woocommerce ul.products,
	ul.products,
	.woocommerce ul.products.columns-3,
	ul.products.columns-3,
	.woocommerce ul.products.columns-4,
	ul.products.columns-4,
	.woocommerce ul.products.columns-5,
	ul.products.columns-5,
	.woocommerce ul.products.columns-6,
	ul.products.columns-6 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 520px) {
	.woocommerce ul.products,
	ul.products,
	.woocommerce ul.products.columns-2,
	ul.products.columns-2,
	.woocommerce ul.products.columns-3,
	ul.products.columns-3,
	.woocommerce ul.products.columns-4,
	ul.products.columns-4 {
		grid-template-columns: 1fr;
	}
}


.wc-block-product-template .wc-block-product,
ul.products li.product,
ul.products.columns-4 li.product,
.woocommerce ul.products li.product {
	display: flex !important;
	flex-direction: column !important;
	height: auto !important;
	min-height: 100%;
	width: auto !important;
	max-width: none !important;
	float: none !important;
	clear: none !important;
	margin: 0 !important;
	box-sizing: border-box;
}

/* Classic loop: equal image stage so Add to cart lines up */
ul.products li.product .woocommerce-LoopProduct-link > img,
ul.products li.product img.attachment-woocommerce_thumbnail,
ul.products li.product img.size-woocommerce_thumbnail {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	height: 170px !important;
	object-fit: contain !important;
	object-position: center center !important;
	margin-left: auto;
	margin-right: auto;
}

/* Classic loop: title+price live inside the product link */
ul.products li.product .woocommerce-LoopProduct-link,
ul.products li.product a.woocommerce-loop-product__link {
	display: flex !important;
	flex-direction: column !important;
	flex: 1 1 auto;
	width: 100%;
}

.wc-block-product-template .wc-block-product > .wp-block-post-title,
ul.products li.product .woocommerce-loop-product__title,
ul.products li.product h2,
ul.products li.product h3,
ul.products li.product .wp-block-post-title {
	display: block !important;
	overflow: visible !important;
	-webkit-line-clamp: unset;
	line-clamp: unset;
	text-overflow: unset;
	white-space: normal !important;
	font-size: 0.88rem !important;
	font-weight: 600;
	line-height: 1.4 !important;
	min-height: 0 !important;
	max-height: none !important;
	margin: 0.4rem 0 0.35rem !important;
	padding: 0;
	hyphens: manual;
	overflow-wrap: anywhere;
	word-break: normal;
}


/* Plain prices without .cv-offer still fill the same stage */
ul.products li.product .woocommerce-LoopProduct-link > .price,
ul.products li.product .woocommerce-LoopProduct-link > .woocommerce-Price-amount {
	margin-top: auto !important;
}

/* Price sits at bottom of the link area so buttons line up under it */
.wc-block-product-template .wc-block-product > .wp-block-group:has(.wp-block-woocommerce-product-price),
.wc-block-product-template .wc-block-product > .wp-block-woocommerce-product-price,
.wc-block-product-template .wc-block-product > .wc-block-components-product-price,
ul.products li.product .price {
	margin-top: auto !important;
	width: 100%;
}

.wc-block-product-template .wc-block-product .wp-block-woocommerce-product-price,
.wc-block-product-template .wc-block-product .wc-block-components-product-price,
ul.products li.product .price {
	/* Same stage for voucher offers AND plain prices (Flexepin/Neosurf/etc.) */
	min-height: 4.25rem;
	display: flex !important;
	flex-direction: column !important;
	justify-content: flex-end;
	box-sizing: border-box;
	font-size: 0.95rem !important;
	line-height: 1.3;
}

ul.products li.product .price .woocommerce-Price-amount,
ul.products li.product .price .amount,
.wc-block-product .wc-block-components-product-price .woocommerce-Price-amount {
	font-size: 0.95rem !important;
	font-weight: 700;
}

ul.products li.product .cv-offer {
	gap: 0.2rem;
}

ul.products li.product .cv-offer__face {
	font-size: 0.75rem;
}

ul.products li.product .cv-offer__label {
	font-size: 0.58rem;
}

ul.products li.product .cv-offer__price {
	font-size: 0.95rem !important;
	font-weight: 700;
}

ul.products li.product .cv-offer__price .woocommerce-Price-amount,
ul.products li.product .cv-offer__price .amount {
	font-size: inherit !important;
}

.wc-block-product-template .wc-block-product .wp-block-button,
.wc-block-product-template .wc-block-product .wp-block-woocommerce-product-button,
.wc-block-product-template .wc-block-product .wc-block-components-product-button,
ul.products li.product > .button,
ul.products li.product > a.button,
ul.products li.product > .add_to_cart_button,
ul.products li.product a.add_to_cart_button {
	margin-top: auto !important;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
	align-self: stretch;
}

/* Block product collection: pin CTA when it is the last child */
.wc-block-product-template .wc-block-product > .wp-block-button:last-child,
.wc-block-product-template .wc-block-product > .wp-block-woocommerce-product-button:last-child,
.wc-block-product-template .wc-block-product > .wc-block-components-product-button:last-child {
	margin-top: auto !important;
}

/* —— Single product media: show full portrait gift card, not square-crop —— */
body.cv-voucher-product .wp-block-woocommerce-product-gallery,
body.cv-voucher-product .woocommerce-product-gallery,
body.cv-voucher-product .wc-block-components-product-gallery {
	--cv-media-bg: #eef3f8;
	background:
		radial-gradient(ellipse at 30% 20%, rgba(29, 78, 137, 0.12), transparent 55%),
		linear-gradient(160deg, #f4f7fb 0%, #e8eef5 100%);
	border: 1px solid rgba(26, 40, 55, 0.08);
	border-radius: 16px;
	padding: 1rem 1.15rem;
	overflow: hidden;
	box-shadow: 0 10px 28px -12px rgba(15, 35, 60, 0.18);
	max-width: 420px;
	width: 100%;
}

body.cv-voucher-product--gmc .wp-block-woocommerce-product-gallery,
body.cv-voucher-product--gmc .woocommerce-product-gallery,
body.cv-voucher-product--gmc .wc-block-components-product-gallery {
	background:
		radial-gradient(ellipse at 30% 20%, rgba(15, 107, 92, 0.14), transparent 55%),
		linear-gradient(160deg, #eef8f5 0%, #e2f0eb 100%);
}

body.cv-voucher-product .wp-block-woocommerce-product-gallery img,
body.cv-voucher-product .woocommerce-product-gallery__image img,
body.cv-voucher-product .woocommerce-product-gallery__wrapper img,
body.cv-voucher-product .wc-block-woocommerce-product-gallery-large-image img,
body.cv-voucher-product .wc-block-components-product-image img,
body.cv-voucher-product img.wc-block-woocommerce-product-gallery-large-image__image,
body.cv-voucher-product img[data-testid="product-image"] {
	object-fit: contain !important;
	object-position: center center !important;
	width: auto !important;
	max-width: 100% !important;
	height: auto !important;
	max-height: min(480px, 65vh) !important;
	aspect-ratio: auto !important;
	margin-inline: auto;
	display: block;
	border-radius: 14px;
	box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.28);
	background: transparent;
}

body.cv-voucher-product .wc-block-components-product-image--aspect-ratio-1,
body.cv-voucher-product .wc-block-components-product-image[style*="aspect-ratio"] {
	aspect-ratio: auto !important;
}

body.cv-voucher-product .wc-block-components-product-image img[style*="aspect-ratio"] {
	aspect-ratio: auto !important;
}

/* Block gallery often locks a square stage — let portrait cards set height. */
body.cv-voucher-product .wp-block-woocommerce-product-gallery > *,
body.cv-voucher-product .wc-block-woocommerce-product-gallery-large-image,
body.cv-voucher-product .wc-block-woocommerce-product-gallery-large-image__inner,
body.cv-voucher-product .woocommerce-product-gallery__wrapper,
body.cv-voucher-product .woocommerce-product-gallery__image {
	aspect-ratio: auto !important;
	height: auto !important;
	min-height: 0 !important;
}

body.cv-voucher-product .wp-block-columns:has(.wp-block-woocommerce-product-gallery) > .wp-block-column:first-child {
	flex-basis: min(420px, 42%) !important;
	flex-grow: 0;
}

/* Price block spacing on single product */
body.cv-voucher-product .wp-block-woocommerce-product-price .cv-offer,
body.cv-voucher-product .summary .cv-offer,
body.cv-voucher-product .wp-block-woocommerce-product-price {
	margin-block: 0.35rem 0.75rem;
}

body.cv-voucher-product .wp-block-post-title,
body.cv-voucher-product .product_title {
	letter-spacing: -0.02em;
	line-height: 1.2;
}

@media (max-width: 781px) {
	body.cv-voucher-product .wp-block-woocommerce-product-gallery,
	body.cv-voucher-product .woocommerce-product-gallery {
		padding: 1rem;
		border-radius: 12px;
	}

	body.cv-voucher-product .wp-block-woocommerce-product-gallery img,
	body.cv-voucher-product .woocommerce-product-gallery__image img {
		max-height: min(360px, 55vh) !important;
	}

	.cv-offer__price {
		font-size: 1.2rem;
	}

	.cv-hero {
		max-width: 100%;
	}

	.cv-hero__card {
		aspect-ratio: 3 / 4;
		padding: 1.25rem 1.15rem 1.15rem;
	}

	.cv-hero__amount {
		font-size: clamp(2.5rem, 12vw, 3.25rem);
	}
}

/* —— Branded voucher hero (replaces tiny screenshot gallery) —— */
.cv-hero {
	--cv-hero-radius: 18px;
	max-width: 300px;
	width: 100%;
	margin: 0;
	box-sizing: border-box;
}

.cv-hero__card {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 1rem;
	box-sizing: border-box;
	width: 100%;
	aspect-ratio: 3 / 4.15;
	padding: 1.35rem 1.25rem 1.2rem;
	border-radius: var(--cv-hero-radius);
	overflow: hidden;
	color: #fff;
	background:
		radial-gradient(ellipse at 85% 12%, rgba(255, 255, 255, 0.22), transparent 45%),
		linear-gradient(165deg, #1d4e89 0%, #12355f 48%, #0b1f38 100%);
	box-shadow:
		0 18px 40px -14px rgba(18, 53, 95, 0.45),
		inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.cv-hero--gmc .cv-hero__card {
	background:
		radial-gradient(ellipse at 85% 12%, rgba(255, 255, 255, 0.2), transparent 45%),
		linear-gradient(165deg, #2bb39a 0%, #0f6b5c 52%, #084038 100%);
	box-shadow:
		0 18px 40px -14px rgba(15, 107, 92, 0.42),
		inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.cv-hero__card::after {
	content: "";
	position: absolute;
	inset: auto -10% -18% 20%;
	height: 55%;
	background:
		radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.08) 0 1px, transparent 1.5px) 0 0 / 18px 18px,
		radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.05) 0 2px, transparent 2.5px) 0 0 / 28px 28px;
	opacity: 0.9;
	pointer-events: none;
}

.cv-hero__top,
.cv-hero__value,
.cv-hero__footer {
	position: relative;
	z-index: 1;
}

.cv-hero__top {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.cv-hero__brand {
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.cv-hero__kind {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	opacity: 0.75;
}

.cv-hero__value {
	display: flex;
	align-items: flex-start;
	gap: 0.35rem;
	margin: auto 0;
	flex: 1;
	align-content: center;
	flex-wrap: wrap;
}

.cv-hero__amount {
	font-size: clamp(2.75rem, 7vw, 3.75rem);
	font-weight: 800;
	line-height: 0.95;
	letter-spacing: -0.04em;
	font-variant-numeric: tabular-nums;
}

.cv-hero__currency {
	margin-top: 0.45rem;
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	opacity: 0.9;
}

.cv-hero__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

.cv-hero__region {
	display: inline-flex;
	align-items: center;
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	color: #0f6b5c;
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.cv-hero--cv .cv-hero__region {
	color: #1d4e89;
}

.cv-hero__badge {
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.8;
}

body.cv-voucher-product .wp-block-columns:has(.cv-hero) > .wp-block-column:first-child {
	flex-basis: min(320px, 38%) !important;
	flex-grow: 0;
	overflow: visible !important;
	min-width: 0;
}

body.cv-voucher-product .wp-block-columns:has(.cv-hero) {
	align-items: flex-start !important;
	overflow: visible !important;
}
