/*
 * 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: 42px;
	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 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";
}

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;
}

/* 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__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: 37px;
		font-size: 8px;
	}

	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;
	}

	.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;
	}
}
