.category-banner {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  margin: 1rem 0 1.5rem;
  background-color: #111;
}

.category-banner__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.category-banner__overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  padding: 1rem 2.5rem;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.18) 55%, rgba(0, 0, 0, 0) 100%);
}

.category-banner__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  margin: 0 0 0.55rem;
  padding: 0;
  list-style: none;
  font-family: Inter, sans-serif;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.category-banner__breadcrumb li {
  display: inline-flex;
  align-items: center;
  list-style: none;
}

.category-banner__breadcrumb li + li::before {
  content: "/";
  margin: 0 0.55rem;
  color: rgba(255, 255, 255, 0.45);
}

.category-banner__breadcrumb a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.category-banner__breadcrumb a:hover {
  color: #fff;
}

.category-banner__breadcrumb span {
  color: #fff;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.category-banner__title {
  font-family: "Playfair Display", serif;
  font-weight: 500;
  font-size: 1.75rem;
  letter-spacing: 0.2em;
  line-height: 1.2;
  text-transform: uppercase;
  color: #fff;
  margin: 0;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.35);
}

.category-banner__page {
  display: inline-block;
  margin-left: 0.35em;
  font-family: Inter, sans-serif;
  font-size: 0.7em;
  font-weight: 400;
  letter-spacing: 0.12em;
}

/* Sous-catégories : étiquettes sous le titre */
.category-banner__subcats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.45rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
  max-width: 100%;
}

.category-banner__subcats li {
  list-style: none;
  flex: 0 0 auto;
}

.category-banner__subcats a {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 0.85rem;
  border: 1px solid #fff;
  border-radius: 2px;
  background: transparent;
  font-family: Inter, sans-serif;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  /* Texte blanc : lisible sur le dégradé sombre de l'overlay (le noir demandé disparaît sur les photos foncées) */
  color: #fff;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.category-banner__subcats a:hover,
.category-banner__subcats a:focus {
  background: #fff;
  color: #111;
  text-decoration: none;
}

.category-description-block {
  margin-top: 2rem;
}

@media (max-width: 767.98px) {
  /* Le thème ajoute --mb-page-gap (16px) sous le header fixe : inutile avec la bannière,
     l'image vient s'appuyer directement sur la ligne du header. */
  html body.page-category:not(.is-header-scrolled) > main {
    padding-top: calc(var(--mb-header-bandeau) + var(--mb-header-masthead)) !important;
  }

  html body.page-category.is-header-scrolled:not(.page-index) > main {
    padding-top: var(--mb-header-masthead) !important;
  }

  /* Pleine largeur, collée au header : on annule le padding de la colonne (15px) */
  .category-banner {
    height: 160px !important;
    width: auto !important;
    margin: 0 -15px 1rem !important;
  }

  .category-banner__breadcrumb {
    display: none;
  }

  .category-banner__title {
    font-size: 1.2rem;
    letter-spacing: 0.14em;
  }

  .category-banner__overlay {
    padding: 0.75rem 1rem !important;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.2) 60%, rgba(0, 0, 0, 0) 100%) !important;
  }

  /* Avec des sous-catégories, la bannière s'adapte à son contenu : l'overlay passe dans le flux
     (min. 160px) et l'image reste en fond, en cover. Toutes les étiquettes sont visibles, sur plusieurs lignes. */
  .category-banner.has-subcats {
    height: auto !important;
    min-height: 160px;
  }

  .category-banner.has-subcats picture,
  .category-banner.has-subcats .category-banner__image {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
  }

  .category-banner.has-subcats .category-banner__overlay {
    position: relative !important;
    min-height: 160px;
    padding: 1.1rem 1rem 1rem !important;
  }

  .category-banner__subcats {
    flex-wrap: wrap;
    gap: 0.35rem 0.4rem;
    margin: 0.6rem 0 0;
  }

  .category-banner__subcats a {
    height: 26px;
    padding: 0 0.7rem;
    font-size: 0.58rem;
  }
}
