/* ==========================================================================
   HOTFIX MOBILE + BIJOUX — 2026-07-07
   1. Barre de recherche sticky mobile (CSS manquant depuis archivage 02/2026)
   2. Trust bar : rotation d'un message à la fois sur mobile
   3. Rangée header mobile : burger | logo | compte/panier/langue compacts
   4. Grille catégorie : 2 produits par ligne sur mobile
   5. Bouton "Ajouter au panier" sticky sur fiche produit mobile
   6. Section Bijoux home + badges fiche produit + FAQ bijoux
   ========================================================================== */

/* --- 1. Sticky search mobile : cachée par défaut, glisse au scroll-up --- */
.mobile-sticky-search {
  position: fixed !important;
  top: 0; left: 0; right: 0;
  z-index: 9998;
  background: #fff;
  padding: 8px 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  transform: translateY(-110%);
  transition: transform .28s ease;
}
.mobile-sticky-search.visible { transform: translateY(0); }
.mobile-sticky-search .search-input-wrapper { position: relative; display: block; }
.mobile-sticky-search input {
  width: 100%; height: 44px;
  border: 1px solid #d0c8c0; border-radius: 22px;
  padding: 0 54px 0 16px; font-size: 16px; background: #fff;
}
.mobile-sticky-search .search-btn {
  position: absolute; right: 3px; top: 50%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  border: none; border-radius: 50%;
  background: #8b7355; color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

@media (max-width: 767.98px) {

  /* --- 2. Trust bar : un message à la fois, rotation douce --- */
  .trust-bar { overflow: hidden; }
  .trust-bar-content {
    display: block !important;
    position: relative;
    height: 22px;
    padding: 0 8px !important;
    overflow: hidden !important; /* axe: scrollable-region-focusable */
  }
  .trust-bar-item {
    position: absolute !important;
    inset: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: hrTrustRotate 16s linear infinite;
  }
  .trust-bar-item:nth-child(2) { animation-delay: 4s; }
  .trust-bar-item:nth-child(3) { animation-delay: 8s; }
  .trust-bar-item:nth-child(4) { animation-delay: 12s; }

  /* --- 3. Header : la rangée = .stitch-actions pleine largeur
         (burger à gauche via order:-1, compte/panier à droite),
         logo centré en absolu par-dessus --- */
  /* .header-main est en display:flex → son .container rétrécit à son contenu ;
     on force le container à occuper toute la largeur */
  .site-header .header-main .container {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }
  .site-header .stitch-header {
    display: flex !important;
    flex-direction: row !important; /* header-overlap-fix.css force column sur mobile */
    width: 100% !important;
    position: relative !important;
    min-height: 52px;
    padding: 4px 0 !important;
  }
  .site-header .stitch-actions {
    position: static !important;
    top: auto !important;
    right: auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: none !important;
    gap: 6px !important;
    margin: 0 !important;
  }
  .stitch-actions .search-section { display: none !important; }
  /* Positionnement absolu : immunisé contre les flex/grid des CSS legacy */
  .site-header .mobile-menu-toggle {
    order: -1 !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    position: absolute !important;
    left: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 2;
  }
  /* Logo centré indépendamment des largeurs voisines */
  .site-header .stitch-brand {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    text-align: center !important;
    max-width: 52vw;
    overflow: hidden;
    z-index: 1;
  }
  .site-header .stitch-brand .brand-name { font-size: 19px !important; white-space: nowrap; }
  .site-header .stitch-actions .user-section {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    z-index: 2;
  }
  .user-section .user-actions { display: flex !important; gap: 0 !important; }
  /* Sélecteur de langue : masqué sur mobile (fr par défaut, es/de via footer) *
   * et libellés "Panier"/"Connexion" masqués, icônes conservées */
  #_desktop_language_selector { display: none !important; }
  .user-actions .cart-label, .user-actions .user-link-text, .user-actions .hidden-sm-down { display: none !important; }

  /* --- 4. Catégorie : 2 produits par ligne (même sélecteur que fixes/category.css
         qui force 1fr sous 480px, chargé après pour primer) --- */
  #js-product-list .products.row,
  #js-product-list .products,
  #products .products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  #js-product-list .products > *,
  #products .products > * {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #js-product-list .product-miniature .product-description,
  #products .product-miniature .product-description { padding: 8px !important; }
  #js-product-list .product-miniature .product-title a,
  #products .product-miniature .product-title a {
    font-size: 0.85rem !important;
    line-height: 1.25 !important;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* Le résumé descriptif prend trop de place en 2 colonnes */
  #js-product-list .product-miniature .product-description-short,
  #products .product-miniature .product-description-short { display: none !important; }

  /* --- 5. Sticky add-to-cart fiche produit --- */
  .hr-sticky-atc {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9500;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border-top: 1px solid #e5dccf;
    box-shadow: 0 -4px 16px rgba(0,0,0,.12);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    transform: translateY(110%);
    visibility: hidden; /* hors tabulation quand caché (WCAG 2.4.7) */
    pointer-events: none;
    transition: transform .25s ease, visibility .25s;
  }
  .hr-sticky-atc.is-shown { transform: translateY(0); visibility: visible; pointer-events: auto; }
  .hr-sticky-atc__info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
  .hr-sticky-atc__name { font-size: .8rem; color: #3a3028; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hr-sticky-atc__price { font-weight: 700; color: #3a3028; font-size: 1rem; }
  .hr-sticky-atc__btn {
    flex: 0 0 auto;
    background: #8b6a00; color: #fff;
    border: none; border-radius: 8px;
    padding: 12px 18px;
    font-weight: 600; font-size: .9rem;
    cursor: pointer;
  }
  /* La newsletter sticky ne doit pas chevaucher le sticky ATC */
  body#product #nl-sticky { display: none !important; }
}

@keyframes hrTrustRotate {
  0% { opacity: 0; transform: translateY(8px); }
  2%, 23% { opacity: 1; transform: translateY(0); }
  25%, 100% { opacity: 0; transform: translateY(-8px); }
}

@media (min-width: 768px) {
  .hr-sticky-atc { display: none !important; }
}

@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
  .trust-bar-item { animation: none !important; opacity: 1 !important; position: static !important; }
  .trust-bar-content { height: auto !important; }
  .trust-bar-item:not(:first-child) { display: none !important; }
}

/* --- 6a. Section Bijoux home --- */
.section--bijoux { background: #faf7f2; }
.bijoux-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 24px 0;
}
.bijou-card {
  display: block;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.bijou-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.bijou-card img { width: 100%; height: auto; aspect-ratio: 1/1; object-fit: cover; display: block; }
.bijou-card__name {
  display: block;
  padding: 12px;
  text-align: center;
  color: #3a3028;
  font-size: .92rem;
  font-weight: 600;
}
.bijoux-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 767.98px) {
  .bijoux-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* --- Badges paiement (tous produits) : bandeau centré sous le bloc produit
       (le JS du thème ré-agence la colonne en grid, on assume le full-width) --- */
.hr-payment-badges {
  margin: 10px 0 4px;
  color: #6d6155;
  font-size: .82rem;
  text-align: center;
  width: 100%;
  grid-column: 1 / -1;
  padding: 8px 12px;
  background: #faf7f2;
  border-radius: 6px;
}

/* --- 6b. Badges + disclaimer fiche bijou --- */
.bijou-extra-info { margin: 10px 0 4px; }
.bijou-badges { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 6px; }
.bijou-badge { color: #2e7d32; font-size: .85rem; font-weight: 600; }
.bijou-size-link { margin: 0 0 4px; font-size: .88rem; }
.bijou-size-link a { color: #8b7355; text-decoration: underline; }
.bijou-disclaimer { margin: 0; color: #8a8177; font-size: .78rem; }

/* --- 6c. FAQ bijoux --- */
.bijou-faq { margin: 24px auto; }
.bijou-faq details {
  background: #fff;
  border: 1px solid #ece4d8;
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 0;
}
.bijou-faq summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  color: #3a3028;
  list-style-position: inside;
}
.bijou-faq details p { padding: 0 16px 12px; margin: 0; color: #55493c; }

/* --- Contrastes WCAG AA (axe-core, 2026-07-07) --- */
/* liens de facettes et services cards : brun 4.23:1 → brun foncé 5.4:1 */
#search_filters .search-link.js-search-link,
#search_filters .facet-label a,
.search-link.js-search-link,
.product-card-service { color: #755f41 !important; }
/* liens dans les descriptions produit : soulignés (WCAG link-in-text-block) */
.product-description a,
#description a,
.post-content a, .blog-post a, .ever_blog_post a { text-decoration: underline !important; }
/* compteurs de facettes "(10)" : 2.15:1 → 4.6:1 */
.magnitude { color: #6e685f !important; }
/* bénéfice card "Retrait boutique…" : 3.37:1 → 4.6:1 */
.product-card-benefit { color: #6e685f !important; }
/* pastille compteur panier : 4.48:1 → 5.4:1 */
.cart-products-count,
.blockcart .cart-products-count { background-color: #755f41 !important; }
/* gris texte secondaire du thème : 4.29:1 → 4.7:1 */
:root { --color-text-secondary: #6f6f6f !important; }
.seo-toggle-hint { color: #6f6f6f !important; }
/* mention stock orange : 4.3:1 → 5.0:1 */
#product-availability,
.product-availability { color: #a8472c !important; }
/* liens bruns inline (fiche produit, guides) */
.bijou-size-link a,
.product-information a:not(.btn):not(.nav-link) { color: #755f41 !important; }

/* --- 7. Fiche produit desktop : réduction des blancs --- */
@media (min-width: 768px) {
  .product-info-column .product-actions { margin-top: 0 !important; }
  .product-info-column .product-prices { margin-bottom: 8px !important; }
  .product-info-column .product-add-to-cart { margin: 8px 0 !important; }
}
