/* accessibilite-0710 07/10 (EX-065): contrast of small text and visible focus, nothing else changes.
   Measured with axe-core 4.11 (scripts/accessibilite-0710/axe.mjs). Ratios on the page backgrounds
   #efeeea, #e4e2dc, #e6e5e8, #fafaf8 (before -> after): */

/* Grey text 4.19 -> 4.95 minimum, bronze text 3.95 -> 4.92 minimum, green 4.14 -> 4.67 minimum. Same hues, a little darker. */
html:root { --feutre: #5c5f64; --bleu: #7a5a0a; --vert-ok: #4d6a48; --ms-feutre: #5c5f64; --ms-bronze: #7a5a0a; }
html body .fiche.ft, html body .im, html body .ia { --bronze: #7a5a0a; }

/* Price reading date: inherits its line's colour at 72 % opacity (2.6 to 2.98): full colour now. */
html body .d07-releve { opacity: 1; }

/* Footer price note on anthracite 3.82 -> 5.88. Footer « en savoir plus » link told apart without colour. */
html body .pied__prix { color: rgba(239, 238, 234, 0.62); }
html body .pied__mentions p a { text-decoration: underline; text-underline-offset: 2px; }

/* Focus: the mustard ring (1.9:1 on the page) gets a dark ring between it and the element (12.9:1), keyboard focus only. */
html body :focus-visible, html body .quiz__reponse input:focus-visible + span, html body .calc__mode input:focus-visible + span { box-shadow: 0 0 0 2px #25272b !important; }
html body .bouton-recherche:focus-visible, html body .entete-projet:focus-visible { outline: 3px solid var(--moutarde, #d6a62b); outline-offset: 2px; }
html body .projet__saisie input:focus-visible, html body .pcote__cote input:focus-visible, html body .dz-outil__champ input:focus-visible { outline: 3px solid var(--moutarde, #d6a62b); outline-offset: 2px; }

/* Desktop menu closed with Escape while it holds the focus (assets/js/accessibilite-0710.js), until focus leaves it. */
html body .nav-groupe.ac07-ferme:not(.est-ouvert) > .nav-groupe__liste { opacity: 0; visibility: hidden; }

/* Text for screen readers only (merchant name after « Voir », same rule as .visuellement-cache). */
.ac07-chez { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; }

/* A focused element is never left under the sticky header nor, on phones, under the fixed bottom bars (merchant bar,
   « On préfère », comparator). Zero specificity: every existing scroll-margin (anchors) still wins. */
:where(a[href], button, input, select, textarea, summary, [tabindex]) { scroll-margin-top: calc(var(--haut-entete, 72px) + 12px); }
@media (max-width: 900px) {
  :where(a[href], button, input, select, textarea, summary, [tabindex]) { scroll-margin-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
}

/* Responsive 28/10, round 2 (phone and tablet only, the desktop layout is untouched).
   1) The sticky bottom bar (.actions-mobile, ≤ 900 px) already holds « Questionnaire » and « Filtres »: the same two
      buttons at the top of the list are hidden, on sofa and mattress collections alike (they showed twice at 768 px).
   2) Every tap target at least 44 px (!important: the component rules set smaller min sizes with more specific selectors): real size when the box can grow, else an invisible hit area (::after) around
      inline links, kept inside the gap to the next target. */
@media (max-width: 900px) {
  body:has(.actions-mobile__filtres) .catalogue__outils :is([data-ouvrir-filtres], .bouton--guide) { display: none !important; }

  :is(.variantes__choix, .lit-variantes button, .mx07-puce, .comparateur__mode button, .vue-cartes button, .dk-place, .tf__actions .bouton, .fiche-outils .outil, .essentiel__top, .consentement__perso) { min-height: 44px !important; }
  body .fiche.ft1a2 .fiche-outils > :is(.outil, .voir-chez-moi), :is(.essentiel__top > summary, .comparateur__plus summary, .filtre__aide summary, .pilier-verdict__nom, .filtres__effacer, .filtre__plus, .service-plie > summary, .pied__cookies, .tf__format .bouton) { min-height: 44px !important; }
  :is(.variantes__choix, .comparateur__mode button) { min-width: 44px !important; }
  :is(.bouton-menu, .entete-projet, .entete-selection) { min-width: 44px !important; }
  :is(.coeur, .galerie__fleche, .partage__lien) { min-width: 44px !important; min-height: 44px !important; }

  :is(.ft-suite, .chapeau__suite, .pilier-verdict__liens a, .rubrique a, .marque-site, .consentement__lien, .achat__methodo, .ifg__actions a, .mx07-suite li a, .notes li a, .carte__pastille-couleur, .coloris__pastille) { position: relative; }
  :is(.ft-suite, .chapeau__suite, .pilier-verdict__liens a, .rubrique a, .marque-site, .consentement__lien, .achat__methodo, .carte__comparer)::after { content: ""; position: absolute; inset: -13px -4px; }
  .ifg__actions a::after { content: ""; position: absolute; inset: -9px 0; }
  .mx07-suite li a::after { content: ""; position: absolute; inset: -5px 0; }
  .notes li a::after { content: ""; position: absolute; inset: -8px 0; }
  /* not while hovered or focused: the colour name tooltip (main.css) uses the same ::after */
  .carte__pastille-couleur:not(:hover, :focus-visible)::after { content: ""; position: absolute; inset: -13px -3px; }
  .coloris__pastille:not(:hover, :focus-visible)::after { content: ""; position: absolute; inset: -3.6px; }
}

/* ---------- barre-achat-0411 (04/11, Romain's phone screenshot): fiche sticky purchase bar, every univers.
   Between 401 and 700 px (iPhone 16/17 at 402, Plus/Pro Max at 430) the long label « Voir le prix chez Camif » and the
   price kept their full width (.barre-achat__achat flex: none, label nowrap), so the name column fell to 0 px and its
   text ran under the button. Now: the name column keeps at least 5.5 rem and clips (one line + ellipsis, score below),
   the button shrinks (« Voir le prix » on line 1, « chez {marchand} » on line 2, ellipsis), the price and the little
   photo step aside on phones, the heart stays. Loaded last on every fiche, so cached pages get it without a purge. ---------- */
@media (max-width: 1023px) {
  .barre-achat .barre-achat__contenu { display: flex; flex-wrap: nowrap; align-items: center; }
  .barre-achat .barre-achat__produit { flex: 1 1 0; min-width: 5.5rem; overflow: hidden; }
  .barre-achat .barre-achat__texte { flex: 1 1 auto; min-width: 0; overflow: hidden; }
  html body .barre-achat .barre-achat__nom { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; -webkit-line-clamp: none; }
  .barre-achat .barre-achat__meta { white-space: nowrap; overflow: hidden; }
  .barre-achat .barre-achat__achat { flex: 0 1 auto; min-width: 0; }
  .barre-achat .barre-achat__achat > a, .barre-achat .barre-achat__achat > span:not(.barre-achat__coeur):not(.barre-achat__prix-bloc) { flex: 0 1 auto; min-width: 0; max-width: 100%; }
  .barre-achat .barre-achat__achat .cta-duo { display: flex; gap: 0.4rem; min-width: 0; }
  .barre-achat .barre-achat__achat .cta-duo > a { flex: 0 1 auto; min-width: 0; }
  .barre-achat .barre-achat__coeur, .barre-achat .barre-achat__prix-bloc, .barre-achat .cta__fleche { flex: none; }
  html body .barre-achat .barre-achat__achat .bouton .cta__texte { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}
@media (max-width: 700px) {
  html body .barre-achat .barre-achat__achat .bouton .cta__texte { display: block; font-size: 0.92rem; line-height: 1.15; padding-block: 0.3rem; }
  html body.mba .barre-achat .dbt-m .cta__texte { font-size: 0.92rem; padding-right: 0.85rem; text-overflow: ellipsis; }
  html body.mba .barre-achat .dbt-m .cta__texte::before { content: none; }
  html body .barre-achat.barre-achat .barre-achat__achat .bouton .cta__chez { display: block !important; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 0.82em; font-weight: 500; }
  html body .barre-achat .barre-achat__achat .bouton .cta__chez em { font-size: 1.12em; }
  body.avec-barre-achat { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 560px) { html body .barre-achat .barre-achat__prix-bloc { display: none; } }
@media (max-width: 420px) {
  html body .barre-achat .barre-achat__achat .bouton--marchand { padding-left: 0.8rem !important; }
  html body .barre-achat .barre-achat__achat .bouton .cta__texte { padding-right: 0.7rem; }
  html body .barre-achat .barre-achat__achat .bouton--marchand .cta__fleche { padding: 0 0.6rem; }
}
@media (max-width: 560px) { .barre-achat .barre-achat__photo { display: none; } }
