/*
 * JDC — cascade terminale des composants publics
 *
 * Cette feuille est chargée après les feuilles WooCommerce et les extensions.
 * Elle n'utilise volontairement aucune priorité forcée : la priorité vient de
 * l'ordre de chargement, de sélecteurs limités au composant et de contrats
 * de classes lisibles.
 *
 * Identifiants de repérage :
 *   JDC-FILTER       filtres Boutique et état sticky
 *   JDC-HEADER       en-têtes sticky et médaillons de logo
 *   JDC-PRODUCT-CARD cartes produit et description de variété
 *   JDC-ACCOUNT      grille du compte client
 *   JDC-NEWSLETTER   ruban newsletter et lien compte
 *   JDC-MOTION       apparitions et transitions publiques
 */

/* [JDC-FILTER] Le filtre sticky devient une surface blanche lisible au scroll. */
body.woocommerce-shop .jdc-filter-sticky-panel.is-sticky-filters,
body.archive .jdc-filter-sticky-panel.is-sticky-filters {
  background: #FFFFFF;
  box-shadow: 0 9px 22px rgba(46, 59, 38, .12);
}

/* [JDC-FILTER] Exotique garde son gabarit compact, avec son contour propre. */
body .jdc-filter-sticky-panel .jdc-exotique-filter {
  box-sizing: border-box;
  padding: 4px 6px;
}
body .jdc-filter-sticky-panel .jdc-exotique-filter .wc-block-product-filter-chips__item {
  gap: 9px;
  min-width: 124px;
  min-height: 36px;
  height: 36px;
  padding: 4px 11px;
  border: 1px solid color-mix(in srgb, #F27C22 52%, #FFFDF4);
  border-radius: 3px;
}

/* [JDC-HEADER] Le contenu Boutique colle sous le bandeau de navigation. */
body.archive .jdc-site-header,
body.archive .jdc-shop-hero,
body.woocommerce-shop .jdc-site-header,
body.woocommerce-shop .jdc-shop-hero {
  margin-top: 0;
  margin-bottom: 0;
}
@media (min-width: 981px) {
  body.archive .jdc-site-cart,
  body.woocommerce-shop .jdc-site-cart,
  body.home .jdc-site-cart {
    margin-left: 8px;
  }
}

/* [JDC-HEADER] Médaillon global : le logo reste centré sur toutes les pages. */
@media (min-width: 981px) {
  body .jdc-site-header.is-scrolled .jdc-site-header-hero {
    left: 50%;
    top: 50%;
    width: 132px;
    height: 108px;
    min-height: 108px;
    padding: 0;
    display: grid;
    place-items: center;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 0 0 7px #FFFFFF, 0 8px 22px rgba(46, 59, 38, .12);
    transform: translate(-50%, -50%) scale(1.08);
  }
  body .jdc-site-header.is-scrolled .jdc-site-header-hero__logo,
  body .jdc-site-header.is-scrolled .jdc-site-header-hero__logo img {
    width: 118px;
    height: 100px;
    max-width: none;
    max-height: none;
    object-fit: contain;
  }
}

/* [JDC-HEADER] Le nom reste aligné sur le conteneur pendant le scroll. */
body:not(.home) .jdc-site-header.is-scrolled .jdc-site-header-main::before {
  content: "Les Jardins de Courances";
  position: absolute;
  left: max(24px, calc((100% - 1180px) / 2));
  top: 50%;
  transform: translateY(-50%);
  color: #2E3B26;
  font: 600 .82rem/1.1 "DM Sans", sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* [JDC-HEADER] Accueil : nom aligné sur le conteneur, logo centré sans biais. */
body.home .jdc-site-header.is-hero-logo-gone .jdc-site-header-main::before {
  content: "Les Jardins de Courances";
  position: absolute;
  left: max(24px, calc((100% - 1180px) / 2));
  top: 50%;
  transform: translateY(-50%);
  color: #2E3B26;
  font: 600 .82rem/1.1 "DM Sans", sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}
@media (min-width: 981px) {
  body.home .jdc-site-header.is-hero-logo-gone .jdc-site-header-hero {
    left: 50%;
    top: 50%;
    z-index: 5;
    width: 132px;
    height: 108px;
    min-height: 108px;
    display: grid;
    place-items: center;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 0 0 7px #FFFFFF, 0 8px 22px rgba(46, 59, 38, .12);
  }
  body.home .jdc-site-header.is-hero-logo-gone .jdc-site-header-hero__logo,
  body.home .jdc-site-header.is-hero-logo-gone .jdc-site-header-hero__logo img {
    width: 118px;
    height: 100px;
    max-width: none;
    max-height: none;
    object-fit: contain;
  }
}

/* [JDC-PRODUCT-CARD] La description émerge depuis l'image, jamais hors carte. */
body.home .wp-site-blocks .jdc-home-products li.wc-block-product {
  overflow: hidden;
}
body.home .wp-site-blocks .jdc-home-products .jdc-shop-card-visual {
  position: relative;
  overflow: hidden;
  border-radius: 0;
}
body.home .wp-site-blocks .jdc-home-products .jdc-shop-card-overlay {
  top: 0;
  right: 0;
  bottom: auto;
  left: 0;
  width: auto;
  height: auto;
  aspect-ratio: 1 / 1;
  transform: scale(.96);
  transform-origin: center center;
  border-radius: 0;
  background: rgba(255, 253, 244, .88);
  transition: opacity .3s ease, transform .38s cubic-bezier(.22, .8, .26, 1);
}
body.home .wp-site-blocks .jdc-home-products li.wc-block-product:hover .jdc-shop-card-overlay,
body.home .wp-site-blocks .jdc-home-products li.wc-block-product:focus-within .jdc-shop-card-overlay {
  opacity: 1;
  transform: scale(1);
}

/* [JDC-PRODUCT-CARD] La variété des paniers reste une ligne légère. */
.jdc-postit-row {
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--jdc-group, #8FA277) 30%, transparent);
  border-radius: 0;
  background: transparent;
}
.jdc-postit-row-desc {
  top: auto;
  bottom: 0;
  height: auto;
  max-height: 30px;
  min-height: 0;
  padding: 5px 8px;
  border-top: 1px solid color-mix(in srgb, var(--jdc-group, #8FA277) 45%, transparent);
  background: color-mix(in srgb, var(--jdc-group-pastel, #CBD9AE) 88%, transparent);
  transform: translateY(100%);
}
.jdc-postit-row:hover .jdc-postit-row-desc,
.jdc-postit-row:focus-within .jdc-postit-row-desc {
  transform: translateY(0);
}

/* [JDC-HOME] Les cinq cartes statiques sont retirées du rendu d'accueil. */
body.home .jdc-home-static-products {
  display: none;
}

/* [JDC-HOME-PICKUP] Section crème, ombre basse et respiration finale. */
body.home .jdc-home-pickup-section {
  background: #FAF6EC;
  box-shadow: 0 12px 24px rgba(46, 59, 38, .12);
  padding-bottom: calc(var(--wp--preset--spacing--20) + 30px);
}

/* [JDC-HERO] Le texte clair reste lisible sur la photographie du hero. */
body.home .jdc-home-hero {
  padding-bottom: calc(var(--wp--preset--spacing--40) + 30px);
}
body.home .jdc-home-hero p.has-ink-color,
body.home .jdc-home-hero p.has-text-color {
  color: #FFFDF4;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .3);
}

/* [JDC-ACCOUNT] Le compte garde sa navigation et son contenu en deux colonnes. */
body.woocommerce-account .wp-site-blocks .jdc-page-content > .wp-block-post-content {
  display: block;
}
body.woocommerce-account .wp-site-blocks .jdc-page-content > .wp-block-post-content > * {
  grid-column: auto;
}
body.woocommerce-account .wp-site-blocks .jdc-page-content > .wp-block-post-content > .wp-block-spacer {
  display: block;
}

/* [JDC-NEWSLETTER] Les états visiteur et membre reprennent le même modèle. */
body.home .wp-site-blocks .jdc-newsletter-wrap,
body.home .wp-site-blocks section.jdc-newsletter {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.home .wp-site-blocks .jdc-newsletter-bar.is-member {
  min-height: 52px;
  box-sizing: border-box;
  padding: 13px 18px 13px 66px;
  border: 1px solid rgba(46, 59, 38, .1);
  border-radius: 9px;
  background: #FFFDF4;
  box-shadow: 0 8px 20px rgba(46, 59, 38, .1);
  color: #2E3B26;
}
body.home .wp-site-blocks .jdc-newsletter-bar[data-jdc-newsletter-state="visitor"] {
  min-height: 52px;
  box-sizing: border-box;
  padding: 13px 18px;
  border: 1px solid rgba(46, 59, 38, .1);
  border-radius: 9px;
  background: #FFFDF4;
  box-shadow: 0 8px 20px rgba(46, 59, 38, .1);
  color: #2E3B26;
}
.jdc-newsletter-bar .jdc-newsletter-link {
  border: 0;
  outline: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* [JDC-SHOP] L'introduction du panier ne porte pas de panneau crème. */
body.woocommerce-shop .jdc-shop-panier-intro,
body.archive .jdc-shop-panier-intro {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* [JDC-FILTER] Surface lisible dans les deux états, sans transparence. */
body.woocommerce-shop .jdc-filter-sticky-panel,
body.archive .jdc-filter-sticky-panel {
  background: #FFFDF4;
}
body.woocommerce-shop .jdc-filter-sticky-panel.is-sticky-filters,
body.archive .jdc-filter-sticky-panel.is-sticky-filters {
  background: #FFFFFF;
  opacity: 1;
  box-shadow: 0 9px 22px rgba(46, 59, 38, .12);
}

/* [JDC-FILTER] Le curseur machine reste présent, mais la pagination ne se voit plus. */
body.woocommerce-shop nav.jdc-shop-pagination.is-infinite-scroll,
body.archive nav.jdc-shop-pagination.is-infinite-scroll {
  display: none;
}

/* [JDC-PAGE] Les parcours panier et points de vente partagent le même axe. */
body.page .jdc-page-content > .wp-block-post-content {
  box-sizing: border-box;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

/* [JDC-PAGE] Les surfaces WooCommerce ne recréent pas un décalage latéral. */
body.woocommerce-cart .wc-block-cart,
body.woocommerce-cart .wc-block-components-sidebar-layout {
  box-sizing: border-box;
  width: 100%;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

/* [JDC-MOTION] Coins et animations des éléments explicitement annotés. */
body.home .jdc-home-hero,
body.home .jdc-home-hero::before,
body.home .jdc-home-editorial,
body.home .jdc-home-editorial::before,
body.home .jdc-home-hero figure,
body.home .jdc-home-hero img,
body.home .jdc-home-editorial figure,
body.home .jdc-home-editorial img {
  border-radius: 0;
}
@keyframes jdc-home-logo-entrance-clean {
  0% { opacity: 0; transform: scale(.94) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
body.home .jdc-home-hero__logo {
  width: min(100%, 260px);
  height: 260px;
}
body.home .jdc-home-hero__logo img {
  transform-origin: left center;
  animation: jdc-home-logo-entrance-clean .8s cubic-bezier(.22, .8, .26, 1) both;
  transition: opacity .35s ease, transform .45s cubic-bezier(.22, .8, .26, 1);
}
@keyframes jdc-actu-widget-entrance-clean {
  0% { opacity: 0; transform: translateY(18px); }
  100% { opacity: 1; transform: translateY(0); }
}
.jdc-actu-widget {
  animation: jdc-actu-widget-entrance-clean .65s cubic-bezier(.22, .8, .26, 1) both;
}
.jdc-actu-widget-panel,
.jdc-actu-widget-photo,
.jdc-actu-widget-caption {
  transition: opacity .3s ease, transform .38s cubic-bezier(.22, .8, .26, 1);
}
@media (prefers-reduced-motion: reduce) {
  body.home .jdc-home-hero__logo img,
  .jdc-actu-widget {
    animation: none;
    transition: none;
  }
}
