/* BMR Colores — resumen en ficha + modal de catálogo y escenas */

.bmr-colores-selector {
	margin-bottom: 1.5em;
	max-width: 100%;
}

/* Woodmart: el sticky suele duplicar el formulario; el catálogo solo debe verse en la ficha principal. */
.wd-sticky-btn .bmr-colores-selector {
	display: none !important;
}

.summary .bmr-colores-selector--before-cart,
.entry-summary .bmr-colores-selector--before-cart {
	margin-top: 0.5rem;
	margin-bottom: 1.25rem;
}

/* ——— Resumen compacto ——— */
.bmr-colores-selector__compact {
	padding: 0.85rem 1rem;
	background: #f6f7f7;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 8px;
}

.bmr-colores-selector__compact-title {
	margin: 0 0 0.35rem;
	font-size: 1rem;
	font-weight: 700;
}

.bmr-colores-selector__compact-hint {
	margin: 0 0 0.75rem;
	font-size: 0.82rem;
	line-height: 1.45;
	color: #646970;
}

.bmr-colores-selector__compact-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
}

.bmr-colores-selector__summary {
	flex: 1 1 180px;
	min-height: 2.75rem;
	display: flex;
	align-items: center;
	gap: 0.5rem 0.75rem;
	font-size: 0.95rem;
}

.bmr-colores-selector__summary--empty {
	color: #646970;
}

.bmr-colores-summary__chip {
	display: inline-block;
	width: 2rem;
	height: 2rem;
	border-radius: 4px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	flex-shrink: 0;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.bmr-colores-summary__meta {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	line-height: 1.25;
}

.bmr-colores-summary__code {
	font-weight: 600;
	font-size: 0.92rem;
	letter-spacing: 0.02em;
}

.bmr-colores-summary__name {
	font-size: 0.98rem;
	color: #1d2327;
}

button.bmr-colores-open-modal.button {
	flex: 0 0 auto;
	white-space: normal;
	text-align: center;
	line-height: 1.25;
	padding: 0.55em 1em;
}

/* ——— Modal ——— */
/*
 * El panel y el fondo son hermanos: con flex row quedaban uno al lado del otro y el modal se veía “corrido”.
 * Fondo fixed a pantalla; el contenedor solo centra el panel.
 */
.bmr-colores-modal {
	position: fixed;
	inset: 0;
	z-index: 100500;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(0.75rem, 2.5vw, 1.5rem);
	box-sizing: border-box;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.bmr-colores-modal[hidden] {
	display: none !important;
}

.bmr-colores-modal__backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	min-height: 100%;
	min-height: 100dvh;
	background: rgba(0, 0, 0, 0.55);
	cursor: pointer;
	z-index: 0;
}

.bmr-colores-modal__panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: min(96vw, 1500px);
	max-height: min(92vh, 920px);
	margin: auto;
	flex: 0 1 auto;
	align-self: center;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 12px;
	box-shadow:
		0 4px 6px rgba(0, 0, 0, 0.04),
		0 24px 64px rgba(0, 0, 0, 0.18);
	padding: clamp(0.85rem, 2vw, 1.35rem) clamp(0.9rem, 2.2vw, 1.5rem) clamp(1rem, 2.2vw, 1.5rem);
	box-sizing: border-box;
}

.bmr-colores-modal__header,
.bmr-colores-modal__intro {
	flex-shrink: 0;
}

.bmr-colores-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem 1rem;
	margin-bottom: 0.5rem;
	padding-bottom: 0.65rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.bmr-colores-modal__title {
	margin: 0;
	flex: 1 1 auto;
	min-width: 0;
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.25;
	padding-right: 0.25rem;
}

button.bmr-colores-modal__close,
.bmr-colores-modal__close {
	appearance: none;
	-webkit-appearance: none;
	flex-shrink: 0;
	width: 2.5rem;
	height: 2.5rem;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.1);
	background: rgba(0, 0, 0, 0.04);
	cursor: pointer;
	border-radius: 6px;
	line-height: 1;
	font-size: 0;
	color: #1d2327;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition:
		background 0.15s ease,
		border-color 0.15s ease;
}

.bmr-colores-modal__close:hover,
.bmr-colores-modal__close:focus {
	background: rgba(0, 0, 0, 0.08);
	border-color: rgba(0, 0, 0, 0.14);
	outline: none;
}

.bmr-colores-modal__close-x {
	display: block;
	line-height: 1;
	font-size: 1.35rem;
	font-weight: 400;
}

.bmr-colores-modal__intro {
	margin: 0 0 1.1rem;
	font-size: 0.88rem;
	line-height: 1.45;
	color: #646970;
}

.bmr-colores-modal__layout {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(1rem, 2.5vw, 1.75rem);
	align-items: stretch;
	-webkit-overflow-scrolling: touch;
}

@media (min-width: 782px) {
	.bmr-colores-modal__layout {
		grid-template-columns: minmax(280px, 1.15fr) minmax(300px, 1fr);
	}
}

@media (min-width: 1100px) {
	.bmr-colores-modal__layout {
		grid-template-columns: minmax(360px, 1.2fr) minmax(340px, 1fr);
	}
}

.bmr-colores-modal__col--preview,
.bmr-colores-modal__col--pick {
	min-height: 0;
}

.bmr-colores-modal__col--preview {
	padding: 0.5rem;
	background: #f6f7f7;
	border-radius: 8px;
	border: 1px solid rgba(0, 0, 0, 0.06);
}

.bmr-colores-modal__preview-placeholder {
	margin: 0 0 0.75rem;
	font-size: 0.85rem;
	line-height: 1.4;
	color: #50575e;
}

.bmr-colores-modal__preview-stage-wrap[hidden] {
	display: none !important;
}

.bmr-colores-modal__stage {
	position: relative;
	margin: 0 0 1rem;
	overflow: hidden;
	border-radius: 8px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	/* Fondo neutro visible si el PNG aún no cubre bordes o mientras no hay color */
	background: #e6e6e6;
	isolation: isolate;
	min-height: 200px;
}

/* Color del catálogo (hex exacto) detrás del PNG — la pared va transparente en el asset */
.bmr-colores-modal__wall-color {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-color: #e6e6e6;
	pointer-events: none;
	transition: background-color 0.25s ease;
}

.bmr-colores-modal__stage--error {
	min-height: 160px;
}

.bmr-colores-modal__stage-img {
	display: block;
	position: relative;
	z-index: 1;
	width: 100%;
	height: auto;
	vertical-align: middle;
	object-fit: cover;
}

.bmr-colores-modal__scene-label {
	margin: 0 0 0.4rem;
	font-size: 0.78rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #646970;
}

.bmr-colores-modal__scenes {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: stretch;
}

.bmr-colores-modal__scene {
	position: relative;
	margin: 0;
	padding: 0;
	border: 2px solid rgba(0, 0, 0, 0.12);
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	background: #e8e8e8;
	flex: 0 0 calc(25% - 0.375rem);
	min-width: 72px;
	max-width: 120px;
	transition:
		border-color 0.15s ease,
		box-shadow 0.15s ease;
}

.bmr-colores-modal__scene:hover,
.bmr-colores-modal__scene:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.bmr-colores-modal__scene.is-active {
	border-color: #1d2327;
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1d2327;
}

.bmr-colores-modal__scene-thumb {
	display: block;
	width: 100%;
	height: auto;
	vertical-align: middle;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.bmr-colores-modal__scene-num {
	position: absolute;
	right: 4px;
	bottom: 4px;
	min-width: 1.25rem;
	height: 1.25rem;
	padding: 0 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.65rem;
	font-weight: 700;
	color: #fff;
	background: rgba(0, 0, 0, 0.55);
	border-radius: 3px;
	pointer-events: none;
}

.bmr-colores-modal__col--pick {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	min-width: 0;
	flex: 1 1 auto;
}

.bmr-colores-selector__search-label {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.bmr-colores-preview__legend {
	margin: 0 0 0.5rem;
	font-size: 0.9rem;
	font-weight: 600;
}

body.bmr-colores-modal-open {
	overflow: hidden;
}

/* Tarjeta muestra en modal */
.bmr-colores-swatchcard {
	position: relative;
	width: 100%;
	max-width: 100%;
	aspect-ratio: 1 / 1;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	border-radius: 2px;
	background-color: #ececec;
	color: #1a1a1a;
	box-shadow:
		inset 0 0 0 2px #fff,
		0 4px 14px rgba(0, 0, 0, 0.12);
	transition:
		background-color 0.2s ease,
		color 0.2s ease;
}

/* Barra compacta bajo la grilla: no ocupa media columna antes de los tabs */
.bmr-colores-swatchcard--modal {
	aspect-ratio: auto;
	min-height: 5rem;
	border-radius: 8px;
}

.bmr-colores-swatchcard--modal .bmr-colores-swatchcard__inner {
	position: relative;
	left: auto;
	top: auto;
	right: auto;
	bottom: auto;
	padding: 1rem 1.2rem;
	flex-direction: row;
	align-items: center;
	gap: 0.9rem 1.1rem;
	flex-wrap: wrap;
}

.bmr-colores-swatchcard--modal .bmr-colores-swatchcard__code {
	margin: 0;
	flex: 0 0 auto;
	color: inherit;
	font-size: clamp(1.12rem, 2.2vw, 1.35rem);
	font-weight: 600;
	letter-spacing: 0.04em;
}

.bmr-colores-swatchcard--modal .bmr-colores-swatchcard__name {
	font-size: clamp(1.35rem, 2.8vw, 1.75rem);
	line-height: 1.25;
	flex: 1 1 160px;
	min-width: 0;
	color: inherit;
	font-weight: 700;
}

/* Si el navegador aún tiene DOM viejo del popover, no mostrarlo */
#bmr-colores-swatch-popover {
	display: none !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

.bmr-colores-swatchcard--empty {
	background-color: #ececec;
	color: #6b6b6b;
	box-shadow:
		inset 0 0 0 2px #fff,
		0 2px 8px rgba(0, 0, 0, 0.08);
}

.bmr-colores-swatchcard__inner {
	position: absolute;
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
	padding: 1rem 1.1rem;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-start;
	text-align: left;
	pointer-events: none;
}

.bmr-colores-swatchcard__code {
	margin: 0 0 0.35rem;
	padding: 0;
	font-size: 0.8rem;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0.02em;
	opacity: 0.95;
}

.bmr-colores-swatchcard__name {
	margin: 0;
	padding: 0;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.25;
	max-width: 100%;
}

.bmr-colores-selector__label {
	display: block;
	margin-bottom: 0.35em;
	font-size: 0.95rem;
}

.bmr-colores-selector__search {
	width: 100%;
	max-width: none;
	margin-bottom: 0;
	padding: 0.55em 0.65em;
	box-sizing: border-box;
}

.bmr-colores-selector__swatches {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	align-content: flex-start;
	flex: 1 1 auto;
	min-height: min(12rem, 35vh);
	max-height: min(58vh, 36rem);
	overflow: hidden;
	padding: clamp(0.45rem, 1.2vw, 0.65rem);
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 10px;
	background: linear-gradient(180deg, #fcfcfc 0%, #f6f7f7 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Jerarquía: 3 categorías principales + subcategorías */
.bmr-colores-top-tabs {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 0.5rem;
	margin: 0;
	padding: 0 0 0.5rem;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	flex: 0 0 auto;
	scroll-snap-type: x proximity;
}

.bmr-colores-top-tabs::-webkit-scrollbar {
	height: 6px;
}

.bmr-colores-top-tabs::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.2);
	border-radius: 4px;
}

.bmr-colores-top-tab {
	position: relative;
	z-index: 2;
	pointer-events: auto;
	margin: 0;
	padding: 0.55rem 0.75rem;
	font-size: clamp(0.72rem, 1.1vw, 0.88rem);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	background: #eef0f1;
	color: #1d2327;
	cursor: pointer;
	flex: 1 1 0;
	min-width: min(9.5rem, 42vw);
	white-space: normal;
	text-align: center;
	transition:
		background 0.2s ease,
		border-color 0.2s ease,
		color 0.2s ease,
		box-shadow 0.2s ease,
		transform 0.15s ease;
	scroll-snap-align: start;
}

.bmr-colores-top-tab:hover,
.bmr-colores-top-tab:focus {
	outline: none;
	border-color: #2271b1;
	background: #e3f0ff;
	box-shadow: 0 2px 8px rgba(34, 113, 177, 0.12);
}

.bmr-colores-top-tab.is-active {
	border-color: #1d2327;
	background: #1d2327;
	color: #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.bmr-colores-hierarchy-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	gap: 0.5rem;
}

/* Subcategorías: barra segmentada; texto completo + scroll horizontal si no cabe */
.bmr-colores-sub-tabs {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 0;
	margin: 0;
	padding: 0 0 4px;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 0, 0, 0.28) transparent;
	flex: 0 0 auto;
	scroll-snap-type: x proximity;
}

.bmr-colores-sub-tabs--segmented {
	border: 1px solid rgba(0, 0, 0, 0.22);
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.bmr-colores-sub-tabs::-webkit-scrollbar {
	height: 6px;
}

.bmr-colores-sub-tabs::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.25);
	border-radius: 4px;
}

.bmr-colores-sub-tab {
	position: relative;
	z-index: 2;
	pointer-events: auto;
	margin: 0;
	padding: 0.5rem 0.55rem;
	font-size: clamp(0.58rem, 0.65vw + 0.45rem, 0.75rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	border: none;
	border-radius: 0;
	border-right: 1px solid rgba(0, 0, 0, 0.18);
	background: #fff;
	color: #1a1a1a;
	cursor: pointer;
	flex: 0 0 auto;
	min-width: 3rem;
	width: auto;
	max-width: 9.5rem;
	white-space: normal;
	overflow-wrap: anywhere;
	hyphens: auto;
	text-align: center;
	transition:
		background 0.18s ease,
		color 0.18s ease,
		box-shadow 0.18s ease;
	scroll-snap-align: start;
}

.bmr-colores-sub-tabs--segmented .bmr-colores-sub-tab:last-child {
	border-right: none;
}

.bmr-colores-sub-tab:hover,
.bmr-colores-sub-tab:focus {
	outline: none;
	background: #f0f6fc;
	color: #135e96;
}

.bmr-colores-sub-tab.is-active {
	background: #e8e8ea;
	color: #000;
	box-shadow: inset 0 -3px 0 #1d2327;
}

.bmr-colores-sub-panels {
	position: relative;
	flex: 1 1 auto;
	min-height: 10rem;
	max-height: min(50vh, 32rem);
	overflow-y: auto;
	overflow-x: hidden;
	padding: 0.4rem 0.2rem 0.2rem;
	-webkit-overflow-scrolling: touch;
}

@media (max-width: 600px) {
	.bmr-colores-sub-tab {
		max-width: 7.5rem;
		padding: 0.45rem 0.45rem;
	}
}

@media (min-width: 900px) {
	.bmr-colores-sub-tab {
		padding: 0.55rem 0.65rem;
		max-width: 10.5rem;
	}
}

/* Pestañas en una sola fila con scroll horizontal (sin apilar vert.) */
.bmr-colores-tabs-nav {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 0.4rem;
	margin: 0;
	padding: 0.35rem 0.15rem 0.5rem;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	flex: 0 0 auto;
}

.bmr-colores-tabs-nav::-webkit-scrollbar {
	height: 6px;
}

.bmr-colores-tabs-nav::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.2);
	border-radius: 4px;
}

.bmr-colores-tab {
	position: relative;
	z-index: 2;
	pointer-events: auto;
	margin: 0;
	padding: 0.4rem 0.75rem;
	font-size: 0.72rem;
	font-weight: 600;
	line-height: 1.25;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 999px;
	background: #fff;
	color: #1d2327;
	cursor: pointer;
	flex: 0 0 auto;
	white-space: nowrap;
	max-width: none;
	text-align: center;
	transition:
		background 0.15s ease,
		border-color 0.15s ease;
}

.bmr-colores-tab:hover,
.bmr-colores-tab:focus {
	outline: none;
	border-color: #2271b1;
	background: #f0f6fc;
}

.bmr-colores-tab.is-active {
	border-color: #1d2327;
	background: #1d2327;
	color: #fff;
}

.bmr-colores-tabs-panels {
	position: relative;
	flex: 1 1 auto;
	min-height: 10rem;
	max-height: min(50vh, 32rem);
	overflow-y: auto;
	overflow-x: hidden;
	padding: 0.35rem 0.15rem 0.15rem;
}

.bmr-colores-single-panel {
	flex: 1 1 auto;
	min-height: 0;
	max-height: min(50vh, 32rem);
	overflow-y: auto;
	overflow-x: hidden;
	padding: 0.15rem;
}

.bmr-colores-tab-panel[hidden] {
	display: none !important;
}

.bmr-colores-search-results {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	flex: 1 1 auto;
	min-height: 0;
	max-height: min(54vh, 34rem);
	overflow-y: auto;
}

.bmr-colores-search-results__title {
	margin: 0 0 0.35rem;
	font-size: 1.05rem;
	font-weight: 700;
	color: #1d2327;
}

.bmr-colores-group {
	margin: 0;
	padding: 0;
	border: 0;
}

.bmr-colores-group__title {
	margin: 0 0 0.5rem;
	padding: 0 0 0.35rem;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
	color: #1d2327;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.bmr-colores-group__body {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.bmr-colores-subsection {
	margin: 0;
}

.bmr-colores-subsection__title {
	margin: 0 0 0.4rem;
	font-size: 0.92rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #646970;
}

.bmr-colores-subsection__swatches {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(0.4rem, 1.2vw, 0.6rem);
	align-content: flex-start;
}

.bmr-colores-flat-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-content: flex-start;
}

.bmr-colores-empty-state {
	margin: 0;
	padding: 0.65rem 0.85rem;
	font-size: 1rem;
	line-height: 1.45;
	color: #50575e;
	width: 100%;
	background: #fff8e5;
	border: 1px solid #dba617;
	border-radius: 4px;
}

.bmr-colores-empty-state--error {
	color: #b32d2e;
}

.bmr-colores-swatch {
	width: clamp(2rem, 4.5vw, 2.5rem);
	height: clamp(2rem, 4.5vw, 2.5rem);
	min-width: 2rem;
	min-height: 2rem;
	padding: 0;
	border: 2px solid rgba(0, 0, 0, 0.18);
	border-radius: 5px;
	cursor: pointer;
	box-sizing: border-box;
	transition:
		transform 0.15s ease,
		box-shadow 0.15s ease,
		border-color 0.15s ease;
}

.bmr-colores-swatch:hover,
.bmr-colores-swatch:focus {
	outline: none;
	transform: scale(1.08);
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2271b1;
}

.bmr-colores-swatch.is-selected {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1d2327;
}
