/* Renuva kitchen visualizer widget — shared by /visualizer and /gallery.
   Palette matches the site: #262D26 ink, #8D7C6E brown, #F5F4EF cream. */

.rv { --rv-ink: #262D26; --rv-mut: #5E635D; --rv-brown: #8D7C6E; --rv-cream: #F5F4EF; }

.rv-main {
	display: grid;
	grid-template-columns: 1.08fr 0.92fr;
	gap: 18px;
	align-items: stretch;
}

.rv-left, .rv-right {
	min-width: 0;
	background: #fff;
	border: 1px solid rgba(141, 124, 110, 0.22);
	border-radius: 20px;
	padding: 18px;
	box-sizing: border-box;
}

/* ── upload / preview ── */
.rv-upload {
	position: relative;
	min-height: 420px;
	height: 100%;
	border: 2px dashed rgba(141, 124, 110, 0.45);
	border-radius: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
	cursor: pointer;
	overflow: hidden;
	box-sizing: border-box;
	transition: background 0.2s ease, border-color 0.2s ease;
}
.rv-upload:hover { background: #fdfcfa; border-color: rgba(141, 124, 110, 0.7); }
.rv-upload.dragover { background: var(--rv-cream); border-color: var(--rv-brown); }
.rv-upload.has-image { border-style: solid; border-color: rgba(141, 124, 110, 0.25); cursor: default; }

.rv-upload-inner { text-align: center; }
.rv-upload-icon {
	width: 84px; height: 84px;
	margin: 0 auto 18px;
	border-radius: 999px;
	background: var(--rv-brown);
	display: flex; align-items: center; justify-content: center;
}
.rv-upload-icon svg { width: 38px; height: 38px; fill: #fff; }
.rv-upload-inner h4 {
	margin: 0 0 8px;
	font-family: "Cormorant", Georgia, serif;
	font-size: 1.35rem;
	color: var(--rv-ink);
}
.rv-upload-inner p { margin: 0; font-size: 0.9rem; color: var(--rv-mut); }

.rv-preview { width: 100%; text-align: center; }
.rv-preview-img {
	width: 100%;
	max-height: 480px;
	object-fit: contain;
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(38, 45, 38, 0.10);
}
.rv-preview-actions { margin-top: 14px; display: flex; gap: 12px; justify-content: center; }
.rv-preview-actions button {
	border: none;
	background: linear-gradient(to bottom, #99836F, #8C7766);
	color: #fff;
	font: 600 0.8rem "Inter", sans-serif;
	padding: 0.55rem 1.1rem;
	border-radius: 8px;
	cursor: pointer;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 2px 0 #66554A, 0 4px 10px rgba(140, 119, 102, 0.28);
	transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.rv-preview-actions button:hover {
	background: linear-gradient(to bottom, #8C7766, #7A6657);
	transform: translateY(-1px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 3px 0 #66554A, 0 6px 14px rgba(140, 119, 102, 0.33);
}
.rv-preview-actions button:active {
	transform: translateY(1px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 0 #66554A, 0 2px 6px rgba(140, 119, 102, 0.22);
}

/* ── loading overlay ── */
.rv-loading { position: absolute; inset: 0; z-index: 5; }
.rv-loading-blur {
	position: absolute; inset: 0;
	background-size: cover; background-position: center;
	filter: blur(14px) brightness(0.72);
	transform: scale(1.06);
}
.rv-loading-inner {
	position: relative; z-index: 1;
	height: 100%;
	display: flex; flex-direction: column;
	align-items: center; justify-content: center;
	gap: 12px;
	text-align: center;
	color: #fff;
	padding: 24px;
}
.rv-spinner {
	width: 42px; height: 42px;
	border-radius: 999px;
	border: 3px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	animation: rv-spin 0.9s linear infinite;
}
@keyframes rv-spin { to { transform: rotate(360deg); } }
.rv-loading-title { font: 600 1rem "Inter", sans-serif; }
.rv-loading-fact { font: 400 0.85rem "Inter", sans-serif; opacity: 0.85; max-width: 40ch; }

/* ── finish picker ── */
.rv-right { display: flex; flex-direction: column; }
.rv-right h3 {
	margin: 0 0 4px;
	font-family: "Cormorant", Georgia, serif;
	font-size: 1.3rem;
	color: #8C7766; /* landing hero taupe */
}
.rv-sub { margin: 0 0 12px; font-size: 0.86rem; color: var(--rv-mut); }

/* ---- surface slots: two-tone cabinets, countertops, island ---- */
.rv-surfaces {
	margin-bottom: 14px;
	padding: 12px;
	border: 1px solid rgba(38, 45, 38, 0.10);
	border-radius: 14px;
	background: var(--rv-cream);
}
.rv-modes { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(38, 45, 38, 0.07); }
.rv-mode {
	flex: 1;
	padding: 8px 12px;
	border: none;
	border-radius: 999px;
	background: transparent;
	color: var(--rv-mut);
	font: 600 0.84rem "Inter", sans-serif;
	cursor: pointer;
}
.rv-mode.active { background: #fff; color: var(--rv-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

.rv-adds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rv-add {
	padding: 6px 12px;
	border: 1px dashed rgba(38, 45, 38, 0.22);
	border-radius: 999px;
	background: #fff;
	color: var(--rv-mut);
	font: 600 0.78rem "Inter", sans-serif;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 5px;
}
.rv-add:hover { border-color: var(--rv-brown); color: var(--rv-ink); }
.rv-add.on { border-style: solid; border-color: var(--rv-brown); background: #fff; color: var(--rv-brown); }

.rv-slots { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.rv-slot {
	display: flex;
	align-items: stretch;
	border: 1.5px solid rgba(38, 45, 38, 0.10);
	border-radius: 12px;
	background: #fff;
	overflow: hidden;
}
.rv-slot.active { border-color: var(--rv-brown); box-shadow: 0 0 0 3px rgba(141, 124, 110, 0.16); }
.rv-slot-main {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border: none;
	background: transparent;
	cursor: pointer;
	text-align: left;
}
.rv-slot-swatch {
	width: 36px;
	height: 36px;
	flex: 0 0 36px;
	border-radius: 9px;
	background: var(--rv-cream) center / cover no-repeat;
	box-shadow: inset 0 0 0 1px rgba(38, 45, 38, 0.08);
}
.rv-slot.empty .rv-slot-swatch { background: #fff; border: 1.5px dashed rgba(38, 45, 38, 0.22); box-shadow: none; }
.rv-slot-text { min-width: 0; }
.rv-slot-label { display: block; font: 700 0.78rem "Inter", sans-serif; color: var(--rv-ink); }
.rv-slot-finish {
	display: block;
	font: 400 0.72rem "Inter", sans-serif;
	color: var(--rv-mut);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.rv-slot.empty .rv-slot-finish { color: var(--rv-brown); font-weight: 600; }
.rv-slot-remove {
	flex: 0 0 32px;
	border: none;
	border-left: 1px solid rgba(38, 45, 38, 0.08);
	background: transparent;
	color: var(--rv-mut);
	font-size: 1.05rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}
.rv-slot-remove:hover { background: var(--rv-cream); color: var(--rv-ink); }

.rv-picking { margin: 0 0 10px; font-size: 0.82rem; color: var(--rv-mut); }
.rv-picking strong { color: var(--rv-brown); }

.rv-types { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.rv-type {
	border: 1px solid rgba(141, 124, 110, 0.35);
	background: #fff;
	color: var(--rv-mut);
	border-radius: 999px;
	padding: 0.32rem 0.85rem;
	font: 600 0.76rem "Inter", sans-serif;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.rv-type:hover { border-color: var(--rv-brown); color: var(--rv-ink); }
.rv-type.active { background: var(--rv-brown); border-color: var(--rv-brown); color: #fff; }

.rv-swatches {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	gap: 8px;
	overflow-y: auto;
	max-height: 300px;
	padding: 2px;
	margin-bottom: 14px;
	flex: 1;
}
.rv-swatch {
	border: 2px solid transparent;
	background: var(--rv-cream);
	border-radius: 10px;
	padding: 6px 6px 8px;
	cursor: pointer;
	text-align: center;
	transition: border-color 0.2s, transform 0.2s;
}
.rv-swatch:hover { transform: translateY(-1px); }
.rv-swatch.active { border-color: var(--rv-brown); background: #fff; }
.rv-swatch-img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	border-radius: 7px;
	background-size: cover;
	background-position: center;
	margin-bottom: 6px;
}
.rv-swatch-code { display: block; font: 700 0.7rem "Inter", sans-serif; color: var(--rv-ink); }
.rv-swatch-name { display: block; font: 400 0.66rem "Inter", sans-serif; color: var(--rv-mut); line-height: 1.25; margin-top: 1px; }

.rv-generate {
	width: 100%;
	border: none;
	background: linear-gradient(to bottom, #99836F, #8C7766);
	color: #fff;
	border-radius: 10px;
	padding: 0.8rem 1rem;
	font: 700 0.85rem "Inter", sans-serif;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 2px 0 #66554A, 0 5px 12px rgba(140, 119, 102, 0.3);
	transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.rv-generate:hover:not(:disabled) {
	background: linear-gradient(to bottom, #8C7766, #7A6657);
	transform: translateY(-1px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 3px 0 #66554A, 0 7px 16px rgba(140, 119, 102, 0.35);
}
.rv-generate:active:not(:disabled) {
	transform: translateY(1px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 0 #66554A, 0 3px 8px rgba(140, 119, 102, 0.25);
}
.rv-generate:disabled { opacity: 0.65; cursor: default; }

.rv-selected { margin-top: 10px; font-size: 0.84rem; color: var(--rv-mut); }
.rv-selected strong { color: var(--rv-ink); font-weight: 600; }

.rv-error {
	margin-top: 10px;
	padding: 0.6rem 0.8rem;
	border-radius: 10px;
	background: #f7ece8;
	border: 1px solid #e0c2b5;
	color: #7c4a33;
	font-size: 0.84rem;
}

.rv-buy {
	display: inline-block;
	margin-top: 10px;
	font: 600 0.84rem "Inter", sans-serif;
	color: var(--rv-brown);
	text-decoration: none;
}
.rv-buy:hover { color: var(--rv-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ── saved previews ── */
.rv-history { margin-top: 16px; }
.rv-history h4 {
	margin: 0 0 10px;
	font-family: "Cormorant", Georgia, serif;
	font-size: 1.05rem;
	color: #8C7766;
}
.rv-history-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 10px;
}
.rv-history-item { position: relative; }
.rv-history-open {
	display: block;
	width: 100%;
	padding: 0;
	border: 1px solid rgba(141, 124, 110, 0.25);
	border-radius: 10px;
	overflow: hidden;
	cursor: pointer;
	background: none;
}
.rv-history-open img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.rv-history-delete {
	position: absolute;
	top: 6px; right: 6px;
	width: 22px; height: 22px;
	border: none;
	border-radius: 999px;
	background: rgba(38, 45, 38, 0.72);
	color: #fff;
	font-size: 0.9rem;
	line-height: 1;
	cursor: pointer;
}
.rv-history-label {
	margin-top: 4px;
	font-size: 0.72rem;
	color: var(--rv-mut);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

@media (max-width: 900px) {
	.rv-main { grid-template-columns: 1fr; }
	.rv-upload { min-height: 320px; }
	.rv-swatches { max-height: 260px; }
}
