.nb-material-popup-gallery,
.nb-material-popup-gallery * {
	box-sizing: border-box;
}

.nb-material-popup-gallery {
	--nb-gallery-main-width: 50%;
	--nb-gallery-columns: 5;
	--nb-gallery-active-border: #5b4035;
	display: grid;
	grid-template-columns: minmax(0, var(--nb-gallery-main-width)) minmax(0, 1fr);
	align-items: start;
	column-gap: 70px;
	width: 100%;
	min-width: 0;
	padding: 36px;
	background: #e9e3dc;
	color: #292523;
	font-family: inherit;
}

.nb-material-popup-gallery button {
	font: inherit;
}

.nb-material-popup-gallery__main,
.nb-material-popup-gallery__content {
	min-width: 0;
	overflow-wrap: anywhere;
}

/* Straight edges also apply to images carrying color/thumbnail CSS classes. */
.nb-material-popup-gallery .nb-material-popup-gallery__main-frame,
.nb-material-popup-gallery .nb-material-popup-gallery__thumb-frame,
.nb-material-popup-gallery .nb-material-popup-gallery__main-image,
.nb-material-popup-gallery .nb-material-popup-gallery__thumb-image {
	clip-path: none;
	-webkit-mask-image: none;
	mask-image: none;
	border-radius: 0;
}

.nb-material-popup-gallery__main-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.24);
}

.nb-material-popup-gallery__main-image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
	opacity: 1;
	transition: opacity 0.2s ease, transform 0.45s ease;
}

.nb-material-popup-gallery__main-frame.is-loading .nb-material-popup-gallery__main-image {
	opacity: 0.48;
}

.nb-material-popup-gallery__content {
	padding-top: 4px;
}

.nb-material-popup-gallery .nb-material-popup-gallery__title {
	margin: 0;
	color: inherit;
	font-family: "Times New Roman", Times, serif;
	font-size: 28px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 4px;
	text-transform: uppercase;
}

.nb-material-popup-gallery__subtitle {
	margin: 10px 0 0;
	color: inherit;
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: normal;
	text-transform: none;
}

.nb-material-popup-gallery__description {
	max-width: 680px;
	margin: 24px 0 0;
	color: inherit;
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.55;
}

.nb-material-popup-gallery__description > :first-child {
	margin-top: 0;
}

.nb-material-popup-gallery__description > :last-child {
	margin-bottom: 0;
}

.nb-material-popup-gallery__thumbnails {
	display: grid;
	grid-template-columns: repeat(var(--nb-gallery-columns), minmax(0, 1fr));
	align-items: start;
	gap: 24px;
	width: 100%;
	margin-top: 26px;
	/* Space for the outline, including the first and last column. */
	padding: 5px;
}

.nb-material-popup-gallery .nb-material-popup-gallery__thumb {
	display: block;
	min-width: 0;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	outline: 0;
	background: transparent;
	box-shadow: none;
	color: inherit;
	text-align: left;
	text-transform: none;
	white-space: normal;
	line-height: normal;
	cursor: pointer;
}

.nb-material-popup-gallery .nb-material-popup-gallery__thumb:hover,
.nb-material-popup-gallery .nb-material-popup-gallery__thumb:focus,
.nb-material-popup-gallery .nb-material-popup-gallery__thumb[aria-pressed="true"] {
	border: 0;
	background: transparent;
	color: inherit;
}

.nb-material-popup-gallery__thumb-frame {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: visible;
	background: rgba(255, 255, 255, 0.24);
	box-shadow: none;
}

/* Outside the image: 1px square border + 4px clear space. No layout shift. */
.nb-material-popup-gallery__thumb-frame::after {
	content: "";
	position: absolute;
	inset: -5px;
	border: 1px solid var(--nb-gallery-active-border);
	border-radius: 0;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.nb-material-popup-gallery__thumb[aria-pressed="true"] .nb-material-popup-gallery__thumb-frame::after {
	opacity: 1;
}

.nb-material-popup-gallery__thumb-image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
	transition: opacity 0.2s ease;
}

.nb-material-popup-gallery__thumb:hover .nb-material-popup-gallery__thumb-image {
	opacity: 0.88;
}

.nb-material-popup-gallery__thumb:focus-visible .nb-material-popup-gallery__thumb-frame {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

.nb-material-popup-gallery__thumb-label {
	display: block;
	margin-top: 9px;
	color: inherit;
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 1.4px;
}

.nb-material-popup-gallery__details {
	display: flex;
	flex-direction: column;
	row-gap: 3px;
	width: 100%;
	margin-top: 30px;
	color: inherit;
	font-family: inherit;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.35;
}

.nb-material-popup-gallery__detail-row {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	column-gap: 5px;
	align-items: baseline;
	min-width: 0;
}

.nb-material-popup-gallery__detail-label,
.nb-material-popup-gallery__detail-value {
	min-width: 0;
}

.nb-material-popup-gallery__detail-value {
	overflow-wrap: anywhere;
}

.nb-material-popup-gallery__additional-content {
	width: 100%;
	margin-top: 22px;
	color: inherit;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
}

.nb-material-popup-gallery__additional-content > :first-child,
.nb-material-popup-gallery__attention-text > :first-child {
	margin-top: 0;
}

.nb-material-popup-gallery__additional-content > :last-child,
.nb-material-popup-gallery__attention-text > :last-child {
	margin-bottom: 0;
}

.nb-material-popup-gallery__care-icons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 18px;
	width: 100%;
	margin-top: 24px;
}

.nb-material-popup-gallery__care-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
}

.nb-material-popup-gallery__care-icon img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: contain;
	object-position: center;
}

.nb-material-popup-gallery__attention {
	width: 100%;
	margin-top: 22px;
	color: inherit;
	font-family: inherit;
}

.nb-material-popup-gallery__attention-title {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	text-transform: uppercase;
}

.nb-material-popup-gallery__attention-text {
	font-size: 15px;
	font-weight: 400;
	line-height: 1.5;
}

.nb-material-popup-gallery__editor-notice {
	padding: 18px;
	border: 1px dashed currentColor;
	font-family: inherit;
	font-size: 13px;
}

@media (max-width: 1024px) {
	.nb-material-popup-gallery {
		--nb-gallery-columns: 4;
		grid-template-columns: minmax(0, var(--nb-gallery-main-width)) minmax(0, 1fr);
		column-gap: 36px;
		padding: 28px;
	}

	.nb-material-popup-gallery .nb-material-popup-gallery__title {
		letter-spacing: 3px;
	}

	.nb-material-popup-gallery__description {
		font-size: 14px;
	}
}

@media (max-width: 767px) {
	.nb-material-popup-gallery {
		--nb-gallery-columns: 3;
		display: flex;
		flex-direction: column;
		gap: 28px;
		padding: 18px;
	}

	.nb-material-popup-gallery__main,
	.nb-material-popup-gallery__content {
		width: 100%;
	}

	.nb-material-popup-gallery__content {
		padding-top: 0;
	}

	.nb-material-popup-gallery .nb-material-popup-gallery__title {
		font-size: 26px;
	}

	.nb-material-popup-gallery__thumbnails {
		gap: 16px;
	}

	.nb-material-popup-gallery__thumb-label {
		margin-top: 7px;
		font-size: 12px;
	}

	.nb-material-popup-gallery__details {
		margin-top: 24px;
	}

	.nb-material-popup-gallery__care-icons {
		margin-top: 20px;
	}
}

@media (max-width: 420px) {
	.nb-material-popup-gallery__detail-row {
		grid-template-columns: 1fr;
		row-gap: 1px;
	}

	.nb-material-popup-gallery__detail-label {
		font-weight: 600;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nb-material-popup-gallery__main-image,
	.nb-material-popup-gallery__thumb-frame::after,
	.nb-material-popup-gallery__thumb-image {
		transition: none;
	}
}
