/* F1 memorabilia (maquette) — en-tête (icônes), panier, recherche, menu mobile, pied de page.
   Suit les deux ambiances grâce aux jetons --f1-* de theme.css. */

html:has(dialog[open]) { overflow: hidden; }

/* ---------- Icônes de l'en-tête ---------- */
.icone {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  transition: color 0.3s var(--f1-ease);
}

.icone:hover { color: #ff4d50; }
.icone svg { width: 21px; height: 21px; }

.pastille {
  position: absolute;
  top: 3px;
  right: 1px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--f1-red);
  color: #fff;
  font: 700 0.68rem/18px var(--font-body--family);
  text-align: center;
}

.pastille.rebond { animation: rebond 0.6s var(--f1-ease); }
@keyframes rebond { 30% { transform: scale(1.5); } 60% { transform: scale(0.9); } }

.icone--menu { display: none; }
@media (max-width: 749px) {
  .icone--menu { display: grid; }
  .barre__droite { gap: 4px; }
}

/* ---------- Tiroirs (panier à droite, menu à gauche) ---------- */
dialog.tiroir {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(440px, 100%);
  height: 100%;
  max-height: none;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--f1-line);
  background: var(--f1-page);
  color: var(--f1-ink);
  animation: tiroir-droite 0.5s var(--f1-ease);
}

dialog.tiroir--gauche { inset: 0 auto 0 0; border-left: 0; border-right: 1px solid var(--f1-line); animation-name: tiroir-gauche; }
dialog.tiroir::backdrop, dialog.recherche::backdrop { background: rgb(8 8 9 / 0.6); backdrop-filter: blur(4px); animation: voile 0.4s ease; }
dialog.tiroir.ferme { animation: tiroir-droite 0.38s var(--f1-ease) reverse forwards; }
dialog.tiroir--gauche.ferme { animation-name: tiroir-gauche; }
dialog.tiroir.ferme::backdrop, dialog.recherche.ferme::backdrop { animation: voile 0.38s ease reverse forwards; }
@keyframes tiroir-droite { from { transform: translateX(100%); } }
@keyframes tiroir-gauche { from { transform: translateX(-100%); } }

.tiroir__corps { display: flex; flex-direction: column; height: 100%; }

.tiroir__tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--f1-line);
}

.tiroir__tete h2 { margin: 0; font-size: 1.6rem; color: var(--f1-ink); }
.tiroir__tete h2::after { display: none; }
.tiroir__tete h2 span { color: var(--f1-red-text); font-family: var(--font-serif); font-style: italic; font-weight: 500; text-transform: none; }
.fermer-x { font-size: 1.6rem; line-height: 1; }

/* ---------- Panier ---------- */
.panier__liste { list-style: none; margin: 0; padding: 8px 24px; overflow-y: auto; flex: 1; }

.ligne {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--f1-line);
  animation: ligne-entre 0.5s var(--f1-ease);
  transition: opacity 0.3s, transform 0.3s var(--f1-ease);
}

.ligne.sortie { opacity: 0; transform: translateX(30px); }
@keyframes ligne-entre { from { opacity: 0; transform: translateY(10px); } }

.ligne__photo { padding: 0; border: 1px solid var(--f1-frame); background: var(--f1-stone); aspect-ratio: 4 / 5; cursor: pointer; overflow: hidden; }
.ligne__photo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.ligne__infos { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ligne__cat { margin: 0; font: 600 0.66rem var(--font-subheading--family); letter-spacing: 0.22em; text-transform: uppercase; color: var(--f1-red-text); }

.ligne__titre {
  padding: 0;
  border: 0;
  background: none;
  color: var(--f1-ink);
  text-align: left;
  cursor: pointer;
  font: 600 0.95rem/1.25 var(--font-subheading--family);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ligne__bas { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.ligne__prix { font: 500 1.15rem var(--font-serif); }
.ligne__retirer { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--f1-muted); font-size: 0.78rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ligne__retirer:hover { color: var(--f1-red-text); }

.quantite { display: inline-flex; align-items: center; border: 1px solid var(--f1-line); }
.quantite button { width: 32px; height: 32px; border: 0; background: none; color: var(--f1-ink); font-size: 1rem; cursor: pointer; }
.quantite button:hover:not(:disabled) { background: var(--f1-track); }
.quantite button:disabled { opacity: 0.3; cursor: default; }
.quantite span { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; }

.panier__vide { display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center; }
.panier__vide p { margin: 0; font: 500 1.5rem var(--font-serif); font-style: italic; color: var(--f1-muted); }
.tiroir--vide .panier__vide { display: flex; }
.tiroir--vide .panier__liste, .tiroir--vide .panier__pied { display: none; }

.panier__pied { padding: 20px 24px 24px; border-top: 1px solid var(--f1-line); display: grid; gap: 12px; }
.panier__total { display: flex; justify-content: space-between; align-items: baseline; }
.panier__total span:first-child { font: 600 0.75rem var(--font-subheading--family); letter-spacing: 0.24em; text-transform: uppercase; color: var(--f1-muted); }
.panier__total strong { font: 500 1.7rem var(--font-serif); }
.panier__note { margin: 0; font-size: 0.8rem; color: var(--f1-muted); }
.panier__pied .button { width: 100%; }
.lien-discret { justify-self: center; padding: 4px; border: 0; background: none; color: var(--f1-muted); font-size: 0.85rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.paiement-sur { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.75rem; color: var(--f1-muted); }
.paiement-sur svg { width: 14px; height: 14px; }

/* ---------- Recherche ---------- */
dialog.recherche {
  width: min(760px, calc(100% - 24px));
  max-height: min(80vh, 760px);
  margin: 9vh auto auto;
  padding: 0;
  border: 1px solid var(--f1-line);
  background: var(--f1-page);
  color: var(--f1-ink);
  animation: recherche-entre 0.45s var(--f1-ease);
}

dialog.recherche.ferme { animation: recherche-entre 0.38s var(--f1-ease) reverse forwards; }
@keyframes recherche-entre { from { opacity: 0; transform: translateY(-20px); } }

.recherche__barre { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--f1-line); }
.recherche__barre svg { width: 20px; height: 20px; color: var(--f1-muted); flex: none; }
.recherche__barre input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--f1-ink); font: 600 1.4rem var(--font-subheading--family); letter-spacing: 0.04em; text-transform: uppercase; }
.recherche__barre input::placeholder { color: var(--f1-muted); }
.recherche__barre input:focus-visible { outline: 0; }
.recherche__barre input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.recherche__resultats { max-height: calc(min(80vh, 760px) - 80px); overflow-y: auto; padding: 8px 12px 16px; }
.recherche__aide, .recherche__nombre { margin: 14px 10px; color: var(--f1-muted); font-size: 0.9rem; }
.recherche__nombre { font: 600 0.72rem var(--font-subheading--family); letter-spacing: 0.22em; text-transform: uppercase; }

.resultat {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 0;
  border-bottom: 1px solid var(--f1-line);
  background: none;
  color: var(--f1-ink);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.25s;
}

.resultat:hover, .resultat:focus-visible { background: var(--f1-track); }
.resultat img, .resultat > span:first-child { width: 56px; height: 56px; object-fit: contain; background: var(--f1-stone); }
.resultat__texte { min-width: 0; display: grid; gap: 2px; }
.resultat__cat { font: 600 0.62rem var(--font-subheading--family); letter-spacing: 0.22em; text-transform: uppercase; color: var(--f1-red-text); }
.resultat__titre { font: 600 0.92rem var(--font-subheading--family); letter-spacing: 0.04em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resultat__prix { font: 500 1.05rem var(--font-serif); white-space: nowrap; }

/* ---------- Menu sur téléphone ---------- */
.menu-mobile__liens { display: grid; padding: 12px 24px; }
.menu-mobile__liens a {
  padding: 16px 0;
  border-bottom: 1px solid var(--f1-line);
  color: var(--f1-ink);
  text-decoration: none;
  font: 700 1.5rem var(--font-heading--family);
  font-style: italic;
  text-transform: uppercase;
}
.menu-mobile__liens a:hover { color: var(--f1-red-text); }

/* ---------- Fiche produit : actions ---------- */
.fiche__rassurance { display: grid; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 0.82rem; color: var(--f1-muted); }
.fiche__rassurance li::before { content: '—'; color: var(--f1-red-text); margin-right: 8px; }

/* ---------- Pied de page ---------- */
.pied-colonnes { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); padding-block: 56px 32px; }
.pied-colonnes h3 { margin: 0 0 14px; font: 700 0.8rem var(--font-subheading--family); letter-spacing: 0.24em; text-transform: uppercase; color: #fff; }
.pied-colonnes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.pied-colonnes a { color: rgb(255 255 255 / 0.82); text-decoration: none; font-size: 0.92rem; background-image: linear-gradient(#fff, #fff); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size 0.4s var(--f1-ease), color 0.3s; }
.pied-colonnes a:hover { color: #fff; background-size: 100% 1px; }
.pied-marque p { margin: 10px 0 0; max-width: 32ch; color: rgb(255 255 255 / 0.8); font-size: 0.9rem; }
.pied-bas { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 18px 26px; border-top: 1px solid rgb(255 255 255 / 0.2); font-size: 0.78rem; color: rgb(255 255 255 / 0.75); }
.pied-bas p { margin: 0; }
footer section { padding: 0 !important; }
