/* ==========================================================================
   /boutique — catalogue filtrable
   Les composants (chip, swatch, select, product-card, empty-state…) viennent de main.css.
   ========================================================================== */

/* ---------- Ouverture éditoriale ---------- */
.shop-hero {
  --hero-pad: clamp(24px, 2.4vw, 34px);
  padding-block: 12px 0;
  overflow: clip;
  transition: background-color 700ms var(--ease), color 700ms var(--ease);
}
.shop-hero.section--dark { background-color: var(--basalt); }
.shop-hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: end;
  gap: var(--space-6);
  min-height: clamp(140px, 11vw, 168px);
  padding-top: 8px;
  padding-bottom: var(--hero-pad);
}
.shop-hero__text { display: grid; gap: clamp(10px, 1vw, 16px); align-content: end; position: relative; z-index: 2; }
.shop-hero__title { font-size: clamp(2.375rem, 3.75vw, 3.375rem); line-height: 0.96; letter-spacing: var(--brut-track-l); margin-top: 0.04em; overflow-wrap: normal; }
.shop-hero__latin { margin-top: 0; }
.shop-hero__lead { max-width: 44rem; color: var(--fg-muted); line-height: 1.45; }
.shop-hero.section--dark .shop-hero__lead { color: rgba(243, 239, 231, 0.82); }

.shop-hero__art { position: relative; align-self: stretch; min-height: 200px; display: grid; justify-items: end; }
.shop-hero__img {
  position: absolute; right: calc(clamp(0px, 9vw, 150px) + 56px); bottom: calc(var(--hero-pad) * -0.4); top: 0;
  width: 78%; display: flex; justify-content: flex-end; align-items: flex-end;
}
.shop-hero__img svg { display: block; height: 100%; width: auto; max-width: 100%; }
.shop-hero__count { position: absolute; right: 0; bottom: var(--hero-pad); display: grid; justify-items: end; gap: 10px; }
.shop-hero__numeral {
  display: block; font: 900 clamp(4.25rem, 7vw, 7rem)/0.78 var(--font-sans); letter-spacing: var(--brut-track-xl);
  color: var(--decor-soft); user-select: none; text-align: right;
}
.shop-hero__cap { padding-right: 0.42em; }
.shop-hero__frieze { position: absolute; left: 0; right: 0; bottom: 0; width: auto; }
.shop-hero .container { position: relative; }
.shop-hero .breadcrumb { margin-top: clamp(8px, 1vw, 16px); }

/* Héros sombre (collection) : l’en-tête est transparent et sort du flux, le héros compense sa hauteur. */
body[data-header='transparent'] .shop-hero { padding-top: calc(var(--announce-h) + var(--header-h) + clamp(14px, 1.6vw, 24px)); }
.shop-hero__lead { text-wrap: pretty; }
.shop-hero__numeral .count__box { justify-items: end; --count-justify: flex-end; }

/* ---------- Barre de filtres collante ---------- */
.shop-bar {
  position: sticky; top: var(--header-h); z-index: var(--z-sticky);
  background: rgba(243, 239, 231, 0.94);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--rule);
  transition: top 600ms var(--ease);
}
html.hdr-hidden .shop-bar { top: 0; }
.shop-bar__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 28px; }
.shop-bar__row--main { min-height: 56px; }
.shop-bar__row--facets { justify-content: flex-start; gap: 12px clamp(24px, 3.2vw, 56px); min-height: 56px; padding-block: 8px; border-top: 1px solid var(--rule); }

.shop-cats { display: flex; gap: clamp(20px, 3.4vw, 52px); }
.shop-cat {
  position: relative; padding: 19px 0 17px;
  font: 600 0.72rem/1 var(--font-caps); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
  transition: color var(--dur-1);
}
.shop-cat::after { content: ''; position: absolute; left: 0; right: 0.26em; bottom: -1px; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform var(--dur-2) var(--ease); }
.shop-cat:hover { color: var(--ink); }
.shop-cat[aria-pressed='true'] { color: var(--ink); }
.shop-cat[aria-pressed='true']::after, .shop-cat:hover::after { transform: scaleX(1); }

.shop-bar__tools { display: flex; align-items: center; gap: 12px 28px; }
.shop-count { font: 600 0.9rem/1 var(--font-sans); letter-spacing: 0; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.shop-sort { display: block; }
.shop-sort .select, .shop-select { min-height: 40px; padding: 8px 40px 8px 14px; font-size: 0.82rem; background-size: 18px; background-position: right 12px center; }
.shop-sort .select { width: 224px; }
.shop-select { width: 188px; }
.shop-filter-btn { display: none; }

.shop-facet { display: flex; align-items: center; gap: 14px; min-width: 0; }
.shop-facet__label { font: 600 0.7rem/1 var(--font-caps); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.shop-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-chip { min-height: 36px; padding: 0 16px; font: 600 0.7rem/1 var(--font-caps); letter-spacing: 0.16em; text-transform: uppercase; }
.shop-chip.is-dim { opacity: 0.45; }
.shop-chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--marble); }
.shop-chip--color { gap: 10px; }
.shop-chip__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px rgba(15, 14, 12, 0.3); }
.shop-colors { display: flex; align-items: center; gap: 12px; }
.shop-colors > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; }
.shop-colors > summary::-webkit-details-marker { display: none; }
.shop-colors > summary::after { content: ''; width: 6px; height: 6px; margin-left: 10px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.shop-colors[open] > summary::after { transform: rotate(-135deg) translate(-1px, -1px); }
.shop-swatches { display: flex; flex-wrap: wrap; gap: 0; }
.shop-swatches .swatch { width: 32px; height: 32px; }
.swatch.is-unavailable { opacity: 0.28; cursor: not-allowed; }
.swatch.is-unavailable:hover::before { transform: none; }
.shop-reset { font-size: 0.8rem; letter-spacing: 0.06em; color: var(--accent); white-space: nowrap; }
.shop-bar__tools .shop-reset[hidden] { display: none; }

/* ---------- Grille ---------- */
.shop-results { padding-block: clamp(20px, 2vw, 28px) var(--section-y); }
.shop-grid { min-height: 40vh; }
.shop-grid > noscript { grid-column: 1 / -1; }

/* Tuile éditoriale */
.shop-grid { grid-auto-flow: row dense; }
.shop-tile {
  container-type: inline-size;
  grid-column: span var(--s4, 2); position: relative; isolation: isolate; overflow: hidden;
  display: grid; align-content: end; min-height: 420px;
  padding: clamp(24px, 3vw, 52px);
  background: var(--basalt); color: var(--marble);
}
.shop-tile::before { content: ''; position: absolute; inset: 0; z-index: -2; background: url(/assets/textures/marble-dark.webp) center / cover; opacity: 0.1; mix-blend-mode: screen; }
.shop-tile__art { position: absolute; z-index: -1; right: clamp(8px, 3vw, 48px); top: 8%; height: 84%; width: 52%; display: flex; justify-content: flex-end; align-items: center; --decor: var(--decor-soft); transition: transform 1.4s var(--ease); }
.shop-tile__art svg { display: block; height: 100%; width: auto; max-width: 100%; }
.shop-tile:hover .shop-tile__art { transform: translateY(-6px) scale(1.03); }
@container (max-width: 400px) { .shop-tile__art { top: 4%; height: 48%; width: 70%; } }
.shop-tile__body { position: relative; display: grid; gap: clamp(10px, 1.2vw, 18px); max-width: 26rem; }
.shop-tile__quote { font: 900 clamp(1.5rem, 0.75rem + 1.5vw, 2.125rem)/1.04 var(--font-sans); letter-spacing: var(--brut-track-m); text-transform: uppercase; text-wrap: balance; color: var(--marble); overflow-wrap: normal; }
.shop-tile__title { font: 900 clamp(2.375rem, 1.25rem + 2.1vw, 3.25rem)/0.96 var(--font-sans); letter-spacing: var(--brut-track-l); text-transform: uppercase; }
.shop-tile__fr { color: rgba(243, 239, 231, 0.78); font: 600 0.875rem/1.4 var(--font-sans); letter-spacing: 0; max-width: 22rem; }
/* Tuile étroite (une colonne sur mobile : 100 à 120 px de texte) : le mot le plus long tient entier
   (MONUMENTUM ≈ 7em en 900 capitales ; 1cqi = 1 % de la largeur de texte de la tuile) */
@container (max-width: 400px) {
  .shop-tile__quote { font-size: min(1.5rem, 14cqi); }
  .shop-tile__title { font-size: min(2.375rem, 20cqi); }
}
.shop-tile .link-arrow { margin-top: 6px; }
.shop-tile .eyebrow { color: var(--gold-light); }

/* État vide : la colonne brisée se construit (décor plein partagé) */
.shop-empty { display: grid; gap: clamp(40px, 6vw, 80px); }
.shop-empty__ruin { display: block; width: min(300px, 70%); aspect-ratio: 835 / 497.43; margin-inline: auto; --decor: var(--decor-soft); }
.shop-empty__ruin svg { display: block; width: 100%; height: 100%; }
.shop-empty .empty-state { padding-block: clamp(32px, 6vw, 72px) 0; }
.shop-empty__suggest { display: grid; gap: var(--space-5); padding-top: clamp(32px, 4vw, 56px); border-top: 1px solid var(--rule); }

/* ---------- Tiroir de filtres (mobile) ---------- */
.filter-drawer { position: fixed; inset: 0; z-index: var(--z-drawer); display: none; visibility: hidden; background: var(--marble); transform: translateY(100%); transition: transform 600ms var(--ease), visibility 0s linear 600ms; }
.filter-drawer.is-open { visibility: visible; transform: none; transition-delay: 0s; }
/* À l'ouverture, les groupes montent l'un après l'autre une fois le panneau en place */
.filter-drawer.is-open .filter-group, .filter-drawer.is-open .filter-drawer__foot { animation: sp-rise 640ms var(--ease-out) both; animation-delay: calc(240ms + var(--g, 0) * 60ms); }
.filter-drawer.is-open .filter-group:nth-child(2) { --g: 1; } .filter-drawer.is-open .filter-group:nth-child(3) { --g: 2; } .filter-drawer.is-open .filter-group:nth-child(4) { --g: 3; } .filter-drawer.is-open .filter-group:nth-child(5) { --g: 4; }
.filter-drawer.is-open .filter-drawer__foot { --g: 5; }
.filter-drawer__panel { display: flex; flex-direction: column; height: 100%; background: var(--marble) url(/assets/textures/marble-light.webp) center / cover; }
.filter-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 14px var(--gutter) 14px; border-bottom: 1px solid var(--rule); }
.filter-drawer__title { font: 600 0.82rem/1 var(--font-caps); letter-spacing: 0.16em; }
.filter-drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px var(--gutter) 32px; }
.filter-group { padding-block: 22px; border-bottom: 1px solid var(--rule); display: grid; gap: 16px; }
.filter-group:last-child { border-bottom: 0; }
.filter-group__title { font: 600 0.7rem/1 var(--font-caps); letter-spacing: 0.18em; color: var(--accent); }
.filter-drawer__foot { display: grid; grid-template-columns: 1fr 1.5fr; gap: 12px; padding: 16px var(--gutter) calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); background: var(--marble); }
.filter-drawer__foot .btn { padding-inline: 12px; }
.filter-drawer .shop-select { width: 100%; min-height: 48px; font-size: 0.95rem; }

/* ---------- Adaptations ---------- */
@media (max-width: 1100px) {
  .shop-sort .select { width: 200px; }
  .shop-tile { grid-column: span var(--s3, 2); }
}
@media (max-width: 860px) { .shop-tile { grid-column: span var(--s2, 2); } }
@media (max-width: 900px) {
  .filter-drawer { display: block; }
  .shop-bar__row--facets, .shop-bar__tools .shop-reset { display: none !important; }
  .shop-bar__row--main { gap: 0 16px; }
  .shop-cats { flex: 1 1 100%; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--rule); }
  .shop-cat { padding: 16px 0 14px; flex: 1; text-align: center; font-size: 0.66rem; letter-spacing: 0.2em; }
  .shop-cat::after { right: 0; }
  .shop-bar__tools { flex: 1 1 100%; justify-content: space-between; min-height: 56px; gap: 12px; }
  .shop-count { order: 1; font-size: 0.875rem; }
  .shop-sort { order: 2; flex: 1; min-width: 0; max-width: 240px; margin-left: auto; }
  .shop-sort .select { width: 100%; min-height: 40px; }
  .shop-filter-btn {
    order: 3; display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px;
    font: 600 0.7rem/1 var(--font-caps); letter-spacing: 0.12em; text-transform: uppercase;
    border: 1px solid var(--field-border); border-radius: var(--radius-sm); transition: background var(--dur-1), color var(--dur-1);
  }
  .shop-filter-btn:hover { background: var(--ink); color: var(--marble); }
  .shop-filter-btn .icon { width: 18px; height: 18px; }
  .shop-filter-btn__n { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 18px; font-size: 0.66rem; color: var(--ink); background: var(--gold); letter-spacing: 0; }

  .shop-hero__grid { grid-template-columns: 1fr; min-height: 0; padding-bottom: clamp(48px, 10vw, 80px); }
  .shop-hero__art { position: absolute; inset: 0; min-height: 0; pointer-events: none; }
  .shop-hero__img { --decor: var(--decor-soft); width: 60%; right: -6%; top: 6%; bottom: auto; height: 70%; }
  .shop-hero__count { top: 6%; bottom: auto; right: 0; }
  .shop-hero__numeral { font-size: clamp(3.8125rem, 17vw, 6.25rem); opacity: 0.9; }
  .shop-hero__title { font-size: clamp(2.375rem, 8vw, 3.125rem); }
  .shop-tile { min-height: 300px; }

  /* Cibles tactiles : 44 px minimum */
  .shop-cat { padding-block: 0; min-height: 48px; display: grid; place-items: center; }
  .shop-cat::after { bottom: -1px; }
  .shop-filter-btn, .shop-sort .select { min-height: 44px; }
  .filter-drawer .shop-chip { min-height: 44px; }
  .filter-drawer .shop-chips { gap: 10px; }
  .shop-reset { min-height: 44px; display: inline-flex; align-items: center; }
  .shop-tile .link-arrow { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (min-width: 601px) and (max-width: 900px) {
  .shop-hero__count { top: auto; bottom: var(--hero-pad); }
  .shop-hero__lead { max-width: min(34rem, 70%); }
  .shop-hero__title { font-size: clamp(2.5rem, 5vw, 3.125rem); }
}
@media (max-width: 600px) {
  /* Le décompte figure déjà dans la barre de filtres : on libère le titre. */
  .shop-hero__count { display: none; }
}
@media (max-width: 480px) {
  .shop-sort .select { padding-left: 12px; font-size: 0.78rem; }
  .shop-grid .product-card__badge { top: 10px; left: 10px; max-width: calc(100% - 64px); padding: 5px 7px 4px; font-size: 0.66rem; letter-spacing: 0.14em; line-height: 1.25; }
  /* libellé masqué à l'œil mais conservé pour les lecteurs d'écran (nom accessible du bouton) */
  .shop-filter-btn span:not(.shop-filter-btn__n) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .shop-filter-btn { position: relative; padding-inline: 12px; }
  .shop-tile { min-height: 340px; }
  /* Tuile sur une seule colonne (--s2: 1) : marges latérales resserrées (16 px au lieu de 24) pour que
     « SAVOIR-FAIRE → » tienne sur une ligne et que la citation garde sa taille au-dessus de la traduction */
  .shop-tile { padding-inline: calc(8px + 8px * var(--s2, 2)); }
  .shop-tile__art { width: 46%; }
}

@media (prefers-reduced-motion: reduce) {
  .shop-grid, .shop-bar, .filter-drawer { transition: none !important; }
}

.shop-empty .empty-state__title { color: var(--fg); }

/* Cartes : toutes à la même hauteur, les prix s’alignent en pied de carte */
.shop-grid .product-card { height: 100%; }

/* Nom de la pièce : zone tactile de 44 px sans modifier la mise en page */
@media (max-width: 900px) {
  .shop-grid .product-card__name a { display: inline-block; padding-block: 11px; margin-block: -11px; }
}

/* Ajout rapide : masqué (et donc non lu) tant que la carte n’est ni survolée ni focalisée */
.shop-grid .product-card__quick { visibility: hidden; transition: transform var(--dur-2) var(--ease), visibility 0s linear var(--dur-2); }
.shop-grid .product-card:hover .product-card__quick,
.shop-grid .product-card:focus-within .product-card__quick { visibility: visible; transition-delay: 0s; }
.shop-hero__lead { font-size: clamp(1rem, 0.78rem + 0.4vw, 1.125rem); }
