/* ================================================================
   Maison de la Truffe, la navigation de la boutique (24/11/2026).
   Aucun hex : seulement var(--wp--preset--*) et var(--wp--custom--*).

   - la recherche de produits de la boutique (pol/boutique-bande), à droite
     du sélecteur de rubrique, sur le modèle de Caviar Kaspia ;
   - le fil d'Ariane de la fiche (woocommerce/breadcrumbs, classe
     t-fiche-ariane, au-dessus du nom) ;
   - le filtre de prix du panneau des filtres ;
   - les sous-catégories sous le titre d'une section ;
   - la page des résultats de recherche de produits.
   ================================================================ */

/* ----- La recherche de la boutique ----- */
/* Sur le modèle de la boutique de Caviar Kaspia, aux jetons de la Truffe. À
   droite du sélecteur de rubrique, sur la même ligne. Au bureau : un champ fin
   dans la lettre de la bande (capitales de navigation), souligné d'un filet noir
   d'un pixel, puis la loupe, sur la cible de 44 px ; au survol et au focus, le
   filet et la loupe passent à l'or. Sous 900 px : la loupe seule ; au clic, le
   champ s'ouvre sous la ligne de la bande et pousse la page (transition de la
   rangée de la grille), avec une croix pour le refermer. */
.t-bande .t-bande-gauche {
  display: flex;
  align-items: center;
  column-gap: var(--wp--preset--spacing--pause);
  min-width: 0;
}
.t-bande .t-bande-ouvrir-recherche,
.t-bande .t-bande-loupe,
.t-bande .t-bande-fermer-recherche {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-width: var(--wp--custom--cible);
  min-height: var(--wp--custom--cible);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--wp--preset--color--noir);
  cursor: pointer;
  transition: color 0.25s ease;
}
.t-bande .t-bande-recherche {
  display: flex;
  align-items: center;
  column-gap: 0.5rem;
  width: 15rem;
  min-width: 0;
  min-height: var(--wp--custom--cible);
  margin: 0;
  border-bottom: 1px solid var(--wp--preset--color--noir);
  transition: border-color 0.25s ease;
}
.t-bande .t-bande-recherche:is(:hover, :focus-within) {
  border-bottom-color: var(--wp--preset--color--or-nav);
}
.t-bande .t-bande-recherche:focus-within {
  outline: 2px solid var(--wp--preset--color--noir);
  outline-offset: 3px;
}
.t-bande .t-bande-champ {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--wp--preset--color--noir);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.t-bande .t-bande-champ::placeholder {
  color: inherit;
  opacity: 1;
}
.t-bande .t-bande-champ::-webkit-search-cancel-button {
  display: none;
}
.t-bande .t-bande-loupe {
  margin-right: calc(-1 * (var(--wp--custom--cible) - 14px) / 2);
}
.t-bande .t-bande-recherche:is(:hover, :focus-within) .t-bande-loupe,
.t-bande .t-bande-ouvrir-recherche[aria-expanded="true"] {
  color: var(--wp--preset--color--or-nav);
}

/* Au bureau, le champ est toujours là : ni loupe d'ouverture, ni croix. */
@media (min-width: 900px) {
  .t-bande .t-bande-ouvrir-recherche,
  .t-bande .t-bande-fermer-recherche {
    display: none;
  }
}

@media (max-width: 899.98px) {
  .t-bande-bloc .t-bande {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-rows: var(--wp--custom--bande) 0fr;
    grid-template-areas:
      "rubriques loupe . outils"
      "recherche recherche recherche recherche";
    column-gap: 0;
    height: auto;
    transition: grid-template-rows 0.3s ease;
  }
  .t-bande-bloc .t-bande.est-recherche-ouverte {
    grid-template-rows: var(--wp--custom--bande) 1fr;
  }
  .t-bande .t-bande-gauche {
    display: contents;
  }
  .t-bande .t-bande-rubriques {
    grid-area: rubriques;
    align-self: center;
  }
  .t-bande .t-bande-ouvrir-recherche {
    grid-area: loupe;
    align-self: center;
    margin-inline: 0.5rem;
  }
  .t-bande .t-bande-outils {
    grid-area: outils;
    align-self: center;
  }
  /* Fermé, le champ n'occupe aucune hauteur et ne reçoit pas le focus ; ouvert,
     il prend la rangée sous la ligne, sur toute la largeur de la bande, avec la
     croix. */
  .t-bande .t-bande-recherche {
    grid-area: recherche;
    width: auto;
    min-height: 0;
    margin-bottom: 0;
    overflow: hidden;
    visibility: hidden;
    border-bottom-color: transparent;
    transition:
      visibility 0s linear 0.3s,
      border-color 0.25s ease,
      margin-bottom 0.3s ease;
  }
  .t-bande.est-recherche-ouverte .t-bande-recherche {
    margin-bottom: var(--wp--preset--spacing--souffle);
    visibility: visible;
    border-bottom-color: var(--wp--preset--color--noir);
    transition:
      visibility 0s linear 0s,
      border-color 0.25s ease,
      margin-bottom 0.3s ease;
  }
  .t-bande.est-recherche-ouverte .t-bande-recherche:is(:hover, :focus-within) {
    border-bottom-color: var(--wp--preset--color--or-nav);
  }
  .t-bande .t-bande-recherche:focus-within {
    outline-offset: -2px;
  }
  /* Une section rejointe s'arrête sous la bande ouverte. */
  .t-boutique:has(.t-bande.est-recherche-ouverte) .t-boutique-catalogue,
  .t-boutique:has(.t-bande.est-recherche-ouverte) .t-boutique-groupe,
  .t-boutique:has(.t-bande.est-recherche-ouverte) .t-boutique-section {
    scroll-margin-top: calc(var(--wp--custom--bande) + var(--wp--custom--cible) + var(--wp--preset--spacing--souffle) + var(--wp--preset--spacing--boite) - 1rem);
  }
}

/* Sous 600 px, la ligne doit tenir le sélecteur, la loupe, « Filtres » et les
   vues sans couper le nom de la rubrique : le mot « Vue » passe aux seuls
   lecteurs d'écran (il nomme toujours le groupe des vues). */
@media (max-width: 599.98px) {
  .t-bande .t-bande-vue {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Sans script, la loupe d'ouverture n'agit pas : le champ reste ouvert. */
@media (max-width: 899.98px) and (scripting: none) {
  .t-bande .t-bande-ouvrir-recherche,
  .t-bande .t-bande-fermer-recherche {
    display: none;
  }
  .t-bande-bloc .t-bande {
    grid-template-rows: var(--wp--custom--bande) 1fr;
  }
  .t-bande .t-bande-recherche {
    margin-bottom: var(--wp--preset--spacing--souffle);
    visibility: visible;
    border-bottom-color: var(--wp--preset--color--noir);
  }
}

@media (prefers-reduced-motion: reduce) {
  .t-bande-bloc .t-bande,
  .t-bande .t-bande-recherche,
  .t-bande.est-recherche-ouverte .t-bande-recherche {
    transition: none;
  }
}

/* ----- Le fil d'Ariane de la fiche ----- */
.t-fiche .t-fiche-ariane {
  margin: 0 0 var(--wp--preset--spacing--souffle);
}
.t-fiche .t-fiche-ariane ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--caps);
  font-weight: 700;
  line-height: var(--wp--custom--interligne--caps);
  letter-spacing: var(--wp--custom--interlettrage--caps);
  text-transform: uppercase;
  color: var(--wp--preset--color--noir-doux);
}
.t-fiche .t-fiche-ariane li {
  display: inline-flex;
  align-items: center;
}
.t-fiche .t-fiche-ariane a {
  display: inline-flex;
  align-items: center;
  min-height: var(--wp--custom--cible);
  color: var(--wp--preset--color--noir-doux);
  text-decoration: none;
  transition: color 0.25s ease;
}
.t-fiche .t-fiche-ariane a:hover {
  color: var(--wp--preset--color--noir);
}
.t-fiche .t-fiche-ariane .t-fiche-ariane-sep {
  margin-inline: 0.6em;
}
.t-fiche .t-fiche-ariane li[aria-current] {
  color: var(--wp--preset--color--noir);
}
.t-fiche .t-fiche-ariane li[aria-current] br {
  display: none;
}

/* ----- Le filtre de prix ----- */
.t-filtres-prix {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--wp--preset--spacing--souffle) var(--wp--preset--spacing--boite);
}
.t-filtres-prix-champ {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.t-filtres-prix-champ > span {
  font-size: var(--wp--preset--font-size--caps);
  color: var(--wp--preset--color--noir-doux);
}
.t-filtres-prix-champ input {
  width: 7rem;
  min-height: var(--wp--custom--cible);
  padding: 0 var(--wp--preset--spacing--souffle);
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--corps);
  color: var(--wp--preset--color--noir);
  background: var(--wp--preset--color--fond);
  border: 1px solid var(--wp--preset--color--filet);
  border-radius: 0;
}
.t-filtres-prix-champ input:focus-visible {
  outline: 1px solid var(--wp--preset--color--noir);
  outline-offset: 0;
}
.t-filtres-prix-effacer[hidden] {
  display: none;
}

/* ----- Les sous-catégories d'une section ----- */
.t-boutique-section > .t-sous-rubriques {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--wp--preset--spacing--boite);
  margin-block: calc(var(--wp--preset--spacing--souffle) * -1) var(--wp--preset--spacing--boite);
}
.t-sous-rubrique {
  display: inline-flex;
  align-items: center;
  min-height: var(--wp--custom--cible);
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--caps);
  font-weight: 700;
  letter-spacing: var(--wp--custom--interlettrage--caps);
  text-transform: uppercase;
  color: var(--wp--preset--color--noir-doux);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.6em;
  transition: color 0.25s ease;
}
.t-sous-rubrique:hover {
  color: var(--wp--preset--color--noir);
}

/* ----- Les résultats de recherche de produits ----- */
.t-recherche-produits .t-recherche-tete {
  display: flex;
  flex-direction: column;
  gap: var(--wp--preset--spacing--boite);
  padding-top: var(--wp--preset--spacing--temps);
}
.t-recherche-produits .t-recherche-champ {
  max-width: 32rem;
}
.t-recherche-produits .t-recherche-champ .wp-block-search__inside-wrapper {
  border: 0;
  border-bottom: 1px solid var(--wp--preset--color--noir);
  padding: 0;
}
.t-recherche-produits .t-recherche-champ .wp-block-search__input {
  min-height: var(--wp--custom--cible);
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--corps);
}
.t-recherche-produits .t-recherche-pages {
  margin-top: var(--wp--preset--spacing--pause);
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--caps);
  letter-spacing: var(--wp--custom--interlettrage--caps);
}

/* ----- La page Suivi de commande (code court woocommerce_order_tracking) ----- */
/* Les feuilles générales de WooCommerce ne se chargent pas sur cette page
   (choix de vitesse du 06/10) : le formulaire prend ici la lettre et les
   champs du site. */
.woocommerce-form-track-order {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wp--preset--spacing--boite);
  max-width: 44rem;
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--corps);
  line-height: var(--wp--custom--interligne--corps);
}
.woocommerce-form-track-order > p:first-child {
  flex: 1 1 100%;
  margin: 0;
}
.woocommerce-form-track-order .form-row {
  display: flex;
  flex: 1 1 16rem;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
}
.woocommerce-form-track-order .form-row label {
  font-size: var(--wp--preset--font-size--caps);
  font-weight: 700;
  letter-spacing: var(--wp--custom--interlettrage--caps);
  text-transform: uppercase;
  color: var(--wp--preset--color--noir-doux);
}
.woocommerce-form-track-order .input-text {
  min-height: var(--wp--custom--cible);
  padding: 0 var(--wp--preset--spacing--souffle);
  font: inherit;
  color: var(--wp--preset--color--noir);
  background: var(--wp--preset--color--fond);
  border: 1px solid var(--wp--preset--color--filet);
  border-radius: 0;
}
.woocommerce-form-track-order .form-row:has(.button) {
  flex: 1 1 100%;
}
.woocommerce-form-track-order .clear {
  display: none;
}
.woocommerce-form-track-order .button {
  align-self: flex-start;
  min-height: var(--wp--custom--cible);
  padding: 0 var(--wp--preset--spacing--boite);
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--caps);
  font-weight: 700;
  letter-spacing: var(--wp--custom--interlettrage--caps);
  text-transform: uppercase;
  color: var(--wp--preset--color--fond);
  background: var(--wp--preset--color--noir);
  border: 0;
  border-radius: 0;
  cursor: pointer;
}

/* ----- La page Panier sous 900 px : « Valider la commande » collé au bas ----- */
/* Le conteneur du bouton du bloc Panier de WooCommerce passe en barre fixe au
   bas de la fenêtre, sur toute la largeur, aux gouttières de page, fermée en
   haut par le filet or de la barre basse de l'accueil ; l'encoche de l'iPhone
   est réservée. Le total estimé (recopié par assets/js/panier-barre.js) se lit
   au-dessus du bouton. Le même conteneur sert que WooCommerce le marque
   collant ou non (classe --sticky, fond posé en ligne par WooCommerce, d'où
   le !important). Le corps de la page réserve la hauteur
   de la barre : le pied ne passe jamais dessous. Le bureau ne change pas. */
@media (max-width: 899.98px) {
  body:has(.t-commerce-panier .wc-block-cart__submit-container) {
    padding-bottom: calc(var(--wp--custom--cible) + 1.75rem + 1.625rem + 2px + env(safe-area-inset-bottom, 0px));
  }
  .t-commerce-panier .wc-block-cart__submit-container,
  .t-commerce-panier .wc-block-cart__submit-container--sticky {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    column-gap: var(--wp--preset--spacing--souffle);
    margin: 0;
    padding: 0.625rem var(--wp--custom--gut-d) calc(0.75rem + env(safe-area-inset-bottom, 0px)) var(--wp--custom--gut-g);
    background: var(--wp--preset--color--fond) !important;
    border-top: 2px solid var(--wp--preset--color--or-nav);
    box-shadow: none;
  }
  /* WooCommerce dessine l'ombre de sa barre collante dans ::before : elle est
     retirée, et ::before et ::after portent le total. */
  .t-commerce-panier .wc-block-cart__submit-container::before {
    content: none;
    box-shadow: none;
  }
  .t-commerce-panier .wc-block-cart__submit-container[data-total-valeur]::before,
  .t-commerce-panier .wc-block-cart__submit-container[data-total-valeur]::after {
    position: static;
    inset: auto;
    height: auto;
    box-shadow: none;
    background: none;
    grid-row: 1;
    margin-bottom: 0.5rem;
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--wp--preset--font-size--corps);
    line-height: 1.125rem;
    color: var(--wp--preset--color--noir);
  }
  .t-commerce-panier .wc-block-cart__submit-container[data-total-valeur]::before {
    content: attr(data-total-libelle);
    grid-column: 1;
  }
  .t-commerce-panier .wc-block-cart__submit-container[data-total-valeur]::after {
    content: attr(data-total-valeur);
    grid-column: 2;
    font-weight: 700;
  }
  .t-commerce-panier .wc-block-cart__submit-container > * {
    grid-column: 1 / -1;
  }
  .t-commerce-panier .wc-block-cart__submit-container > .wc-block-cart__submit-button {
    width: 100%;
  }
}

/* ----- La page Panier sous 900 px : des écarts serrés ----- */
/* Au-dessus du titre, la marge latérale de la page (gut) ; entre le titre,
   les avis, le message de livraison et le panier, le pas suivant (boite). Le
   gabarit pose son haut de page et son écart de blocs en ligne (temps et
   pause, valeurs du bureau), d'où le !important. Le premier article tient
   ainsi dans le premier écran, au-dessus de la barre collante. */
@media (max-width: 899.98px) {
  main.t-commerce-panier {
    padding-top: var(--wp--preset--spacing--gut) !important;
  }
  main.t-commerce-panier.t-commerce-panier > * + * {
    margin-block-start: var(--wp--preset--spacing--boite);
  }
  main.t-commerce-panier .wp-block-pol-seuil-livraison {
    margin-block-end: var(--wp--preset--spacing--boite);
  }
}

/* ----- Le pied de page : les quatre colonnes de la boutique ----- */
/* Sous la grille du pied, quatre colonnes (deux sous 900 px) : un titre (bloc
   paragraphe du pied, modifiable dans l'éditeur du site), puis un menu (Boutique,
   Espace client, Livraison, modifiables dans Apparence, Éditeur, Navigation) ou
   une liste calculée (livraison offerte, moyens de paiement). */
.t-pied .t-pied-boutique {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--wp--preset--spacing--pause) var(--wp--custom--grille--colonne);
  margin-top: var(--wp--preset--spacing--pause);
  padding-top: var(--wp--preset--spacing--pause);
  border-top: 1px solid color-mix(in oklab, var(--wp--preset--color--ivoire) 14%, transparent);
}
@media (min-width: 900px) {
  .t-pied .t-pied-boutique {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.t-pied .t-pied-boutique > .t-pied-colonne,
.t-pied .t-pied-boutique > .t-pied-colonne > * {
  margin-block: 0;
}
.t-pied .t-pied-boutique > .t-pied-colonne > .t-sous {
  margin-bottom: var(--wp--preset--spacing--souffle);
  color: var(--wp--preset--color--ivoire);
}
