/* =============================================================
   Rinnai FAQ Icon Grid
   rinnai-faq-icon-grid.css
   ============================================================= */

/* ── Root ─────────────────────────────────────────────────── */

.rfg {
	width: 100%;
}

/* ── Intro text ───────────────────────────────────────────── */

.rfg__intro {
	font-size: 16px;
	color: #333333;
	text-align: center;
	margin-bottom: 32px;
	margin-top: 0;
	line-height: 1.5;
}

/* ── Outer wrapper — position anchor for mobile chevron ───── */

.rfg__outer {
	position: relative;
}

/* ── Grid ─────────────────────────────────────────────────── */

.rfg__grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr); /* overridden by Elementor grid_columns control */
	column-gap: 16px;
	row-gap: 16px;
	margin-left: auto;
	margin-right: auto;
}

/* Grid alignment prefix classes (set by Elementor grid_alignment control) */
.rfg-align-left .rfg__grid {
	margin-left: 0;
	margin-right: auto;
}
.rfg-align-center .rfg__grid {
	margin-left: auto;
	margin-right: auto;
}
.rfg-align-right .rfg__grid {
	margin-left: auto;
	margin-right: 0;
}

/* ── Item ─────────────────────────────────────────────────── */

.rfg__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	padding: 24px;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	background-color: transparent;
	transition:
		border-color 0.2s ease,
		background-color 0.2s ease;
	box-sizing: border-box;
}

/* Hover */
.rfg__item:hover {
	border-color: #cc0000;
	opacity: 0.7;
}

/* Focus-visible ring for keyboard users */
.rfg__item:focus-visible {
	outline: 2px solid #cc0000;
	outline-offset: 2px;
}

/* ── Icon wrap ────────────────────────────────────────────── */

.rfg__icon-wrap {
	position: relative;
	width: 48px;
	height: 48px;
	margin-bottom: 12px;
	flex-shrink: 0;
}

/* ── Icon images ──────────────────────────────────────────── */

.rfg__icon {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

/* By default show default, hide hover */
.rfg__icon--hover {
	display: none;
}

/* On hover: swap icons */
.rfg__item:hover .rfg__icon--default {
	display: none;
}

.rfg__item:hover .rfg__icon--hover {
	display: block;
}

/* ── Icon placeholder (no image uploaded) ─────────────────── */

.rfg__icon-placeholder {
	width: 100%;
	height: 100%;
	background-color: #e0e0e0;
	border-radius: 2px;
}

/* ── Label ────────────────────────────────────────────────── */

.rfg__label {
	font-size: 14px;
	color: #333333;
	line-height: 1.3;
	transition: color 0.2s ease;
}

.rfg__item:hover .rfg__label {
	color: #cc0000;
}

/* ── Mobile chevron — hidden on desktop ───────────────────── */

.rfg__mobile-chevron {
	display: none;
}

/* =============================================================
   RESPONSIVE — Mobile (≤ 767px)
   ============================================================= */

@media (max-width: 767px) {
	/* Switch grid to horizontal scroll row */
	.rfg__grid {
		display: flex;
		flex-wrap: nowrap;
		overflow-x: scroll;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none; /* Firefox */
		padding-bottom: 4px;
		/* Reset desktop alignment margins */
		margin-left: 0 !important;
		margin-right: 0 !important;
		max-width: none !important;
	}

	.rfg__grid::-webkit-scrollbar {
		display: none; /* WebKit */
	}

	/* Fixed-width items */
	.rfg__item {
		flex-shrink: 0;
		width: 140px;
		min-width: 140px;
		padding: 16px;
	}

	/* Smaller icon */
	.rfg__icon-wrap {
		width: 40px;
		height: 40px;
	}

	/* Smaller label */
	.rfg__label {
		font-size: 13px;
	}

	/* ── Scroll chevron ─────────────────────────────────────── */

	.rfg__mobile-chevron {
		display: flex;
		align-items: center;
		justify-content: center;
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
		width: 32px;
		height: 32px;
		border-radius: 50%;
		background-color: #ffffff;
		box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
		border: none;
		padding: 0;
		margin: 0;
		cursor: pointer;
		font-size: 18px;
		line-height: 1;
		color: #333333;
		pointer-events: auto;
		transition: opacity 0.3s ease;
		z-index: 1;
	}

	.rfg__mobile-chevron--right {
		right: 20px;
	}

	.rfg__mobile-chevron--left {
		left: 0;
		opacity: 0;
		pointer-events: none;
	}

	.rfg__mobile-chevron:focus-visible {
		outline: 2px solid #cc0000;
	}

	.rfg__chevron-icon {
		width: 24px;
		height: 24px;
		object-fit: contain;
		display: block;
	}

	.rfg__chevron-icon--flipped {
		transform: scaleX(-1);
	}
}
