/* =============================================================
   Rinnai Compare Widget
   rinnai-compare-widget.css
   ============================================================= */

/* ── Root variables ───────────────────────────────────────────
   Falls back to neutral defaults when theme tokens are absent.
   ─────────────────────────────────────────────────────────── */
.rcw {
	--rcw-border: #e0e0e0;
	--rcw-label-weight: 700;
	--rcw-label-size: 0.875rem; /* 14px at base 16 */
	--rcw-value-size: 0.875rem;
	--rcw-cell-pad-v: 14px;
	--rcw-cell-pad-h: 16px;
	--rcw-placeholder-overlay: rgba(0, 0, 0, 0.35);
	--rcw-select-radius: 4px;
	--rcw-font: var(--e-global-typography-text-font-family, inherit);
}

.rcw {
	font-family: var(--rcw-font);
}

/* ── Hint text ────────────────────────────────────────────── */
.rcw__hint {
	font-size: 0.85rem;
	margin-bottom: 20px;
	color: inherit;
}

/* ── Horizontal scroll on small screens ──────────────────── */
.rcw__table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* ── Outer table border ──────────────────────────────────── */
.rcw__table {
	min-width: 480px;
	/* border: 1px solid var(--rcw-border); */
	box-sizing: border-box;
	width: 100%;
}

/* ── 3-column grid shared by head and every data row ─────── */
.rcw__head {
	gap: 15px;
	margin-bottom: 20px;
}

.rcw__head,
.rcw__attr-row {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
}

/* ── Column borders ──────────────────────────────────────── */
.rcw__attr-row {
	border-bottom: 1px solid var(--rcw-border);
}

.rcw__attr-row:last-child {
	border-bottom: none;
}

.rcw__col,
.rcw__attr-cell {
	/* border-right: 1px solid var(--rcw-border); */
	box-sizing: border-box;
}

.rcw__col:last-child,
.rcw__attr-cell:last-child {
	border-right: none;
}

/* ═══════════════════════════════════════════
   PRODUCT HEADER COLUMNS
   ═══════════════════════════════════════════ */

.rcw__col {
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

/* ── Dropdown ─────────────────────────────────────────────── */
.rcw__dropdown-wrap {
	position: relative;
	width: 100%;
}

.rcw__select {
	width: 100%;
	appearance: none;
	-webkit-appearance: none;
	background-color: #fff;
	border: 1px solid #3e3a39;
	border-radius: 0;
	padding: 9px 34px 9px 12px;
	font: inherit;
	font-size: 0.875rem;
	cursor: pointer;
	color: inherit;
}

.rcw .rcw__dropdown-wrap .rcw__select:focus {
	outline: none;
	border-color: #ced4da;
	box-shadow: none;
}

/* Disabled select (col 1 locked) — same visual as active, just not interactive */
.rcw__select:disabled {
	opacity: 1;
	cursor: default;
	background-color: #fff;
	color: inherit;
}

/* Hide the chevron arrow when the select cannot be interacted with */
.rcw__select:disabled ~ .rcw__chevron {
	display: none;
}

/* Custom chevron arrow */
.rcw__chevron {
	position: absolute;
	right: 12px;
	top: 50%;
	pointer-events: none;
	width: 8px;
	height: 8px;
	border-right: 2px solid #666;
	border-bottom: 2px solid #666;
	transform: translateY(-65%) rotate(45deg);
}

/* ── Product thumbnail ────────────────────────────────────── */
.rcw__thumb-wrap {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #f5f5f5;
}

.rcw__thumb {
	width: 100%;
	height: auto;
	display: block;
}

/* ── Placeholder overlay (dark tint + "Choose a Model" text) */

/* Blur the current-product image used as the background */
.rcw__thumb-wrap--placeholder .rcw__thumb {
	filter: blur(5px);
	transform: scale(1.08); /* fill edges that blur exposes */
}

.rcw__thumb-wrap--placeholder::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--rcw-placeholder-overlay);
}

.rcw__placeholder-label {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 0.875rem;
	z-index: 1;
	text-align: center;
	padding: 8px;
	pointer-events: none;
}

/* Hide placeholder overlay text when product is loaded */
.rcw__thumb-wrap:not(.rcw__thumb-wrap--placeholder) .rcw__placeholder-label {
	display: none;
}

/* ═══════════════════════════════════════════
   DATA / ATTRIBUTE ROWS
   ═══════════════════════════════════════════ */

.rcw__attr-cell {
	padding: var(--rcw-cell-pad-v) var(--rcw-cell-pad-h);
}

.rcw__attr-label {
	font-weight: var(--rcw-label-weight);
	font-size: var(--rcw-label-size);
	margin-bottom: 5px;
	line-height: 1.3;
}

.rcw__attr-value {
	font-size: var(--rcw-value-size);
	line-height: 1.4;
}

/* Dim placeholder dashes slightly */
.rcw__attr-value--empty {
	color: #999;
}

/* ═══════════════════════════════════════════
   LOADING STATE
   ═══════════════════════════════════════════ */

.rcw__col--loading .rcw__thumb-wrap {
	opacity: 0.5;
	transition: opacity 0.15s ease;
}

/* ═══════════════════════════════════════════
   EDITOR / PREVIEW STATES
   ═══════════════════════════════════════════ */

.rcw__notice {
	padding: 20px;
	background: #f9f9f9;
	border: 1px dashed #ccc;
	color: #666;
	text-align: center;
	font-size: 0.9rem;
}

.rcw__preview-note {
	text-align: center;
	color: #999;
	font-style: italic;
	font-size: 0.8rem;
	margin-top: 12px;
}

/* In editor: give thumb-wraps a min-height since there's no real img to set the height */
.rcw--preview .rcw__thumb-wrap {
	min-height: 120px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

/* The table-wrap handles horizontal scroll — the grid keeps 3 columns always.
   Below 400 px the hint text wraps naturally; nothing else needs changing. */

/* ── 2-column layout at ≤ 1024 px ───────────────────────── */
@media (max-width: 1024px) {
	/* Switch grid to 2 columns */
	.rcw__head,
	.rcw__attr-row {
		grid-template-columns: 1fr 1fr;
	}

	/* Hide the third header column */
	.rcw__col:nth-child(3) {
		display: none;
	}

	/* Hide the third data cell in every attribute row */
	.rcw__attr-cell[data-col="3"] {
		display: none;
	}
}
