/* Natrul Room Visualiser */

/* Trigger button on the product page.
   Inherits the theme font. Colours follow the locked Natrul system:
   secondary action on light backgrounds uses ink outline, not amber. */
.nrv-open-button {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	margin: 0.75rem 0 1rem;
	padding: 0.7em 1.2em;
	background: transparent;
	border: 1px solid currentColor;
	border-radius: 2px;
	color: inherit;
	font: inherit;
	font-size: 0.95rem;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.nrv-open-button:hover {
	background: rgba(0, 0, 0, 0.05);
}

/* Floating fallback when the template has no add-to-cart landmark. */
.nrv-open-button--floating {
	position: fixed;
	bottom: 1.25rem;
	right: 1.25rem;
	z-index: 9999;
	margin: 0;
	background: #3a6b3a;
	color: #fff;
	border-color: #3a6b3a;
	border-radius: 999px;
	padding: 0.8em 1.4em;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.nrv-open-button--floating:hover {
	background: #2f572f;
	color: #fff;
}

/* Modal */
.nrv-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.nrv-modal[hidden] {
	display: none;
}

body.nrv-modal-open {
	overflow: hidden;
}

.nrv-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 20, 18, 0.7);
}

.nrv-modal__panel {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: 90vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 6px;
	padding: 1.5rem;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.nrv-modal__close {
	position: absolute;
	top: 0.5rem;
	right: 0.75rem;
	background: none;
	border: none;
	font-size: 1.8rem;
	line-height: 1;
	cursor: pointer;
	color: #555;
	padding: 0.25rem;
}

.nrv-modal__title {
	margin: 0 0 1rem;
	font-size: 1.3rem;
}

.nrv-step__hint {
	color: #555;
	font-size: 0.92rem;
	margin: 0 0 1.25rem;
}

/* Photo source choices */
.nrv-choices {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

.nrv-choice {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	padding: 1.5rem 1rem;
	border: 1px dashed #b9b4ab;
	border-radius: 6px;
	cursor: pointer;
	text-align: center;
	font-size: 0.92rem;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.nrv-choice:hover {
	border-color: #3a6b3a;
	background: rgba(58, 107, 58, 0.04);
}

.nrv-choice__icon {
	color: #3a6b3a;
}

/* Preview and result images */
.nrv-preview,
.nrv-result {
	width: 100%;
	border-radius: 4px;
	display: block;
}

.nrv-result {
	position: relative;
	overflow: hidden;
}

.nrv-result img {
	width: 100%;
	display: block;
	border-radius: 4px;
}

.nrv-result__original {
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.nrv-result__original.is-visible {
	opacity: 1;
}

/* Buttons inside the modal */
.nrv-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1rem;
}

.nrv-actions--primary {
	margin-top: 0.75rem;
}

.nrv-actions--paired {
	gap: 0.75rem;
}

.nrv-actions--primary + .nrv-actions--paired,
.nrv-actions--paired + .nrv-actions--single {
	margin-top: 0.75rem;
}

.nrv-btn {
	flex: 1 1 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.7em 1em;
	background: #3a6b3a;
	color: #fff;
	border: 1px solid #3a6b3a;
	border-radius: 2px;
	font: inherit;
	font-size: 0.92rem;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
	transition: background-color 0.2s ease;
}

.nrv-btn:hover {
	background: #2f572f;
	color: #fff;
}

.nrv-btn--sample {
	flex-basis: 100%;
}

.nrv-btn--ghost {
	background: transparent;
	color: #1a1a18;
	border-color: #b9b4ab;
}

.nrv-btn--ghost:hover {
	background: rgba(0, 0, 0, 0.05);
	color: #1a1a18;
}

/* Loading */
.nrv-loading {
	text-align: center;
	padding: 2.5rem 1rem;
}

.nrv-spinner {
	width: 42px;
	height: 42px;
	margin: 0 auto 1rem;
	border: 3px solid rgba(58, 107, 58, 0.2);
	border-top-color: #3a6b3a;
	border-radius: 50%;
	animation: nrv-spin 0.9s linear infinite;
}

@keyframes nrv-spin {
	to { transform: rotate(360deg); }
}

.nrv-loading__text {
	color: #555;
	font-size: 0.95rem;
}

/* Disclaimer and errors */
.nrv-disclaimer {
	margin-top: 1rem;
	font-size: 0.8rem;
	color: #777;
	line-height: 1.5;
}

.nrv-error {
	color: #a33;
	font-size: 0.95rem;
}

@media (max-width: 480px) {
	.nrv-modal {
		padding: 0;
		align-items: flex-end;
	}

	.nrv-modal__panel {
		max-width: none;
		max-height: 92vh;
		border-radius: 12px 12px 0 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nrv-spinner {
		animation-duration: 2s;
	}
}

/* Design switching */
.nrv-result img.is-updating {
	opacity: 0.55;
}

.nrv-design-picker {
	margin-top: 0.85rem;
	padding: 0.85rem;
	border: 1px solid #e4dfd6;
	border-radius: 4px;
	background: #fbfaf7;
}

.nrv-design-picker[hidden] {
	display: none;
}

.nrv-design-picker__title {
	margin: 0 0 0.75rem;
	font-size: 0.9rem;
	color: #555;
}

.nrv-design-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.6rem;
}

.nrv-design-card {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	width: 100%;
	padding: 0.5rem;
	background: #fff;
	border: 1px solid #d8d2c8;
	border-radius: 3px;
	color: #1a1a18;
	font: inherit;
	font-size: 0.84rem;
	text-align: left;
	cursor: pointer;
}

.nrv-design-card:hover,
.nrv-design-card.is-current {
	border-color: #3a6b3a;
	background: rgba(58, 107, 58, 0.04);
}

.nrv-design-card__image {
	width: 44px;
	height: 44px;
	flex: 0 0 44px;
	border-radius: 2px;
	overflow: hidden;
	background: #eee;
}

.nrv-design-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.nrv-design-card__name {
	line-height: 1.25;
}

@media (max-width: 480px) {
	.nrv-design-grid {
		grid-template-columns: 1fr;
	}
}
