/* ============================================================
   KOMFY HOME INSPIRATION — Bloque editorial. Las 3 fotos del grid
   se rellenan automáticamente con imágenes random de las reseñas
   de Avala (vía JS); placeholder de fallback. Scope: .komfy-inspiration
   ============================================================ */

.komfy-inspiration {
	padding: 80px 24px 60px;
	background: #fff;
}

.komfy-inspiration-grid {
	max-width: 1200px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: auto auto;
	gap: 16px;
}

/* Foto principal (col 1, span 2 rows). Sin aspect-ratio fijo: se estira al
   total de las filas (texto + fila de fotos chicas) para que el bottom
   alinee con el bottom de img-2/img-3. */
.komfy-inspiration-img-1 {
	grid-row: 1 / span 2;
	height: 100%;
	min-height: 480px;
}

.komfy-inspiration-text {
	padding: 32px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.komfy-inspiration-eyebrow {
	font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 13px;
	color: #0047BB;
	font-weight: 600;
}

.komfy-inspiration-title {
	font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
	font-weight: 700;
	font-size: clamp(36px, 4.8vw, 64px);
	line-height: 0.96;
	letter-spacing: -0.01em;
	color: #1C1C1C;
	margin: 12px 0 0 0;
}

.komfy-inspiration-desc {
	font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;
	font-size: 16px;
	line-height: 1.55;
	color: #6b6b6b;
	margin: 14px 0 0 0;
	max-width: 460px;
}

.komfy-inspiration-cta {
	align-self: flex-start;
	margin-top: 20px;
	padding: 14px 26px;
	border: 1.5px solid #1C1C1C;
	border-radius: 999px;
	background: transparent;
	color: #1C1C1C;
	font-family: 'Noto Sans', system-ui, sans-serif;
	font-weight: 600;
	font-size: 15px;
	line-height: 1;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.komfy-inspiration-cta:hover {
	background: #1C1C1C;
	color: #fff;
	transform: translateY(-1px);
	text-decoration: none;
}

/* Fila inferior derecha: 2 fotos chicas lado a lado */
.komfy-inspiration-img-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.komfy-inspiration-img-2,
.komfy-inspiration-img-3 {
	aspect-ratio: 1 / 1;
}

/* Estilos comunes a las 3 imágenes. Usamos background-image (en vez de <img>)
   porque el JS las inyecta dinámicamente desde las reseñas de Avala. */
.komfy-inspiration-img {
	border-radius: 24px;
	overflow: hidden;
	background-color: #efe9e2;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	position: relative;
	transition: opacity 0.4s ease;
}

/* Cuando el JS rellena el slot, escondemos el placeholder */
.komfy-inspiration-img.is-filled .komfy-inspiration-ph {
	opacity: 0;
}

.komfy-inspiration-ph {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: 'Noto Sans', system-ui, sans-serif;
	font-size: 13px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #b5a99a;
	text-align: center;
	padding: 16px;
	transition: opacity 0.3s ease;
}

/* Contenedor donde Avala monta el carousel completo (debajo del grid).
   Sirve como "explorá más reseñas". */
.komfy-inspiration-reviews {
	max-width: 1320px;
	margin: 40px auto 0;
}

.komfy-avala-anchor {
	display: none;
}

/* ============================================================
   GALERÍA MODAL — carousel "shorts style" con scroll-snap, una
   reseña a la vez. Mobile first: stack vertical full-screen.
   Desktop (≥768px): split horizontal foto + info al costado.
   Scope: .komfy-gallery
   ============================================================ */

body.komfy-gallery-open {
	overflow: hidden;
}

.komfy-gallery {
	position: fixed;
	inset: 0;
	z-index: 2147483000;   /* arriba del header sticky del tema */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
}

.komfy-gallery[hidden] {
	display: none !important;
}

.komfy-gallery-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
	cursor: pointer;
}

/* Panel centrado con margen — no cubre todo el viewport.
   Mobile first: chico con leve margen; desktop: centrado con cap. */
.komfy-gallery-panel {
	position: relative;
	background: #fff;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	width: 100%;
	height: 100%;
	max-width: 720px;
	max-height: min(680px, calc(100vh - 24px));
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

/* Botón cerrar — flotante arriba a la derecha */
.komfy-gallery-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	width: 44px;
	height: 44px;
	background: rgba(255, 255, 255, 0.95);
	border: 0;
	border-radius: 999px;
	font-size: 26px;
	line-height: 1;
	color: #1C1C1C;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.15s ease;
}

.komfy-gallery-close:hover {
	background: #fff;
}

/* Counter X / Y — flotante arriba a la izquierda */
.komfy-gallery-counter {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 3;
	padding: 6px 14px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-family: 'Noto Sans', system-ui, sans-serif;
	font-size: 13px;
	font-weight: 600;
	border-radius: 999px;
	letter-spacing: 0.02em;
}

/* Flechas: ocultas por default (mobile usa swipe), visibles en desktop */
.komfy-gallery-nav {
	display: none;
}

/* Track horizontal con scroll-snap */
.komfy-gallery-track {
	flex: 1;
	display: flex;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.komfy-gallery-track::-webkit-scrollbar {
	display: none;
}

/* Cada slide: full width del viewport, stack vertical en mobile */
.komfy-gallery-slide {
	flex: 0 0 100%;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: 100%;
	overflow: hidden;
}

/* Foto — ocupa la parte de arriba en mobile, sin recortar */
.komfy-gallery-slide-media {
	flex: 1 1 60%;
	background: #f5f0ea;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	min-height: 0;
}

.komfy-gallery-slide-media img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

/* Info — abajo en mobile, scrolleable si el texto es largo */
.komfy-gallery-slide-info {
	flex: 0 0 auto;
	padding: 20px 20px 28px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: #fff;
	max-height: 40vh;
	overflow-y: auto;
}

.komfy-gallery-card-rating {
	display: flex;
	gap: 2px;
}

.komfy-gallery-star {
	color: #d8d8d8;
	font-size: 16px;
	line-height: 1;
}

.komfy-gallery-star.is-on {
	color: #FFA400;
}

.komfy-gallery-card-name {
	font-family: 'Noto Sans', system-ui, sans-serif;
	font-weight: 700;
	font-size: 15px;
	color: #1C1C1C;
}

.komfy-gallery-verified {
	color: #0047BB;
	font-size: 13px;
	margin-left: 4px;
}

.komfy-gallery-card-text {
	font-family: 'Noto Sans', system-ui, sans-serif;
	font-size: 14px;
	line-height: 1.55;
	color: #4a4a4a;
	margin: 0;
}

.komfy-gallery-card-product {
	font-family: 'Noto Sans', system-ui, sans-serif;
	font-size: 11px;
	color: #6b6b6b;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin-top: 4px;
	font-weight: 600;
}

/* Botón "Ver producto" — estilo Komfy: pill azul con texto blanco */
.komfy-gallery-product-btn {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 12px;
	padding: 12px 22px;
	border-radius: 999px;
	background: #0047BB;
	color: #fff !important;
	font-family: 'Noto Sans', system-ui, sans-serif;
	font-weight: 600;
	font-size: 14px;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.komfy-gallery-product-btn:hover,
.komfy-gallery-product-btn:focus {
	background: #003a99;
	color: #fff !important;
	text-decoration: none;
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(0, 71, 187, 0.25);
}

.komfy-gallery-loading,
.komfy-gallery-empty {
	width: 100%;
	text-align: center;
	padding: 40px 16px;
	color: #6b6b6b;
	font-family: 'Noto Sans', system-ui, sans-serif;
	font-size: 15px;
	align-self: center;
}

/* ------------------------------------------------------------
   Desktop ≥768px: split horizontal (foto izquierda, info derecha)
   y mostrar flechas de navegación.
   ------------------------------------------------------------ */
@media (min-width: 768px) {
	.komfy-gallery-slide {
		flex-direction: row;
	}
	.komfy-gallery-slide-media {
		flex: 1 1 60%;
		height: 100%;
	}
	.komfy-gallery-slide-info {
		flex: 0 0 360px;
		max-height: none;
		padding: 56px 36px;
		justify-content: center;
		gap: 12px;
	}
	.komfy-gallery-card-text {
		font-size: 15px;
	}
	.komfy-gallery-nav {
		display: flex;
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
		z-index: 3;
		width: 48px;
		height: 48px;
		align-items: center;
		justify-content: center;
		background: rgba(255, 255, 255, 0.9);
		border: 0;
		border-radius: 999px;
		font-size: 28px;
		line-height: 1;
		color: #1C1C1C;
		cursor: pointer;
		box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
		transition: background-color 0.15s ease;
	}
	.komfy-gallery-nav:hover {
		background: #fff;
	}
	.komfy-gallery-prev {
		left: 16px;
	}
	.komfy-gallery-next {
		right: 16px;
	}
}

/* Desktop ≥1100px: panel con bordes redondeados y margen, no full-bleed */
@media (min-width: 1100px) {
	.komfy-gallery-panel {
		inset: 24px;
		border-radius: 20px;
		box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	}
}

/* ------------------------------------------------------------
   Mobile: una sola columna, foto principal arriba más rectangular,
   las dos chicas siguen lado a lado debajo del texto.
   ------------------------------------------------------------ */
@media (max-width: 900px) {
	.komfy-inspiration {
		padding: 56px 16px 40px;
	}
	.komfy-inspiration-grid {
		grid-template-columns: 1fr;
		gap: 12px;
	}
	/* En mobile reordenamos: 1) texto, 2) foto grande, 3) fotos chicas */
	.komfy-inspiration-text {
		order: 1;
		padding: 4px 4px 12px;
	}
	.komfy-inspiration-img-1 {
		order: 2;
		grid-row: auto;
		height: auto;
		aspect-ratio: 5 / 4;
		min-height: 0;
	}
	.komfy-inspiration-img-row {
		order: 3;
		gap: 12px;
	}
	.komfy-inspiration-reviews {
		margin-top: 28px;
	}
}
