/*
 * Product variation matrix, image preview and restock notification.
 * Uses storefront variables when available so the same component can follow
 * each tenant's palette.
 */

body.single-product table.wholesale.products {
	display: table !important;
	width: calc(100% + 24px) !important;
	max-width: calc(100% + 24px) !important;
	overflow: hidden;
	margin: 8px -12px 18px !important;
	border: 1px solid var(--nf-border, #dce7ef);
	border-collapse: separate !important;
	border-radius: 16px;
	border-spacing: 0;
	background: #fff;
	box-shadow: 0 10px 28px rgba(8, 47, 82, 0.07);
	table-layout: fixed;
}

body.single-product table.wholesale.products tbody {
	display: table-row-group !important;
}

body.single-product table.wholesale.products tr {
	display: table-row !important;
}

body.single-product table.wholesale.products tr.product-title-row,
body.single-product table.wholesale.products th.product-title {
	display: none !important;
}

body.single-product table.wholesale.products th,
body.single-product table.wholesale.products td {
	display: table-cell;
	height: auto;
	padding: 8px 6px !important;
	border: 0;
	border-bottom: 1px solid var(--nf-border, #dce7ef);
	color: var(--nf-ink, #10263a);
	text-align: center;
	vertical-align: middle;
}

body.single-product table.wholesale.products tr:last-child td {
	border-bottom: 0;
}

body.single-product table.wholesale.products .headings th {
	height: 58px;
	color: var(--nf-primary-dark, #082f52);
	background: var(--nf-surface, #f4f9fc);
	font-size: 10px;
	font-weight: 850;
	letter-spacing: 0.06em;
	line-height: 1.1;
	text-transform: uppercase;
}

body.single-product table.wholesale.products .headings th.horizontal-attribute {
	position: relative;
}

.nf-size-heading__label {
	display: grid;
	width: 32px;
	height: 32px;
	place-items: center;
	margin: 0 auto;
	border: 1px solid color-mix(in srgb, var(--nf-primary, #0d5390) 20%, #fff);
	border-radius: 50%;
	background: #fff;
	transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.nf-size-heading__tally {
	position: absolute;
	top: 4px;
	right: max(2px, calc(50% - 24px));
	display: grid;
	min-width: 17px;
	height: 17px;
	place-items: center;
	padding: 0 4px;
	border: 2px solid var(--nf-surface, #f4f9fc);
	border-radius: 999px;
	color: #fff;
	background: #c23f79;
	font-size: 8px;
	font-weight: 850;
	line-height: 1;
	opacity: 0;
	transform: scale(0.75);
	transition: opacity 150ms ease, transform 150ms ease;
}

body.single-product table.wholesale.products .headings th.has-selected-items .nf-size-heading__label {
	border-color: var(--nf-primary, #0d5390);
	color: #fff;
	background: var(--nf-primary, #0d5390);
}

body.single-product table.wholesale.products .headings th.has-selected-items .nf-size-heading__tally {
	opacity: 1;
	transform: scale(1);
}

body.single-product table.wholesale.products th.image,
body.single-product table.wholesale.products td.image {
	width: 78px !important;
	min-width: 78px;
	padding-right: 8px !important;
	padding-left: 8px !important;
}

body.single-product table.wholesale.products th.image::after {
	content: "Foto";
}

/* Wholesale quantity discount */
.nf-bulk-discount-offer {
	display: grid;
	align-items: center;
	gap: 12px;
	grid-template-columns: 42px minmax(0, 1fr);
	margin: 14px 0 10px;
	padding: 14px 15px;
	border: 1px solid color-mix(in srgb, var(--nf-primary, #0d5390) 16%, #fff);
	border-radius: 14px;
	background:
		linear-gradient(135deg, color-mix(in srgb, var(--nf-primary, #0d5390) 6%, #fff), #fff 62%);
	box-shadow: 0 8px 22px rgba(8, 47, 82, 0.06);
}

.nf-bulk-discount-offer__icon {
	display: grid;
	width: 42px;
	height: 42px;
	place-items: center;
	border-radius: 12px;
	color: #fff;
	background: var(--nf-primary, #0d5390);
	font-size: 18px;
	font-weight: 850;
	box-shadow: 0 7px 16px rgba(13, 83, 144, 0.18);
}

.nf-bulk-discount-offer__content {
	display: grid;
	min-width: 0;
	gap: 3px;
}

.nf-bulk-discount-offer__eyebrow {
	color: var(--nf-primary, #0d5390);
	font-size: 8px;
	font-weight: 850;
	letter-spacing: 0.09em;
	line-height: 1.2;
	text-transform: uppercase;
}

.nf-bulk-discount-offer strong {
	color: var(--nf-primary-dark, #082f52);
	font-size: 14px;
	font-weight: 850;
	line-height: 1.25;
}

.nf-bulk-discount-offer p {
	margin: 1px 0 5px;
	color: var(--nf-muted, #617184);
	font-size: 10px;
	line-height: 1.45;
}

.nf-bulk-discount-offer__progress {
	height: 4px;
	overflow: hidden;
	border-radius: 999px;
	background: color-mix(in srgb, var(--nf-primary, #0d5390) 10%, #fff);
}

.nf-bulk-discount-offer__progress span {
	display: block;
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: var(--nf-primary, #0d5390);
	transition: width 180ms ease, background 180ms ease;
}

.nf-bulk-discount-offer__status {
	margin-top: 3px;
	color: var(--nf-muted, #617184);
	font-size: 9px;
	font-weight: 750;
	line-height: 1.3;
}

.nf-bulk-discount-offer.is-qualified {
	border-color: #b8dfce;
	background: linear-gradient(135deg, #edf9f4, #fff 65%);
}

.nf-bulk-discount-offer.is-qualified .nf-bulk-discount-offer__icon,
.nf-bulk-discount-offer.is-qualified .nf-bulk-discount-offer__progress span {
	background: #1b8a60;
}

.nf-bulk-discount-offer.is-qualified .nf-bulk-discount-offer__status {
	color: #176947;
}

.nf-bulk-discount-offer.is-clearance-qualified {
	border-color: color-mix(in srgb, var(--nf-accent, #c23f79) 38%, #fff);
	background: linear-gradient(135deg, color-mix(in srgb, var(--nf-accent, #c23f79) 10%, #fff), #fff 65%);
}

.nf-bulk-discount-offer.is-clearance-qualified .nf-bulk-discount-offer__icon,
.nf-bulk-discount-offer.is-clearance-qualified .nf-bulk-discount-offer__progress span {
	background: var(--nf-accent, #c23f79);
}

.nf-bulk-discount-offer.is-clearance-qualified .nf-bulk-discount-offer__status {
	color: color-mix(in srgb, var(--nf-accent, #c23f79) 78%, #28101c);
}

.nf-wholesale-summary__discount {
	padding: 4px 8px;
	border-radius: 999px;
	color: #176947;
	background: #e9f8f1;
	font-size: 9px;
	font-weight: 800;
	line-height: 1.3;
}

.nf-wholesale-summary__discount[hidden] {
	display: none !important;
}

.nf-wholesale-summary.has-clearance-discount .nf-wholesale-summary__discount {
	color: color-mix(in srgb, var(--nf-accent, #c23f79) 78%, #28101c);
	background: color-mix(in srgb, var(--nf-accent, #c23f79) 10%, #fff);
}

body.single-product table.wholesale.products th.vertical-attribute,
body.single-product table.wholesale.products td.vertical-attribute {
	width: 94px !important;
	min-width: 94px !important;
	max-width: 94px !important;
	overflow-wrap: anywhere;
	font-size: 12px;
	font-weight: 720;
	text-transform: capitalize;
}

body.single-product table.wholesale.products td.image a {
	position: relative;
	display: block;
	width: 60px;
	height: 74px;
	overflow: hidden;
	margin: 0 auto;
	border: 1px solid var(--nf-border, #dce7ef);
	border-radius: 10px;
	background: var(--nf-surface, #f4f9fc);
	box-shadow: 0 5px 14px rgba(8, 47, 82, 0.09);
	cursor: zoom-in;
	transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

body.single-product table.wholesale.products td.image a::after {
	position: absolute;
	right: 4px;
	bottom: 4px;
	display: grid;
	width: 20px;
	height: 20px;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, 0.9);
	border-radius: 50%;
	color: #fff;
	background: rgba(8, 47, 82, 0.78);
	content: "+";
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
}

body.single-product table.wholesale.products td.image a:hover,
body.single-product table.wholesale.products td.image a:focus-visible {
	border-color: var(--nf-primary, #0d5390);
	box-shadow: 0 8px 20px rgba(8, 47, 82, 0.16);
	outline: 0;
	transform: translateY(-1px);
}

body.single-product table.wholesale.products td.image img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	margin: 0 !important;
	border: 0;
	border-radius: 0 !important;
	object-fit: cover;
}

body.single-product table.wholesale.products select.product-quantity {
	display: block;
	width: 100% !important;
	max-width: 54px;
	min-height: 42px;
	margin: 0 auto;
	padding: 0 23px 0 8px;
	border: 1px solid var(--nf-border, #dce7ef);
	border-radius: 10px;
	color: var(--nf-ink, #10263a);
	background-color: #fff;
	box-shadow: none;
	font-size: 12px;
	font-weight: 700;
	text-align: center;
}

body.single-product table.wholesale.products select.product-quantity:hover,
body.single-product table.wholesale.products select.product-quantity:focus {
	border-color: var(--nf-primary, #0d5390);
	box-shadow: 0 0 0 3px rgba(13, 83, 144, 0.09);
	outline: 0;
}

body.single-product table.wholesale.products .nf-variation-unavailable {
	display: inline-flex;
	max-width: 52px;
	min-height: 28px;
	align-items: center;
	justify-content: center;
	color: #8b5963;
	font-size: 8px;
	font-weight: 750;
	letter-spacing: 0.01em;
	line-height: 1.12;
	text-align: center;
	text-transform: none;
}

/* Live wholesale selection summary. The wholesale plugin still owns all
 * quantities, stock checks and cart requests; this is presentation only. */
body.single-product .wholesale-cart.nf-wholesale-purchase {
	display: grid !important;
	width: 100%;
	grid-template-columns: minmax(0, 1.05fr) minmax(190px, 0.95fr);
	align-items: stretch;
	gap: 10px;
	margin: -3px 0 18px;
	text-align: left !important;
}

body.single-product .nf-wholesale-purchase > #add_to_cart {
	display: inline-flex;
	width: 100%;
	min-height: 66px;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0 22px;
	border: 0;
	border-radius: 14px !important;
	color: #fff !important;
	background: linear-gradient(
		135deg,
		var(--nf-primary, #0d5390),
		var(--nf-primary-dark, #082f52)
	) !important;
	box-shadow: 0 12px 26px rgba(13, 83, 144, 0.22) !important;
	font-size: 12px;
	font-weight: 850;
	letter-spacing: 0;
	line-height: 1.2;
	text-align: center;
}

body.single-product .nf-wholesale-purchase > #add_to_cart::before {
	display: inline-block;
	margin-right: 9px;
	content: "＋";
	font-size: 20px;
	font-weight: 400;
	line-height: 1;
}

body.single-product .nf-wholesale-purchase > #add_to_cart:hover,
body.single-product .nf-wholesale-purchase > #add_to_cart:focus-visible {
	color: #fff !important;
	box-shadow: 0 16px 32px rgba(13, 83, 144, 0.29) !important;
	transform: translateY(-1px);
}

.nf-wholesale-summary {
	display: grid;
	min-width: 0;
	align-content: center;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 2px 10px;
	padding: 10px 13px;
	border: 1px solid var(--nf-border, #dce7ef);
	border-radius: 14px;
	color: var(--nf-muted, #617184);
	background: linear-gradient(145deg, #fff, var(--nf-surface, #f4f9fc));
}

.nf-wholesale-summary__items {
	align-self: end;
	font-size: 9px;
	line-height: 1.25;
}

.nf-wholesale-summary__items strong {
	color: var(--nf-primary-dark, #082f52);
	font-size: 12px;
	font-weight: 850;
}

.nf-wholesale-summary__amount {
	grid-row: 1 / 3;
	grid-column: 2;
	align-self: center;
}

.nf-wholesale-summary__amount strong {
	color: var(--nf-primary-dark, #082f52);
	font-size: 16px;
	font-weight: 850;
	white-space: nowrap;
}

.nf-wholesale-summary__installments {
	align-self: start;
	font-size: 8px;
	line-height: 1.35;
}

.nf-wholesale-purchase.has-selected-items .nf-wholesale-summary {
	border-color: color-mix(in srgb, var(--nf-primary, #0d5390) 24%, #fff);
	box-shadow: 0 8px 20px rgba(8, 47, 82, 0.07);
}

/* Restock notification */
.nf-stock-notify {
	display: grid;
	width: 100%;
	align-items: center;
	gap: 12px;
	grid-template-columns: 42px minmax(0, 1fr) auto;
	margin: 4px 0 18px;
	padding: 14px;
	border: 1px solid #eadde3;
	border-radius: 14px;
	background: linear-gradient(145deg, #fffafd, #fff 68%);
	box-shadow: 0 8px 24px rgba(67, 34, 49, 0.05);
}

.nf-stock-notify__icon {
	display: grid;
	width: 42px;
	height: 42px;
	place-items: center;
	border-radius: 12px;
	color: #a43d5d;
	background: #fcecf2;
}

.nf-stock-notify__icon svg {
	width: 23px;
	height: 23px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.nf-stock-notify__content {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 2px;
}

.nf-stock-notify__content strong {
	color: var(--nf-primary-dark, #082f52);
	font-size: 12px;
	font-weight: 800;
	line-height: 1.3;
}

.nf-stock-notify__content span {
	color: var(--nf-muted, #617184);
	font-size: 10px;
	line-height: 1.4;
}

body.single-product .nf-stock-notify__button,
body.single-product .nf-stock-notify__submit {
	display: inline-flex;
	min-height: 42px;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0 16px;
	border: 1px solid var(--nf-primary, #0d5390);
	border-radius: 999px;
	color: #fff;
	background: var(--nf-primary, #0d5390);
	box-shadow: 0 7px 16px rgba(13, 83, 144, 0.16);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0;
	line-height: 1.2;
	text-align: center;
	text-transform: none;
}

body.single-product .nf-stock-notify__button:hover,
body.single-product .nf-stock-notify__submit:hover {
	color: #fff;
	background: var(--nf-primary-dark, #082f52);
}

body.single-product .nf-stock-notify__button:disabled {
	border-color: #b9d9ce;
	color: #28684f;
	background: #ecf8f2;
	box-shadow: none;
	cursor: default;
	opacity: 1;
}

.nf-stock-notify__form {
	display: grid;
	align-items: end;
	gap: 10px;
	grid-column: 1 / -1;
	grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
	padding-top: 13px;
	border-top: 1px solid #eadde3;
}

.nf-stock-notify__form[hidden] {
	display: none !important;
}

.nf-stock-notify__form label {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 5px;
	margin: 0;
	color: var(--nf-ink, #10263a);
	font-size: 10px;
	font-weight: 750;
}

.nf-stock-notify__form label small {
	color: var(--nf-muted, #617184);
	font-size: 8px;
	font-weight: 600;
}

body.single-product .nf-stock-notify__form input {
	width: 100%;
	min-height: 42px;
	margin: 0;
	border: 1px solid var(--nf-border, #dce7ef);
	border-radius: 9px;
	background: #fff;
	box-shadow: none;
	font-size: 12px;
}

body.single-product .nf-stock-notify__form input:focus {
	border-color: var(--nf-primary, #0d5390);
	box-shadow: 0 0 0 3px rgba(13, 83, 144, 0.09);
	outline: 0;
}

.nf-stock-notify__form .iti {
	display: block;
	width: 100%;
}

body.single-product .nf-stock-notify__form .iti input {
	padding-right: 10px !important;
	padding-left: 86px !important;
}

.nf-stock-notify__form .iti__flag-container {
	z-index: 3;
	right: auto;
	left: 0;
}

.nf-stock-notify__form .iti__selected-flag {
	border-right: 1px solid var(--nf-border, #dce7ef);
	border-radius: 9px 0 0 9px;
	background: var(--nf-surface, #f4f9fc);
}

.nf-stock-notify__form .iti__country-list {
	z-index: 100000;
	width: min(315px, 86vw);
	max-height: 230px;
	color: var(--nf-ink, #10263a);
	background: #fff;
	font-size: 11px;
	text-align: left;
}

.nf-stock-notify__website {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.nf-stock-notify__status {
	min-height: 0;
	grid-column: 1 / -1;
	margin: 0;
	color: #28684f;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.4;
}

.nf-stock-notify__status:empty {
	display: none;
}

.nf-stock-notify__status.is-error {
	color: #a12f42;
}

/* Accessible image preview */
.nf-variation-lightbox[hidden] {
	display: none !important;
}

.nf-variation-lightbox {
	position: fixed;
	z-index: 999999;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(2, 16, 28, 0.88);
	backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity 180ms ease;
}

.nf-variation-lightbox.is-open {
	opacity: 1;
}

.nf-variation-lightbox__dialog {
	position: relative;
	display: flex;
	max-width: min(760px, 92vw);
	max-height: 90vh;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
	transform: scale(0.97);
	transition: transform 180ms ease;
}

.nf-variation-lightbox.is-open .nf-variation-lightbox__dialog {
	transform: scale(1);
}

.nf-variation-lightbox__image {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: calc(90vh - 58px);
	margin: 0 auto;
	object-fit: contain;
}

.nf-variation-lightbox__caption {
	min-height: 48px;
	margin: 0;
	padding: 14px 60px 14px 18px;
	color: var(--nf-ink, #10263a);
	background: #fff;
	font-size: 12px;
	font-weight: 750;
	line-height: 1.4;
}

.nf-variation-lightbox__close {
	position: absolute;
	z-index: 2;
	top: 10px;
	right: 10px;
	display: grid;
	width: 42px;
	height: 42px;
	place-items: center;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.48);
	border-radius: 50%;
	color: #fff;
	background: rgba(4, 27, 46, 0.84);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
	cursor: pointer;
	font-size: 27px;
	font-weight: 400;
	line-height: 1;
}

.nf-variation-lightbox__close:hover,
.nf-variation-lightbox__close:focus-visible {
	color: #fff;
	background: #071f33;
	outline: 3px solid rgba(255, 255, 255, 0.5);
}

body.nf-variation-lightbox-open {
	overflow: hidden;
}

@media (max-width: 640px) {
	body.single-product table.wholesale.products {
		width: 100% !important;
		max-width: 100% !important;
		margin-right: 0 !important;
		margin-left: 0 !important;
		border-radius: 13px;
	}

	body.single-product table.wholesale.products th,
	body.single-product table.wholesale.products td {
		padding: 6px 3px !important;
	}

	body.single-product table.wholesale.products .headings th {
		height: 52px;
		font-size: 8px;
	}

	.nf-size-heading__label {
		width: 28px;
		height: 28px;
	}

	.nf-size-heading__tally {
		top: 3px;
		right: max(0px, calc(50% - 21px));
		min-width: 15px;
		height: 15px;
		padding: 0 3px;
		font-size: 7px;
	}

	body.single-product table.wholesale.products th.image,
	body.single-product table.wholesale.products td.image {
		width: 61px !important;
		min-width: 61px;
		padding-right: 5px !important;
		padding-left: 5px !important;
	}

	body.single-product table.wholesale.products th.vertical-attribute,
	body.single-product table.wholesale.products td.vertical-attribute {
		width: 70px !important;
		min-width: 70px !important;
		max-width: 70px !important;
		font-size: 10px;
	}

	body.single-product table.wholesale.products td.image a {
		width: 49px;
		height: 61px;
		border-radius: 8px;
	}

	body.single-product table.wholesale.products td.image a::after {
		width: 17px;
		height: 17px;
		font-size: 12px;
	}

	body.single-product table.wholesale.products select.product-quantity {
		max-width: 48px;
		min-height: 39px;
		padding-right: 18px;
		padding-left: 5px;
		border-radius: 8px;
		font-size: 10px;
	}

	body.single-product table.wholesale.products .nf-variation-unavailable {
		max-width: 44px;
		font-size: 7px;
	}

	body.single-product .wholesale-cart.nf-wholesale-purchase {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	body.single-product .nf-wholesale-purchase > #add_to_cart {
		min-height: 54px;
		border-radius: 12px !important;
	}

	.nf-wholesale-summary {
		min-height: 60px;
	}

	.nf-stock-notify {
		grid-template-columns: 38px minmax(0, 1fr);
		padding: 12px;
	}

	.nf-stock-notify__icon {
		width: 38px;
		height: 38px;
	}

	body.single-product .nf-stock-notify__button {
		width: 100%;
		grid-column: 1 / -1;
	}

	.nf-stock-notify__form {
		grid-template-columns: 1fr;
	}

	body.single-product .nf-stock-notify__submit {
		width: 100%;
	}

	.nf-variation-lightbox {
		padding: 14px;
	}

	.nf-variation-lightbox__dialog {
		max-width: 94vw;
		max-height: 88vh;
		border-radius: 14px;
	}

	.nf-variation-lightbox__image {
		max-height: calc(88vh - 54px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.nf-variation-lightbox,
	.nf-variation-lightbox__dialog,
	body.single-product table.wholesale.products td.image a {
		transition: none;
	}
}
