/* FH - Slider produits. Feuille uniquement chargee par index_dev_products.php.
   Reutilise les controles et le fondu de news-home.css / news-home.js. */
.fh-products-section.fh-news-section {
  padding-top: 22px;
  background: #fff;
}
.fh-products-section .fh-news-heading h2 {
  color: #173544;
}
.fh-products-section .fh-products-primary {
  background: #1f2b34;
  color: #fff;
}
.fh-products-section .fh-products-primary-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}
.fh-products-section .fh-products-primary-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 35px 30px 32px 36px;
  gap: 8px;
  background: linear-gradient(125deg, #243847, #182833);
}
.fh-products-section .fh-products-overline {
  color: #9ed2e9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}
.fh-products-section .fh-products-brand {
  color: #fff;
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 750;
  line-height: 1.16;
  margin: 10px 0 0;
  overflow-wrap: anywhere;
}
.fh-products-section .fh-products-model {
  color: #fff;
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 7px;
  overflow-wrap: anywhere;
}
.fh-products-section .fh-products-description {
  font-size: 16px;
  line-height: 1.55;
  color: #dce9ef;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  padding-right: 6px;
}
.fh-products-section .fh-products-description p { margin: 0 0 12px; }
.fh-products-section .fh-products-description p:last-child { margin-bottom: 0; }
.fh-products-section .fh-products-description a { text-decoration: underline; text-underline-offset: 2px; }
.fh-products-section .fh-products-primary-visual {
  min-width: 0;
  min-height: 0;
  /* Fond studio chaud, centre lumineux agrandi : image WebP transparente. */
  background: radial-gradient(ellipse 92% 86% at 53% 48%,
    #eeebe3 0%,
    #e9e5dc 42%,
    #d5cebd 78%,
    #c7bfab 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.fh-products-section .fh-products-primary-visual img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center;
}
.fh-products-section .fh-products-small {
  /* Meme fond studio beige que la grande photo. */
  background: radial-gradient(ellipse 92% 86% at 53% 48%,
    #eeebe3 0%,
    #e9e5dc 42%,
    #d5cebd 78%,
    #c7bfab 100%);
}
.fh-products-section .fh-products-small .fh-news-photo {
  /* Grand visuel secondaire, centre et sans deformation. */
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: scale(1.5);
  transform-origin: center center;
}
.fh-products-section .fh-products-small:hover .fh-news-photo {
  /* Conserver le meme zoom lors du survol (news-home.css a son propre hover). */
  transform: scale(1.5);
}
.fh-products-section .fh-products-small .fh-news-gradient {
  /* Voile anthracite neutre seulement en bas, pour les textes blancs. */
  background: linear-gradient(0deg,
    rgba(24, 25, 24, .91) 0%,
    rgba(27, 28, 27, .75) 24%,
    rgba(29, 30, 29, .32) 49%,
    rgba(29, 30, 29, 0) 70%);
}
.fh-products-section .fh-products-small .fh-news-tile-title {
  font-size: clamp(16px, 1.75vw, 23px);
}
.fh-products-section .fh-news-tile-content { pointer-events: none; }
/* Desktop compact : les textes restent lisibles et la montre reste entiere. */
@media (max-width: 1100px) {
  .fh-products-section .fh-products-primary-copy { padding: 26px 23px; }
  .fh-products-section .fh-products-description { font-size: 14px; }
}

/* Tablettes : pleine largeur pour la fiche principale, deux cartes en dessous. */
@media (max-width: 900px) {
  .fh-products-section .fh-products-layout {
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
    gap: 14px;
  }
  .fh-products-section .fh-products-primary {
    grid-row: auto;
    grid-column: 1 / -1;
    height: 430px;
    min-height: 0;
  }
  .fh-products-section .fh-products-primary-inner {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  }
  .fh-products-section .fh-products-description { font-size: 14px; }
  .fh-products-section .fh-products-small { min-height: 210px; }
}

/* Smartphones : image au-dessus, texte pleine largeur en dessous. */
@media (max-width: 620px) {
  .fh-products-section.fh-news-section { padding-top: 14px; }
  .fh-products-section .fh-products-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 11px;
  }
  .fh-products-section .fh-products-primary {
    grid-column: auto;
    height: auto;
    min-height: 0;
  }
  .fh-products-section .fh-products-primary-inner {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
  }
  .fh-products-section .fh-products-primary-visual {
    order: -1;
    flex: none;
    height: clamp(260px, 83vw, 390px);
  }
  .fh-products-section .fh-products-primary-visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Montre plus grande sur mobile sans etirer la photo. */
    transform: scale(1.20);
    transform-origin: center;
  }
  .fh-products-section .fh-products-primary-copy {
    flex: none;
    padding: 24px 22px 28px;
    gap: 9px;
  }
  .fh-products-section .fh-products-brand { font-size: 25px; }
  .fh-products-section .fh-products-model { font-size: 18px; }
  .fh-products-section .fh-products-description {
    font-size: 13px;
    line-height: 1.6;
    overflow: visible;
    padding-right: 0;
  }
  .fh-products-section .fh-products-small { min-height: 170px; }
}

@media (max-width: 380px) {
  .fh-products-section .fh-products-primary-copy { padding: 21px 18px 25px; }
  .fh-products-section .fh-products-primary-visual { height: 270px; }
  .fh-products-section .fh-products-brand { font-size: 23px; }
  .fh-products-section .fh-products-model { font-size: 17px; }
}


/* V4 -- Selecteur Actualites / Produits, exclusivement sur la page de test. */
#fh-home-news-view[hidden],
#fh-home-products-view[hidden] { display: none !important; }

.fh-home-heading-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}
.fh-home-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  background: #edf4f7;
  border: 1px solid #d6e5eb;
  border-radius: 7px;
}
.fh-home-switch-button {
  appearance: none;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #31566a;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}
.fh-home-switch-button[aria-pressed="true"] {
  background: #007fbd;
  color: #fff;
  box-shadow: 0 1px 4px rgba(10, 51, 76, .12);
}
.fh-home-switch-button:hover:not([aria-pressed="true"]) {
  background: #dcebf2;
  color: #124059;
}
.fh-home-switch-button:focus-visible {
  outline: 3px solid #eca623;
  outline-offset: 2px;
}

/* Le slider produits remplace celui des news : meme espace au-dessus. */
.fh-products-section.fh-news-section { padding-top: 55px; }

@media (max-width: 850px) {
  .fh-news-heading { flex-wrap: wrap; }
  .fh-home-heading-actions { align-items: flex-start; width: 100%; }
}
@media (max-width: 620px) {
  .fh-products-section.fh-news-section { padding-top: 38px; }
  .fh-home-switch { width: 100%; }
  .fh-home-switch-button {
    flex: 1;
    min-width: 0;
    padding: 11px 8px;
    font-size: 12px;
    white-space: normal;
    text-align: center;
  }
  .fh-home-heading-actions { gap: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .fh-home-switch-button { transition: none; }
}

/* Fond choisi dans le Panel FH, applique a chaque produit sans JS.
   Les attributs data-background sont propres a chaque carte (grand et petits produits). */
.fh-products-section .fh-products-primary-visual[data-background="beige"],
.fh-products-section .fh-products-small[data-background="beige"] {
  background: radial-gradient(ellipse 92% 86% at 53% 48%, #eeebe3 0%, #e9e5dc 42%, #d5cebd 78%, #c7bfab 100%);
}
.fh-products-section .fh-products-primary-visual[data-background="white"],
.fh-products-section .fh-products-small[data-background="white"] {
  background: radial-gradient(ellipse at 50% 48%, #fff 0%, #eff0ed 65%, #d9dcda 100%);
}
.fh-products-section .fh-products-primary-visual[data-background="silver"],
.fh-products-section .fh-products-small[data-background="silver"] {
  background: radial-gradient(ellipse at 50% 48%, #f0f2f3 0%, #c9cfd3 65%, #9ba5ac 100%);
}
.fh-products-section .fh-products-primary-visual[data-background="champagne"],
.fh-products-section .fh-products-small[data-background="champagne"] {
  background: radial-gradient(ellipse at 50% 48%, #fff3df 0%, #e7d3ab 65%, #bfa075 100%);
}
.fh-products-section .fh-products-primary-visual[data-background="blue"],
.fh-products-section .fh-products-small[data-background="blue"] {
  background: radial-gradient(ellipse at 50% 48%, #9ebfd1 0%, #4c809d 65%, #193d55 100%);
}
.fh-products-section .fh-products-primary-visual[data-background="dark"],
.fh-products-section .fh-products-small[data-background="dark"] {
  background: radial-gradient(ellipse at 50% 48%, #78838a 0%, #33434c 65%, #15222a 100%);
}
