/**
 * CASALANAS — Bloque de Inicio para Elementor (by Bersoft)
 * Componente: bersoft-home-block | Version: 1.0.10
 * Atribución: Diseñado por Bersoft (https://bersoft.pe) para CASALANAS
 */

:root {
	--bersoft-font: var(--bersoft-font-family, 'ABC Diatype', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
	--bersoft-theme-brown: var(--bs-color-primary, var(--bersoft-color-brown, var(--bersoft-brown, var(--bersoft-primary, var(--bersoft-color-primary, var(--wp--preset--color--primary, var(--wp--preset--color--brown, #5C4533)))))));
	--bersoft-surface: var(--bersoft-color-surface, var(--wp--preset--color--base, #FFF));
	--bersoft-accent: var(--bersoft-terracotta, #B85D38);
	--bersoft-dark: var(--bersoft-text-dark, var(--wp--preset--color--contrast, #1A1A1A));
	--bersoft-muted: var(--bersoft-text-muted, #736B63);
	--bersoft-border: var(--bersoft-border-color, #E8E4DC);
	--bersoft-badge-bg: #F4F1EA;
}

/* 1. Contenedor de Sección */
.bersoft-inicio-section {
	font-family: var(--bersoft-font);
	color: var(--bersoft-dark);
	padding: 48px 16px;
	box-sizing: border-box;
	width: 100%;
	position: relative;
}

.bersoft-inicio-container {
	max-width: 1320px;
	margin: 0 auto;
	box-sizing: border-box;
}

/* 2. Encabezado de Sección */
.bersoft-inicio-header-row,
.bersoft-inicio-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.bersoft-inicio-header-row {
	margin-bottom: 24px;
}
.bersoft-inicio-header {
	flex: 1;
}

.bersoft-inicio-header-info {
	flex: 1;
	min-width: 240px;
}

.bersoft-inicio-title {
	font-family: var(--bersoft-font);
	font-size: clamp(22px, 3.2vw, 30px);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.2;
	margin: 0 0 6px;
	color: var(--bersoft-dark);
}
.bersoft-inicio-desc {
	font-size: 14px;
	color: var(--bersoft-muted);
	margin: 0;
	line-height: 1.5;
}

.bersoft-inicio-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--bersoft-theme-brown);
	text-decoration: none;
	padding: 4px 0;
	transition: opacity 160ms ease, transform 120ms ease;
}
.bersoft-inicio-link:hover {
	opacity: 0.82;
	transform: translateX(2px);
}
.bersoft-inicio-link:focus-visible {
	outline: 2px solid var(--bersoft-theme-brown);
	outline-offset: 2px;
	border-radius: 2px;
}

/* 3. Controles de Navegación del Carrusel (Flechas accesibles) */
.bersoft-inicio-nav-controls {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.bersoft-inicio-nav-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--bersoft-surface);
	border: 1px solid var(--bersoft-border);
	color: var(--bersoft-dark);
	cursor: pointer;
	padding: 0;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms ease, opacity 160ms ease;
}
.bersoft-inicio-nav-btn:hover:not(:disabled) {
	background: var(--bersoft-badge-bg);
	border-color: var(--bersoft-theme-brown);
	color: var(--bersoft-theme-brown);
}
.bersoft-inicio-nav-btn:active:not(:disabled) {
	transform: scale(0.94);
}
.bersoft-inicio-nav-btn:focus-visible {
	outline: 2px solid var(--bersoft-theme-brown);
	outline-offset: 2px;
}
.bersoft-inicio-nav-btn:disabled {
	opacity: 0.32;
	cursor: not-allowed;
	pointer-events: none;
}

/* 4. Pista de Desplazamiento Nativo (Scroll Snap) */
.bersoft-inicio-track-wrapper {
	position: relative;
	width: 100%;
	overflow: hidden;
}

.bersoft-inicio-track {
	display: flex;
	gap: 20px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none; /* Firefox */
	overscroll-behavior-x: contain;
	padding-bottom: 8px;
	padding-top: 4px;
	scroll-behavior: smooth;
}

.bersoft-inicio-track::-webkit-scrollbar {
	display: none; /* Chrome, Safari, Edge */
}
.bersoft-inicio-track:focus-visible {
	outline: 2px solid var(--bersoft-theme-brown);
	outline-offset: 4px;
	border-radius: 4px;
}

/* 5. Diapositivas y Alineación de Tarjetas */
.bersoft-inicio-products-track {
	align-items: stretch;
	--bersoft-prod-gap: 20px;
	--bersoft-prod-cols: 4;
}

.bersoft-inicio-product-slide,
.bersoft-inicio-category-slide {
	scroll-snap-align: start;
	box-sizing: border-box;
}

.bersoft-inicio-product-slide {
	scroll-snap-stop: always;
	flex: 0 0 calc((100% - (var(--bersoft-prod-cols) - 1) * var(--bersoft-prod-gap)) / var(--bersoft-prod-cols));
	min-width: calc((100% - (var(--bersoft-prod-cols) - 1) * var(--bersoft-prod-gap)) / var(--bersoft-prod-cols));
	max-width: calc((100% - (var(--bersoft-prod-cols) - 1) * var(--bersoft-prod-gap)) / var(--bersoft-prod-cols));
	display: flex;
	flex-direction: column;
	height: auto;
}
.bersoft-inicio-product-slide .bersoft-product-card {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	height: 100%;
}
.bersoft-inicio-product-slide .bersoft-card-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}
.bersoft-inicio-product-slide .bersoft-card-actions {
	margin-top: auto;
	min-height: 32px;
	box-sizing: border-box;
}
.bersoft-inicio-product-slide .bersoft-btn-pill {
	min-height: 32px;
	box-sizing: border-box;
}

/* 6. Diapositivas de Categorías (Editorial depurado y compacto) */
.bersoft-inicio-categories-track {
	--bersoft-cat-gap: 20px;
	--bersoft-cat-cols: var(--bersoft-cat-cols-desktop, 4);
}

.bersoft-inicio-category-slide {
	flex: 0 0 calc((100% - (var(--bersoft-cat-cols) - 1) * var(--bersoft-cat-gap)) / var(--bersoft-cat-cols));
	min-width: calc((100% - (var(--bersoft-cat-cols) - 1) * var(--bersoft-cat-gap)) / var(--bersoft-cat-cols));
	max-width: calc((100% - (var(--bersoft-cat-cols) - 1) * var(--bersoft-cat-gap)) / var(--bersoft-cat-cols));
}

.bersoft-cat-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	padding: 4px;
	box-sizing: border-box;
	border-radius: 8px;
	height: 100%;
	transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
}
.bersoft-cat-card:hover {
	transform: translateY(-3px);
}
.bersoft-cat-card:active {
	transform: scale(0.98);
}

.bersoft-cat-media {
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: 8px;
	overflow: hidden;
	background: #FAF7F2;
	border: 1px solid var(--bersoft-border);
	margin-bottom: 8px;
	position: relative;
	box-sizing: border-box;
	transition: box-shadow 240ms ease;
}
.bersoft-cat-card:hover .bersoft-cat-media {
	box-shadow: 0 8px 24px rgba(92, 69, 51, 0.1);
}

.bersoft-cat-card-img,
.bersoft-inicio-editorial-img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block;
}

.bersoft-cat-card-img {
	transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
.bersoft-cat-card:hover .bersoft-cat-card-img {
	transform: scale(1.04);
}

.bersoft-cat-card.is-typo {
	background: #FAF7F2;
	border: 1px solid var(--bersoft-border);
	border-radius: 8px;
	padding: 18px 12px;
	box-sizing: border-box;
	justify-content: center;
	align-items: center;
	text-align: center;
	min-height: 130px;
	transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 240ms ease, border-color 240ms ease;
}
.bersoft-cat-card.is-typo:hover {
	box-shadow: 0 8px 24px rgba(92, 69, 51, 0.1);
	border-color: rgba(92, 69, 51, 0.25);
	transform: translateY(-3px);
}
.bersoft-cat-typo-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	width: 100%;
}
.bersoft-cat-card.is-typo .bersoft-cat-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--bersoft-dark);
	margin: 0 0 4px;
	line-height: 1.35;
}

.bersoft-cat-info {
	text-align: center;
	padding: 0 2px;
}

.bersoft-cat-name {
	font-family: var(--bersoft-font);
	font-size: 14px;
	font-weight: 600;
	margin: 0 0 2px;
	color: var(--bersoft-dark);
	line-height: 1.3;
}
.bersoft-cat-count {
	font-size: 12px;
	color: var(--bersoft-muted);
	display: block;
}

/* 7. Bloque Editorial (Imagen y Texto con atmósfera cálida) */
.bersoft-inicio-editorial-grid {
	display: grid;
	grid-template-columns: 1.12fr 1fr;
	gap: clamp(32px, 4.5vw, 56px);
	align-items: center;
	background: #FAF8F5;
	border: 1px solid rgba(92, 69, 51, 0.12);
	border-radius: 8px;
	padding: clamp(32px, 4vw, 52px);
	box-sizing: border-box;
}

@media (min-width: 861px) {
	.bersoft-inicio-grid-reverse {
		grid-template-columns: 1fr 1.12fr;
	}
	.bersoft-inicio-grid-reverse .bersoft-inicio-editorial-media-col {
		order: 2;
	}
	.bersoft-inicio-grid-reverse .bersoft-inicio-editorial-content-col {
		order: 1;
	}
}

.bersoft-inicio-editorial-figure {
	margin: 0;
	width: 100%;
	aspect-ratio: var(--bersoft-aspect-ratio, 4/3);
	overflow: hidden;
	border-radius: 6px;
	background: #EDE8E0;
	position: relative;
	box-shadow: 0 4px 20px rgba(92, 69, 51, 0.06);
}

.bersoft-inicio-editorial-img {
	transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
}
.bersoft-inicio-editorial-figure:hover .bersoft-inicio-editorial-img {
	transform: scale(1.025);
}

.bersoft-inicio-editorial-placeholder {
	width: 100%;
	height: 100%;
	background: #EDE8E0;
}

.bersoft-inicio-editorial-content-col {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.bersoft-inicio-kicker {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--bersoft-accent);
	margin-bottom: 12px;
}

.bersoft-inicio-editorial-title {
	font-family: var(--bersoft-font);
	font-size: clamp(22px, 2.8vw, 32px);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.25;
	margin: 0 0 16px;
	color: var(--bersoft-dark);
}
.bersoft-inicio-editorial-text {
	font-size: 15px;
	line-height: 1.65;
	color: var(--bersoft-muted);
	margin-bottom: 24px;
	max-width: 520px;
}
.bersoft-inicio-editorial-text p {
	margin: 0 0 12px;
}
.bersoft-inicio-editorial-text p:last-child {
	margin-bottom: 0;
}

.bersoft-inicio-editorial-action {
	display: flex;
	align-items: center;
}

.bersoft-btn-editorial,
a.bersoft-btn-editorial {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: var(--bersoft-theme-brown) !important;
	color: #FFFFFF !important;
	border: 1px solid var(--bersoft-theme-brown) !important;
	border-radius: 9999px !important;
	padding: 12px 28px !important;
	min-height: 44px !important;
	font-family: var(--bersoft-font) !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	text-decoration: none !important;
	cursor: pointer !important;
	box-sizing: border-box !important;
	transition: opacity 160ms ease, transform 120ms ease !important;
	width: fit-content !important;
}
.bersoft-btn-editorial:visited,
a.bersoft-btn-editorial:visited {
	color: #FFFFFF !important;
}
.bersoft-btn-editorial:hover,
a.bersoft-btn-editorial:hover {
	opacity: 0.92 !important;
	color: #FFFFFF !important;
	background: var(--bs-color-primary-dark, var(--bersoft-theme-brown-hover, var(--bersoft-theme-brown))) !important;
	border-color: var(--bs-color-primary-dark, var(--bersoft-theme-brown-hover, var(--bersoft-theme-brown))) !important;
	text-decoration: none !important;
}
.bersoft-cat-card:active,
.bersoft-btn-editorial:active {
	transform: scale(0.97) !important;
}
.bersoft-cat-card:focus-visible,
.bersoft-btn-editorial:focus-visible {
	outline: 2px solid var(--bersoft-theme-brown) !important;
	outline-offset: 3px !important;
	border-radius: 9999px !important;
}

.bersoft-btn-editorial--warning {
	background: #8C7360 !important;
	border-color: #8C7360 !important;
	cursor: not-allowed;
	opacity: 0.88;
}

.bersoft-btn-editorial-hint {
	font-size: 11px;
	opacity: 0.8;
	margin-left: 6px;
	font-weight: 500;
}

/* 8. Avisos de ayuda en el editor */
.bersoft-inicio-notice {
	background: var(--bersoft-badge-bg);
	border: 1px dashed var(--bersoft-border);
	border-radius: 4px;
	padding: 24px;
	text-align: center;
	color: var(--bersoft-muted);
	font-size: 14px;
	margin: 16px 0;
}

.bersoft-inicio-notice p {
	margin: 0;
}

/* 9. Responsivo */
@media (max-width: 1024px) {
	.bersoft-inicio-products-track {
		--bersoft-prod-cols: 3;
	}
}

@media (max-width: 860px) {
	.bersoft-inicio-editorial-grid {
		grid-template-columns: 1fr !important;
		padding: 24px 18px;
		gap: 24px;
	}
	.bersoft-inicio-editorial-content-col {
		order: 2 !important;
	}
	.bersoft-inicio-editorial-media-col {
		order: 1 !important;
	}
}

@media (max-width: 640px) {
	.bersoft-inicio-section {
		padding: 32px 16px;
	}
	.bersoft-inicio-header-row {
		align-items: center;
		gap: 12px;
		margin-bottom: 18px;
	}
	.bersoft-inicio-header,
	.bersoft-inicio-header-info {
		min-width: 0;
	}
	.bersoft-inicio-title {
		font-size: 20px;
	}
	.bersoft-inicio-desc {
		font-size: 13px;
	}
	.bersoft-inicio-nav-controls {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		flex-shrink: 0;
	}
	.bersoft-inicio-nav-btn {
		width: 32px;
		height: 32px;
	}
	.bersoft-inicio-nav-btn svg {
		width: 14px;
		height: 14px;
	}
	.bersoft-inicio-track {
		gap: 12px;
	}
	.bersoft-inicio-products-track {
		--bersoft-prod-gap: 12px;
		--bersoft-prod-cols: 2;
	}
	.bersoft-inicio-categories-track {
		--bersoft-cat-gap: 12px;
		--bersoft-cat-cols: 2;
	}
	.bersoft-inicio-category-slide,
	.bersoft-inicio-product-slide {
		flex: 0 0 calc((100% - 12px) / 2);
		min-width: calc((100% - 12px) / 2);
		max-width: calc((100% - 12px) / 2);
	}
	.bersoft-cat-card.is-typo {
		min-height: 100px;
		padding: 12px 8px;
	}
	.bersoft-cat-card.is-typo .bersoft-cat-name {
		font-size: 13px;
	}
	.bersoft-inicio-product-slide .bersoft-card-title {
		font-size: 13.5px;
		line-height: 1.25;
		margin-bottom: 4px;
	}
	.bersoft-inicio-product-slide .bersoft-card-actions {
		flex-wrap: wrap;
		gap: 4px;
		align-items: center;
		padding-top: 6px;
	}
	.bersoft-inicio-product-slide .bersoft-btn-pill {
		font-size: 11px;
		padding: 4px 10px;
		min-height: 28px;
		margin-left: auto;
	}
}
