/**
 * Ella Hero Slider — alinhado ao hero Bootstrap do tema Ella 4.0.
 *
 * @package Ella_WooCommerce_Addon
 */

/* -------------------------------------------------------------------------
 * Container / CLS — proporção semelhante ao desktop hero (≈ 3,2:1) + fallback
 * ------------------------------------------------------------------------- */
.ella-hero-slider {
	position: relative;
	width: 100%;
}

.ella-hero-slider .ella-hero-carousel {
	position: relative;
	background-color: #505050; /* fallback enquanto a imagem carrega */
	aspect-ratio: 32 / 10;
	min-height: 280px;
}

/* Mobile: mesma faixa que hero-home.php (426×600, altura até 600px) */
@media (max-width: 767.98px) {
	.ella-hero-slider .ella-hero-carousel {
		aspect-ratio: 426 / 600;
		min-height: 280px;
		max-height: 600px;
	}
}

@media (min-width: 768px) {
	.ella-hero-slider .ella-hero-carousel {
		min-height: 350px;
		max-height: 600px;
		aspect-ratio: 32 / 10;
	}
}

@media (min-width: 1400px) {
	.ella-hero-slider .ella-hero-carousel {
		min-height: 400px;
	}
}

.ella-hero-slider .carousel-inner {
	height: 100%;
}

.ella-hero-slider .carousel-item {
	position: relative;
	height: 100%;
	min-height: 100%;
	overflow: hidden;
	transition: transform 0.6s ease-in-out;
}

/* Fundo em DIV (como hero original): background-size cover na área do slide */
.ella-hero-slider .carousel-item .ella-hero-slide-bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
	margin: 0;
	background-color: #505050;
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
}

/* Altura explícita do item = altura do carrossel (evita colapso antes do BS medir) */
.ella-hero-slider .carousel-inner,
.ella-hero-slider .carousel-item {
	min-height: inherit;
}

/* -------------------------------------------------------------------------
 * Overlay — tipografia fluida (herda família do tema, reforça legibilidade)
 * ------------------------------------------------------------------------- */
.ella-hero-slider .ella-hero-content {
	color: #fff;
	font-family: inherit;
}

/* lh-2 como no hero-home do tema */
.ella-hero-slider .lh-2 {
	line-height: 1.2 !important;
}

/* Título principal (h1) — desktop: tamanho fluido; mobile: inline 32px no renderer */
.ella-hero-slider .ella-hero-content h1.ella-hero-slide-title {
	font-family: inherit;
	font-weight: 700;
	color: #fff !important;
	text-shadow: rgba(0, 0, 0, 0.65) 1px 1px 4px;
	font-size: clamp(1.375rem, 4vw + 0.5rem, 2.75rem);
	margin-bottom: 0.35em;
}

/*
 * Subtítulo (h2) — proporcional ao h1 como no Bootstrap 5 / hero-home (≈ escala 2.5rem → 2rem);
 * mobile: font-size inline 24px no renderer sobrepõe este clamp.
 */
.ella-hero-slider .ella-hero-content h2.ella-hero-slide-subtitle {
	font-family: inherit;
	font-weight: 700;
	line-height: 1.2;
	color: #fff !important;
	text-shadow: rgba(0, 0, 0, 0.65) 1px 1px 4px;
	font-size: clamp(1.1rem, 3.2vw + 0.44rem, 2.2rem);
	margin-bottom: 0.35em;
}

/* Faixa de CTAs (como hero-home: parágrafo só envolve os .btn) */
.ella-hero-slider .ella-hero-content p.ella-hero-buttons-wrap {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
	margin-bottom: 0;
	margin-top: 0.25rem;
	text-shadow: none;
}

/* Mobile: .container com flex — hero-home: align-items-end + faixa p-3 pb-4 no .hero-content-box */
.ella-hero-slider .ella-hero-content-layer--mobile {
	align-items: flex-end !important;
	justify-content: center !important;
}

.ella-hero-slider .ella-hero-mobile-inner {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/* Mobile-first: narrow view centraliza copy; camada --mobile já força flex-end no eixo vertical */
@media (max-width: 767.98px) {
	.ella-hero-slider .carousel-item .d-flex.align-items-center {
		justify-content: center !important;
	}

	.ella-hero-slider .ella-hero-content {
		text-align: center !important;
	}
}

/* -------------------------------------------------------------------------
 * Botões — classes nativas Ella 4.0 (.btn-ella-primary / .btn-ella-secondary)
 * Não usar border-radius: inherit (quebrava o pill do tema por herdar 0 do pai).
 * ------------------------------------------------------------------------- */
.ella-hero-slider .btn-ella-primary,
.ella-hero-slider .btn-ella-secondary {
	font-family: inherit;
}

/* Desktop hero: espelha main.css (.btn-ella-hero + paddings) com especificidade segura */
@media (min-width: 768px) {
	.ella-hero-slider .btn.btn-ella-primary.btn-ella-hero,
	.ella-hero-slider .btn.btn-ella-secondary.btn-ella-hero {
		min-width: 200px;
		text-align: center;
		padding-left: 1.5rem;
		padding-right: 1.5rem;
		border-radius: 1.5rem;
	}
}

.ella-hero-slider .btn-ella-primary:focus-visible,
.ella-hero-slider .btn-ella-secondary:focus-visible {
	outline: 2px solid #0d47a1;
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * Indicadores e setas — sobre a imagem (z-index), padrão hero original
 * ------------------------------------------------------------------------- */
.ella-hero-slider .carousel-indicators {
	position: absolute;
	bottom: 1rem;
	left: 50%;
	transform: translateX(-50%);
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	gap: 8px;
	z-index: 15;
	justify-content: center;
}

.ella-hero-slider .carousel-indicators [data-bs-target] {
	background-color: #ffc107;
	border: none;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	opacity: 0.6;
	transition: all 0.3s ease;
	cursor: pointer;
}

.ella-hero-slider .carousel-indicators .active {
	background-color: #0d47a1;
	opacity: 1;
	transform: scale(1.2);
}

.ella-hero-slider .carousel-control-prev,
.ella-hero-slider .carousel-control-next {
	width: 35px;
	height: 35px;
	background-color: #ffc107;
	border-radius: 50%;
	color: #fff;
	transition: all 0.3s ease;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 20;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 1;
}

.ella-hero-slider .carousel-control-prev {
	left: 12px;
}

.ella-hero-slider .carousel-control-next {
	right: 12px;
}

.ella-hero-slider .carousel-control-prev:hover,
.ella-hero-slider .carousel-control-next:hover {
	background-color: #e6a800;
	transform: translateY(-50%) scale(1.05);
}

.ella-hero-slider .carousel-control-prev-icon,
.ella-hero-slider .carousel-control-next-icon {
	background-size: 18px;
	width: 18px;
	height: 18px;
}

/* Mobile: dots visíveis; setas ocultas — desktop: o inverso */
@media (max-width: 767.98px) {
	.ella-hero-slider .carousel-control-prev,
	.ella-hero-slider .carousel-control-next {
		display: none !important;
	}

	.ella-hero-slider .carousel-indicators {
		bottom: 0.75rem;
	}
}

@media (min-width: 768px) {
	.ella-hero-slider .carousel-indicators {
		display: none !important;
	}

	.ella-hero-slider .carousel-control-prev,
	.ella-hero-slider .carousel-control-next {
		display: flex !important;
	}
}

/* Slide inteiro clicável (modo simples): z-index abaixo dos controles */
.ella-hero-slider .carousel-item > a.stretched-link {
	z-index: 1;
}

.ella-hero-slider .ella-hero-content {
	z-index: 5;
}

/* Acessibilidade foco indicadores */
.ella-hero-slider .carousel-indicators [data-bs-target]:focus {
	outline: 2px solid #0d47a1;
	outline-offset: 2px;
}

/*
 * Home com plugin: mesma árvore que widgets/hero-home.php (#hero-carousel-home > #hero-desktop | #hero-mobile).
 * `.ella-hero-slider` fica no #hero-carousel-home (hero-home.php) para assets/UTMs.
 *
 * Vários slides: o tema coloca imagem de fallback + background-size contain no .carousel / .carousel-item.
 * Na transição vê-se o fundo errado; só cada slide deve mostrar imagem (cover).
 */
#hero-carousel-home.ella-hero-home--plugin #hero-desktop-carousel.widget-hero-home-background {
	background: none !important;
}

#hero-carousel-home.ella-hero-home--plugin #hero-desktop-carousel .carousel-inner,
#hero-carousel-home.ella-hero-home--plugin #hero-mobile-carousel .carousel-inner {
	height: 100%;
	min-height: 100%;
}

#hero-carousel-home.ella-hero-home--plugin #hero-desktop-carousel .carousel-item,
#hero-carousel-home.ella-hero-home--plugin #hero-mobile-carousel .carousel-item {
	min-height: 100%;
}

#hero-carousel-home.ella-hero-home--plugin .carousel-item.widget-hero-home-background,
#hero-carousel-home.ella-hero-home--plugin .carousel-item.widget-hero-home-background-mobile {
	background-size: cover !important;
	background-position: center center !important;
	background-repeat: no-repeat !important;
}

/* Reforço da caixa de copy (o tema já define dentro de #hero-carousel-home) */
#hero-carousel-home.ella-hero-home--plugin .hero-content-box {
	max-width: 580px;
	box-sizing: border-box;
}

@media (max-width: 1200px) {
	#hero-carousel-home.ella-hero-home--plugin .hero-content-box {
		max-width: 450px;
	}
}

@media (max-width: 992px) {
	#hero-carousel-home.ella-hero-home--plugin .hero-content-box {
		max-width: 400px;
	}
}
