/**
 * Estilos Frontend — Bersoft Home: Bloque "Productos Destacados / Product Carousel" — v0.3.4.
 *
 * @package Bersoft_Home
 * @since   0.3.0
 * @version 0.3.4
 */

/* ==========================================================================
   1. CONTENEDOR PRINCIPAL Y ESPACIADO VERTICAL
   ========================================================================== */

.bersoft-featured-products-section {
	width: 100%;
	background-color: var(--bs-feat-bg, #FFFFFF);
	padding-top: var(--bs-feat-pad-top-d, var(--bs-feat-pad-top, 40px));
	padding-bottom: var(--bs-feat-pad-bottom-d, var(--bs-feat-pad-bottom, 48px));
	box-sizing: border-box;
	contain: layout style;
	position: relative;
	overflow: hidden;
}

.bersoft-featured-container {
	width: 100%;
	max-width: var(--bs-feat-max-w, 1420px);
	margin: 0 auto;
	padding-top: 0;
	padding-bottom: 0;
	padding-left: var(--bs-feat-pad-left-d, 28px);
	padding-right: var(--bs-feat-pad-right-d, 28px);
	box-sizing: border-box;
}

/* ==========================================================================
   2. CABECERA EDITORIAL & CONTROLES EN CABECERA
   ========================================================================== */

.bersoft-featured-products-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: var(--bs-feat-head-gap-d, 24px);
}

.bersoft-featured-header-text {
	max-width: 720px;
}

/* Eyebrow / Antetítulo */
.bersoft-featured-eyebrow {
	display: block;
	font-family: var(--bs-font-family-body, 'Proxima Nova', 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
	font-size: var(--bs-feat-eyebrow-size-d, 13px);
	font-weight: var(--bs-feat-eyebrow-weight-d, 700);
	line-height: var(--bs-feat-eyebrow-lh-d, 1.2);
	letter-spacing: var(--bs-feat-eyebrow-ls-d, 0.16em);
	text-align: var(--bs-feat-eyebrow-align-d, left);
	text-transform: var(--bs-feat-eyebrow-transform, uppercase);
	color: var(--bs-feat-eyebrow-color, #0F4C5C);
	margin-bottom: var(--bs-feat-eyebrow-mb-d, 10px);
}

/* Título Principal */
.bersoft-featured-title {
	font-family: var(--bs-font-family-heading, 'Proxima Nova', 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
	font-size: var(--bs-feat-title-size-d, clamp(26px, 3.2vw, 36px));
	font-weight: var(--bs-feat-title-weight-d, 800);
	line-height: var(--bs-feat-title-lh-d, 1.12);
	letter-spacing: var(--bs-feat-title-ls-d, -0.025em);
	text-align: var(--bs-feat-title-align-d, left);
	text-transform: var(--bs-feat-title-transform, none);
	color: var(--bs-feat-title-color, #0F172A);
	margin: 0 0 var(--bs-feat-title-mb-d, 12px) 0;
	text-wrap: balance;
}

/* Descripción */
.bersoft-featured-desc {
	font-family: var(--bs-font-family-body, 'Proxima Nova', 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
	font-size: var(--bs-feat-desc-size-d, 16px);
	font-weight: var(--bs-feat-desc-weight-d, 400);
	line-height: var(--bs-feat-desc-lh-d, 1.55);
	letter-spacing: var(--bs-feat-desc-ls-d, 0);
	text-align: var(--bs-feat-desc-align-d, left);
	text-transform: var(--bs-feat-desc-transform, none);
	color: var(--bs-feat-desc-color, #475569);
	margin: 0 0 var(--bs-feat-desc-mb-d, 0) 0;
	text-wrap: pretty;
}

/* Grupo de Acción en Cabecera (Ver Todo + Flechas) */
.bersoft-featured-header-action {
	display: inline-flex;
	align-items: center;
	gap: 16px;
	flex-shrink: 0;
}

/* Enlace Ver Todo */
.bersoft-featured-view-all {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--bs-font-family-body, 'Proxima Nova', 'DM Sans', sans-serif);
	font-size: var(--bs-feat-link-size-d, 14.5px);
	font-weight: var(--bs-feat-link-weight-d, 700);
	line-height: var(--bs-feat-link-lh-d, 1.2);
	letter-spacing: var(--bs-feat-link-ls-d, 0.02em);
	text-align: var(--bs-feat-link-align-d, right);
	text-transform: var(--bs-feat-link-transform, none);
	color: var(--bs-feat-link-color, #0F4C5C);
	text-decoration: none;
	padding: 8px 14px;
	border-radius: 6px;
	transition: color 150ms ease, background-color 150ms ease, transform 150ms ease;
	white-space: nowrap;
}

.bersoft-featured-view-all .bersoft-arrow-icon {
	transition: transform 150ms ease;
	display: inline-block;
}

.bersoft-featured-view-all:hover {
	color: var(--bs-feat-link-color-h, #0B3844);
	background-color: rgba(15, 76, 92, 0.06);
}

.bersoft-featured-view-all:hover .bersoft-arrow-icon {
	transform: translateX(4px);
}

/* Contenedor de Flechas en Cabecera */
.bersoft-featured-nav-arrows {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.bersoft-featured-arrow {
	all: unset;
	box-sizing: border-box;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	color: #0F172A;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, transform 120ms ease, opacity 150ms ease;
	outline: none;
}

.bersoft-featured-arrow:focus-visible {
	outline: 2px solid #0F4C5C;
	outline-offset: 2px;
}

.bersoft-featured-arrow:hover:not(.is-disabled) {
	background: #0F4C5C;
	color: #ffffff;
	border-color: #0F4C5C;
	transform: scale(1.05);
}

.bersoft-featured-arrow:active:not(.is-disabled) {
	transform: scale(0.96);
}

.bersoft-featured-arrow.is-disabled {
	opacity: 0.35 !important;
	cursor: not-allowed;
	pointer-events: none;
}

/* ==========================================================================
   3. CARRUSEL & GEOMETRÍA ADAPTATIVA (CSS SCROLL SNAP)
   ========================================================================== */

.bersoft-featured-carousel-outer {
	position: relative;
	width: 100%;
}

.bersoft-featured-carousel-track {
	display: flex;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	gap: var(--bs-feat-gap-d, 20px);
	padding: 4px 2px 10px 2px;
	scrollbar-width: none;
	box-sizing: border-box;
}

.bersoft-featured-carousel-track::-webkit-scrollbar {
	display: none;
}

/* En modo estático (cuando total_products <= effective_visible) */
.is-static-grid .bersoft-featured-carousel-track {
	scroll-snap-type: none;
	overflow-x: visible;
}

/* Ítem individual de tarjeta en carrusel */
.bersoft-featured-card-item {
	flex: 0 0 calc((100% - ((var(--bs-feat-cols-d, 4) - 1) * var(--bs-feat-gap-d, 20px))) / var(--bs-feat-cols-d, 4));
	min-width: calc((100% - ((var(--bs-feat-cols-d, 4) - 1) * var(--bs-feat-gap-d, 20px))) / var(--bs-feat-cols-d, 4));
	max-width: calc((100% - ((var(--bs-feat-cols-d, 4) - 1) * var(--bs-feat-gap-d, 20px))) / var(--bs-feat-cols-d, 4));
	scroll-snap-align: start;
	scroll-snap-stop: always;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	height: auto;
}

/* ==========================================================================
   4. ALINEACIÓN CANÓNICA DE PRODUCT CARDS (IDÉNTICA A /TIENDA)
   ========================================================================== */

.bersoft-featured-card-item .bersoft-product-card {
	height: 100%;
	width: 100%;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	box-sizing: border-box;
}

.bersoft-featured-card-item .bersoft-card-info {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	justify-content: space-between;
}

.bersoft-featured-card-item .bersoft-card-meta-top {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.bersoft-featured-card-item .bersoft-card-action-wrap {
	margin-top: auto;
	padding-top: 6px;
	width: 100%;
}

/* ==========================================================================
   5. PAGINACIÓN POR DOTS DETERMINISTA
   ========================================================================== */

.bersoft-featured-carousel-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 18px;
}

.bersoft-featured-dot {
	all: unset;
	box-sizing: border-box;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background-color: #cbd5e1;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	transition: width 200ms cubic-bezier(0.16, 1, 0.3, 1),
	            background-color 200ms ease,
	            border-radius 200ms ease;
	outline: none;
}

.bersoft-featured-dot.is-active {
	width: 22px;
	border-radius: 4px;
	background-color: #0F4C5C;
}

.bersoft-featured-dot:focus-visible {
	outline: 2px solid #0F4C5C;
	outline-offset: 2px;
}

/* ==========================================================================
   6. RESPONSIVE TABLET (768px - 1023px)
   ========================================================================== */

@media (min-width: 768px) and (max-width: 1023px) {
	.bersoft-featured-products-section {
		padding-top: var(--bs-feat-pad-top-t, 32px);
		padding-bottom: var(--bs-feat-pad-bottom-t, 36px);
	}

	.bersoft-featured-container {
		padding-left: var(--bs-feat-pad-left-t, 20px);
		padding-right: var(--bs-feat-pad-right-t, 20px);
	}

	.bersoft-featured-products-header {
		margin-bottom: var(--bs-feat-head-gap-t, 20px);
	}

	.bersoft-featured-eyebrow {
		font-size: var(--bs-feat-eyebrow-size-t, 12px);
		font-weight: var(--bs-feat-eyebrow-weight-t, 700);
		line-height: var(--bs-feat-eyebrow-lh-t, 1.2);
		letter-spacing: var(--bs-feat-eyebrow-ls-t, 0.14em);
		text-align: var(--bs-feat-eyebrow-align-t, left);
		margin-bottom: var(--bs-feat-eyebrow-mb-t, 8px);
	}

	.bersoft-featured-title {
		font-size: var(--bs-feat-title-size-t, 28px);
		font-weight: var(--bs-feat-title-weight-t, 800);
		line-height: var(--bs-feat-title-lh-t, 1.15);
		letter-spacing: var(--bs-feat-title-ls-t, -0.02em);
		text-align: var(--bs-feat-title-align-t, left);
		margin-bottom: var(--bs-feat-title-mb-t, 10px);
	}

	.bersoft-featured-desc {
		font-size: var(--bs-feat-desc-size-t, 15px);
		font-weight: var(--bs-feat-desc-weight-t, 400);
		line-height: var(--bs-feat-desc-lh-t, 1.50);
		letter-spacing: var(--bs-feat-desc-ls-t, 0);
		text-align: var(--bs-feat-desc-align-t, left);
		margin-bottom: var(--bs-feat-desc-mb-t, 0);
	}

	.bersoft-featured-view-all {
		font-size: var(--bs-feat-link-size-t, 14px);
		font-weight: var(--bs-feat-link-weight-t, 700);
		line-height: var(--bs-feat-link-lh-t, 1.2);
		letter-spacing: var(--bs-feat-link-ls-t, 0.02em);
		text-align: var(--bs-feat-link-align-t, left);
	}

	.bersoft-featured-carousel-track {
		gap: var(--bs-feat-gap-t, 16px);
	}

	.bersoft-featured-card-item {
		flex: 0 0 calc((100% - ((var(--bs-feat-cols-t, 2) - 1) * var(--bs-feat-gap-t, 16px))) / var(--bs-feat-cols-t, 2));
		min-width: calc((100% - ((var(--bs-feat-cols-t, 2) - 1) * var(--bs-feat-gap-t, 16px))) / var(--bs-feat-cols-t, 2));
		max-width: calc((100% - ((var(--bs-feat-cols-t, 2) - 1) * var(--bs-feat-gap-t, 16px))) / var(--bs-feat-cols-t, 2));
	}
}

/* ==========================================================================
   7. RESPONSIVE MÓVIL (< 768px)
   ========================================================================== */

@media (max-width: 767px) {
	.bersoft-featured-products-section {
		padding-top: var(--bs-feat-pad-top-m, 24px);
		padding-bottom: var(--bs-feat-pad-bottom-m, 28px);
	}

	.bersoft-featured-container {
		padding-left: var(--bs-feat-pad-left-m, var(--bs-feat-pad-m, 18px));
		padding-right: var(--bs-feat-pad-right-m, var(--bs-feat-pad-m, 18px));
	}

	.bersoft-featured-products-header {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
		margin-bottom: var(--bs-feat-head-gap-m, 16px);
	}

	.bersoft-featured-header-action {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
	}

	.bersoft-featured-eyebrow {
		font-size: var(--bs-feat-eyebrow-size-m, 11px);
		font-weight: var(--bs-feat-eyebrow-weight-m, 700);
		line-height: var(--bs-feat-eyebrow-lh-m, 1.2);
		letter-spacing: var(--bs-feat-eyebrow-ls-m, 0.12em);
		text-align: var(--bs-feat-eyebrow-align-m, left);
		margin-bottom: var(--bs-feat-eyebrow-mb-m, 6px);
	}

	.bersoft-featured-title {
		font-size: var(--bs-feat-title-size-m, 22px);
		font-weight: var(--bs-feat-title-weight-m, 800);
		line-height: var(--bs-feat-title-lh-m, 1.18);
		letter-spacing: var(--bs-feat-title-ls-m, -0.015em);
		text-align: var(--bs-feat-title-align-m, left);
		margin-bottom: var(--bs-feat-title-mb-m, 8px);
	}

	.bersoft-featured-desc {
		font-size: var(--bs-feat-desc-size-m, 14px);
		font-weight: var(--bs-feat-desc-weight-m, 400);
		line-height: var(--bs-feat-desc-lh-m, 1.45);
		letter-spacing: var(--bs-feat-desc-ls-m, 0);
		text-align: var(--bs-feat-desc-align-m, left);
		margin-bottom: var(--bs-feat-desc-mb-m, 0);
	}

	.bersoft-featured-view-all {
		font-size: var(--bs-feat-link-size-m, 13px);
		font-weight: var(--bs-feat-link-weight-m, 700);
		line-height: var(--bs-feat-link-lh-m, 1.2);
		letter-spacing: var(--bs-feat-link-ls-m, 0.02em);
		text-align: var(--bs-feat-link-align-m, left);
		padding: 4px 0;
	}

	.bersoft-featured-carousel-track {
		gap: var(--bs-feat-gap-m, 12px);
		padding-bottom: 6px;
	}

	.bersoft-featured-card-item {
		flex: 0 0 calc((100% - ((var(--bs-feat-cols-m, 2) - 1) * var(--bs-feat-gap-m, 12px))) / var(--bs-feat-cols-m, 2));
		min-width: calc((100% - ((var(--bs-feat-cols-m, 2) - 1) * var(--bs-feat-gap-m, 12px))) / var(--bs-feat-cols-m, 2));
		max-width: calc((100% - ((var(--bs-feat-cols-m, 2) - 1) * var(--bs-feat-gap-m, 12px))) / var(--bs-feat-cols-m, 2));
	}

	.bersoft-featured-arrow {
		width: 36px;
		height: 36px;
	}
}

/* ==========================================================================
   8. ACCESIBILIDAD — PREFERS-REDUCED-MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.bersoft-featured-carousel-track {
		scroll-behavior: auto !important;
	}
	.bersoft-featured-arrow,
	.bersoft-featured-dot,
	.bersoft-featured-view-all {
		transition: none !important;
		transform: none !important;
	}
}
