/**
 * Hero banner system
 * - Styles communs aux variantes texte+image et full bannière
 * - Overlay configurable (couleur injectée inline dans hero.php)
 * - Ne casse pas le design existant (classes conservées)
 */

/* ========== BASE ========== */

.home-hero,
.home-hero-full {
	width: 100%;
}

/* ========== STYLE FULL BANNIERE ========== */

.home-hero-full {
	position: relative;
	background-repeat: no-repeat;
	background-size: cover;
	background-position: center;
	overflow: hidden;
	min-height: var(--hero-height, 500px);
}

/* Voile overlay (la couleur RGBA est injectée inline via hero.php) */
.hero-full-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}

/* Container contenu au-dessus de l'overlay */
.hero-full-container {
	position: relative;
	z-index: 2;
	height: 100%;
	min-height: var(--hero-height, 500px);
	display: flex;
	align-items: center;
}

/* Contenu */
.hero-full-content {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 60px 20px;
}

/* Titres/texte : fallback pour visibilité si overlay sombre */
.hero-full-title,
.hero-full-rating,
.hero-full-description {
	color: #fff;
}

/* Boutons */
.hero-full-buttons {
	margin-top: 25px;
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

/* ========== STYLE TEXTE + IMAGE ========== */
/* On ne touche pas au layout existant, on sécurise uniquement la hauteur. */
.home-hero .hero-container {
	min-height: var(--hero-height, 500px);
}

/* Image split (hero-image) */
.home-hero .hero-image {
	background-repeat: no-repeat;
	min-height: var(--hero-height, 500px);
}

/* ========== RESPONSIVE ========== */

@media (max-width: 992px) {
	.hero-full-content {
		padding: 45px 18px;
	}
}

@media (max-width: 576px) {
	.hero-full-content {
		padding: 35px 16px;
	}
}

/* Navbar déplacée dans la bannière (option "Image banniere") */
.home-hero-full .hero-navbar-wrapper {
	position: relative;
	z-index: 2; /* au-dessus de l'overlay (z-index: 1) */
}
/* ==========================================================
   Navbar injectée dans la bannière ("Image banniere")
   -> doit prendre 100% de largeur
   -> ne doit pas être contrainte par le flex du hero-full
   ========================================================== */

.home-hero-full .hero-navbar-wrapper{
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 3; /* au-dessus de l'overlay (1) et du contenu (2) */
}

/* Sécurité : si jamais la navbar est injectée sans wrapper */
.home-hero-full > nav.nova-navbar,
.home-hero-full > .nova-navbar{
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 3;
}
/* ==========================================================
   MODE "Image bannière" : fond partagé menu + bannière
   (activé via body.mytheme-nav-in-hero)
   - La bannière est remontée sous le menu (effet overlay)
   - Le menu (non sticky) devient semi-transparent + texte blanc
   ========================================================== */

/* ------------------------------------------------------------
   Hauteur de référence du menu (sert aux calculs d’offset)
   ------------------------------------------------------------ */
:root{
  --mytheme-hero-nav-offset: 90px; /* valeur safe desktop */
}
@media (max-width: 992px){
  :root{ --mytheme-hero-nav-offset: 76px; }
}
@media (max-width: 576px){
  :root{ --mytheme-hero-nav-offset: 70px; }
}

/* ------------------------------------------------------------
   1) Remonter la bannière derrière le menu (le menu reste dans le header)
   ------------------------------------------------------------ */
.mytheme-nav-in-hero .home-hero,
.mytheme-nav-in-hero .home-hero-full,
.mytheme-nav-in-hero .home-hero-carousel{
  margin-top: calc(-1 * var(--mytheme-hero-nav-offset, 90px));
}

/* ------------------------------------------------------------
   2) Aspect du menu tant qu'il n'est PAS sticky
   ------------------------------------------------------------ */
.mytheme-nav-in-hero .nova-menu:not(.is-fixed){
  border-bottom: none !important;
  box-shadow: none !important;

  /* voile/gradient pour la lisibilité sur l’image */
  background: linear-gradient(
    180deg,
    rgba(0,0,0,.55) 0%,
    rgba(0,0,0,.28) 60%,
    rgba(0,0,0,0) 100%
  ) !important;

  /* léger flou pour améliorer le contraste */
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);

  /* ombre légère sur texte/logo/liens */
  text-shadow: 0 1px 2px rgba(0,0,0,.55);
}

/* Liens du menu en blanc (uniquement avant sticky) */
.mytheme-nav-in-hero .nova-menu:not(.is-fixed) .navbar-nav .nav-link{
  color: rgba(255,255,255,.92) !important;
}
.mytheme-nav-in-hero .nova-menu:not(.is-fixed) .navbar-nav .nav-link:hover,
.mytheme-nav-in-hero .nova-menu:not(.is-fixed) .navbar-nav .nav-link:focus{
  color: #fff !important;
}

/* Icônes en blanc (recherche / compte / panier) */
.mytheme-nav-in-hero .nova-menu:not(.is-fixed) .bi-search,
.mytheme-nav-in-hero .nova-menu:not(.is-fixed) .bi-person,
.mytheme-nav-in-hero .nova-menu:not(.is-fixed) .bi-bag{
  color: rgba(255,255,255,.92) !important;
}

/* Icône hamburger (mobile) en blanc */
.mytheme-nav-in-hero .nova-menu:not(.is-fixed) .navbar-toggler-icon{
  filter: invert(1);
  opacity: .95;
}

/* ------------------------------------------------------------
   3) Décalage du contenu hero (éviter chevauchement avec le menu overlay)
   ------------------------------------------------------------ */

/* Full banner */
.mytheme-nav-in-hero .home-hero-full .hero-full-content{
  padding-top: calc(60px + var(--mytheme-hero-nav-offset, 90px));
}
@media (max-width: 992px){
  .mytheme-nav-in-hero .home-hero-full .hero-full-content{
    padding-top: calc(45px + var(--mytheme-hero-nav-offset, 76px));
  }
}
@media (max-width: 576px){
  .mytheme-nav-in-hero .home-hero-full .hero-full-content{
    padding-top: calc(35px + var(--mytheme-hero-nav-offset, 70px));
  }
}

/* Split hero : on augmente uniquement le padding-top du bloc texte */
.mytheme-nav-in-hero .home-hero .hero-content > div{
  padding-top: calc(clamp(32px, 6vw, 64px) + var(--mytheme-hero-nav-offset, 90px));
}

/* ==========================================================
   Finition lisibilité : voile/gradient derrière la navbar
   (uniquement quand la navbar est dans la bannière et NON sticky)
   ========================================================== */

.mytheme-nav-in-hero .home-hero-full .nova-menu:not(.is-fixed),
.mytheme-nav-in-hero .home-hero .nova-menu:not(.is-fixed){
  /* Remplace le "transparent" par un voile dégradé */
  background: linear-gradient(
    180deg,
    rgba(0,0,0,.55) 0%,
    rgba(0,0,0,.28) 60%,
    rgba(0,0,0,0) 100%
  ) !important;

  /* Optionnel mais utile : léger flou pour améliorer le contraste
     (si tu veux, on peut l’enlever ensuite) */
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

/* Petit confort de lecture : ombre légère sur texte/logo/liens */
.mytheme-nav-in-hero .home-hero-full .nova-menu:not(.is-fixed),
.mytheme-nav-in-hero .home-hero .nova-menu:not(.is-fixed){
  text-shadow: 0 1px 2px rgba(0,0,0,.55);
}

/* ============================================================
   HERO CAROUSEL (Bootstrap)
   ============================================================ */

.home-hero-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}
/* Force le "plein écran" SANS créer de scroll horizontal
   (100vw inclut la scrollbar verticale => overflow horizontal de quelques px)
*/
.home-hero-carousel.hero-breakout-fullwidth {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}


/* Sécurise Bootstrap carousel en pleine largeur */
.home-hero-carousel.hero-breakout-fullwidth #novathemeHeroCarousel,
.home-hero-carousel.hero-breakout-fullwidth .carousel-inner,
.home-hero-carousel.hero-breakout-fullwidth .carousel-item {
    width: 100%;
}

/* Important : évite un éventuel overflow horizontal induit par des transforms Bootstrap */
.home-hero-carousel.hero-breakout-fullwidth .carousel {
    overflow: hidden;
}

/* ------------------------------------------------------------
   Compatibilité "Fond Menu Principal"
   - Quand Fond Menu Principal = image_banner : la navbar est rendue DANS le hero.
   - Dans ce cas, on la met en overlay (au-dessus du carousel) pour éviter qu’elle réduise visuellement le carrousel.
   ------------------------------------------------------------ */
.home-hero-carousel.menu-bg-image_banner .hero-navbar-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
}

/* Optionnel mais recommandé :
   - améliore la lisibilité de la navbar sur des slides clairs (léger voile).
   - Ne modifie pas la logique des autres types de fond.
*/
.home-hero-carousel.menu-bg-image_banner .hero-navbar-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0));
    pointer-events: none;
}
.home-hero-carousel .carousel-inner,
.home-hero-carousel .carousel-item {
    height: 600px;
}

@media (max-width: 768px) {
    .home-hero-carousel .carousel-inner,
    .home-hero-carousel .carousel-item {
        height: 480px;
    }
}

.home-hero-carousel .carousel-inner,
.home-hero-carousel .carousel-item {
    /* Utilise la variable CSS pilotée par le Customizer (mytheme_hero_height) */
    height: var(--hero-height, 600px);
}

@media (max-width: 768px) {
    .home-hero-carousel .carousel-inner,
    .home-hero-carousel .carousel-item {
        /* Sur mobile : on évite les bannières trop hautes */
        height: min(var(--hero-height, 600px), 480px);
    }
}


.hero-carousel-slide {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
}

.hero-carousel-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-carousel-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
}

.hero-carousel-text {
    position: absolute;
    left: 0;
    right: 0;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
}

/* ------------------------------------------------------------
   ALIGNEMENT HORIZONTAL GLOBAL (TEXTE + BOUTON) DANS LE CARROUSEL
   ------------------------------------------------------------ */

/* 1) Le texte à l'intérieur */
.hero-carousel-text.is-align-left {
    text-align: left;
}

.hero-carousel-text.is-align-center {
    text-align: center;
}

.hero-carousel-text.is-align-right {
    text-align: right;
}

/* 2) Le conteneur du bouton (CTA) : centrage parfait */
.hero-carousel-text .hero-carousel-buttons,
.hero-carousel-text .hero-carousel-button,
.hero-carousel-text .hero-carousel-cta {
    display: flex;
    gap: 10px;
}

/* Alignement bouton selon classe parent */
.hero-carousel-text.is-align-left .hero-carousel-buttons,
.hero-carousel-text.is-align-left .hero-carousel-button,
.hero-carousel-text.is-align-left .hero-carousel-cta {
    justify-content: flex-start;
}

.hero-carousel-text.is-align-center .hero-carousel-buttons,
.hero-carousel-text.is-align-center .hero-carousel-button,
.hero-carousel-text.is-align-center .hero-carousel-cta {
    justify-content: center;
}

.hero-carousel-text.is-align-right .hero-carousel-buttons,
.hero-carousel-text.is-align-right .hero-carousel-button,
.hero-carousel-text.is-align-right .hero-carousel-cta {
    justify-content: flex-end;
}

/* 3) Si le bouton est inline-block / a une marge auto, on neutralise */
.hero-carousel-text.is-align-center a.button,
.hero-carousel-text.is-align-center .btn,
.hero-carousel-text.is-align-center .button {
    margin-left: 0;
    margin-right: 0;
}


.hero-carousel-title {
    margin-bottom: 12px;
}

.hero-carousel-description {
    margin-top: 12px;
    margin-bottom: 22px;
    line-height: 1.25;
    text-shadow: 0 2px 6px rgba(0,0,0,.35);
}


.hero-carousel-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

/* Contrôles */
.home-hero-carousel .carousel-control-prev,
.home-hero-carousel .carousel-control-next {
    z-index: 3;
}

