/* Fiche d'un thé de la boutique (Liham, 30/11/2026 : « qu'on puisse cliquer sur les produits pour voir l'image ») et
   cartes cliquables. Ordinateur : fenêtre au milieu, photo à gauche. Téléphone (≤ 760 px) : feuille qui monte du bas,
   comme le panier, prix et bouton toujours visibles en bas. Couleurs et boutons repris du site (site.css). */

/* ---------- Les cartes ouvrent la fiche ---------- */
.cq-produit { cursor: pointer; }
.cq-voir {
  display: inline; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; line-height: inherit;
  letter-spacing: inherit; text-align: inherit; cursor: pointer; text-decoration: underline transparent; text-decoration-thickness: 1px;
  text-underline-offset: .14em; transition: text-decoration-color .2s ease;
}
@media (hover: hover) {
  .cq-produit:hover .cq-voir { text-decoration-color: currentColor; }
}
.cq-voir:focus-visible { outline: 3px solid var(--terre); outline-offset: 3px; border-radius: 6px; }
/* Thé sans photo : la théière dessinée sur fond poudre */
.cq-sans-photo { display: flex; align-items: center; justify-content: center; background: var(--poudre); }
.cq-image.cq-sans-photo img { width: 52%; height: auto; object-fit: contain; }

/* ---------- La fiche ---------- */
html.fiche-ouverte { overflow: hidden; scrollbar-gutter: stable; }
.fiche { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; font-family: var(--sans); color: var(--chocolat); }
.fiche[hidden] { display: none; }
.fiche [hidden] { display: none !important; }
.fiche-voile {
  position: absolute; inset: 0; background: rgba(58, 38, 29, .42); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .25s ease;
}
.fiche.ouverte .fiche-voile { opacity: 1; }
.fiche-fenetre {
  position: relative; display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); grid-template-rows: minmax(0, 1fr) auto;
  width: min(920px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: hidden;
  background: var(--creme); border-radius: 26px; box-shadow: 0 24px 60px rgba(58, 38, 29, .3);
  opacity: 0; transform: translateY(10px) scale(.97); transition: opacity .2s ease, transform .22s var(--ease-net);
}
.fiche.ouverte .fiche-fenetre { opacity: 1; transform: none; }
.fiche-fenetre:focus { outline: none; }
.fiche-corps { display: contents; }
.fiche-photo { grid-row: 1 / -1; grid-column: 1; position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: hidden; background: var(--poudre); }
.fiche-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fiche-photo.fiche-sans-photo { display: flex; align-items: center; justify-content: center; }
.fiche-photo.fiche-sans-photo img { width: 48%; height: auto; object-fit: contain; }
.fiche-infos {
  grid-column: 2; grid-row: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 34px 40px 18px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  scrollbar-width: thin; scrollbar-color: rgba(78, 52, 40, .32) transparent;
}
.fiche-categorie { margin: 0; padding-right: 56px; font-size: 15px; font-weight: 600; color: var(--terre); }
.fiche-nom { margin: 0; padding-right: 40px; font-family: var(--didone); font-weight: 400; font-size: clamp(34px, 3.4vw, 44px); line-height: 1; color: var(--chocolat); overflow-wrap: anywhere; }
.fiche-desc { margin: 4px 0 0; font-size: 17px; line-height: 1.55; color: var(--doux); }
.fiche-choix:empty { display: none; }
.fiche-choix { width: 100%; }
.fiche-retrait { margin: 6px 0 0; padding-left: 26px; position: relative; font-size: 15px; line-height: 1.45; color: var(--doux); }
.fiche-retrait::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; background: var(--terre);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21Z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21Z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.fiche-vers-panier {
  margin: 2px 0 0; padding: 0; border: 0; background: none; color: var(--chocolat); font: 600 15px/1.4 var(--sans); cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em;
}
.fiche-vers-panier:hover { color: var(--terre); }
.fiche-pied {
  grid-column: 2; grid-row: 2; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 18px 40px 30px; border-top: 1px solid var(--trait);
}
.fiche-montant { flex: 1 1 auto; min-width: 0; }
/* « les 100 g » passe à la ligne plutôt que sous le bouton quand la place manque */
.fiche-prix { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--chocolat); }
.fiche-prix span { font-size: 15px; font-weight: 400; color: var(--doux); white-space: nowrap; }
.fiche-prix .cq-avant { font-size: 16px; font-weight: 400; color: var(--doux); }
.fiche-offre .cq-offre { margin: 4px 0 0; }
.fiche-offre:empty { display: none; }
.fiche-ajouter {
  flex: none; height: 52px; padding: 0 26px; border: 0; border-radius: 999px; background: var(--chocolat); color: var(--creme);
  font: 600 16px/1 var(--sans); cursor: pointer; transition: background-color .2s ease;
}
.fiche-ajouter:hover { background: #3E2920; }
.fiche-ajouter.ajoute { background: var(--terre); }
.fiche-ajouter:disabled { background: var(--trait); color: var(--doux); cursor: default; }
.fiche-fermer {
  position: absolute; top: 18px; right: 18px; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  border-radius: 50%; border: 1.5px solid var(--chocolat); background: var(--blanc); color: var(--chocolat); cursor: pointer;
}
.fiche-fermer:focus-visible, .fiche-ajouter:focus-visible, .fiche-vers-panier:focus-visible { outline: 3px solid var(--terre); outline-offset: 3px; }

/* Tablette : colonne de texte plus serrée */
@media (min-width: 761px) and (max-width: 1000px) {
  .fiche-fenetre { grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); }
  .fiche-infos { padding: 30px 28px 16px; }
  .fiche-pied { gap: 14px; padding: 16px 28px 24px; }
}

/* ---------- Téléphone : feuille qui monte du bas ---------- */
@media (max-width: 760px) {
  .fiche { display: block; padding: 0; }
  .fiche-voile { transition: opacity .45s ease; }
  .fiche-fenetre {
    position: absolute; left: 0; right: 0; bottom: 0; width: auto; display: flex; flex-direction: column;
    max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); border-radius: 30px 30px 0 0;
    box-shadow: 0 -10px 40px rgba(58, 38, 29, .2); opacity: 1; transform: translateY(104%); transition: transform .65s var(--o, cubic-bezier(.22, 1, .36, 1));
  }
  .fiche.ouverte .fiche-fenetre { transform: none; }
  .fiche-fenetre::before { content: ""; flex: none; display: block; width: 42px; height: 5px; margin: 10px auto 10px; border-radius: 5px; background: #D9C6B6; }
  .fiche-corps { display: block; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 6px; }
  .fiche-photo { aspect-ratio: 4 / 5; max-height: none; border-radius: 22px; }
  .fiche-infos { overflow: visible; padding: 18px 4px 10px; gap: 10px; }
  .fiche-categorie { padding-right: 0; font-size: 14px; }
  .fiche-nom { padding-right: 0; font-size: 32px; }
  .fiche-desc { margin-top: 2px; font-size: 16px; }
  .fiche-retrait { font-size: 15px; }
  .fiche-pied { flex: none; gap: 14px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); background: var(--creme); }
  .fiche-prix { font-size: 20px; }
  .fiche-prix span { font-size: 14px; }
  .fiche-ajouter { height: 52px; padding: 0 22px; }
  .fiche-fermer { top: 36px; right: 28px; border: 0; background: rgba(255, 255, 255, .94); box-shadow: 0 4px 14px rgba(58, 38, 29, .18); }
  .cq-image.cq-sans-photo img { width: 70%; }
}
@media (max-width: 359px) {
  .fiche-pied { gap: 10px; }
  .fiche-ajouter { padding: 0 16px; font-size: 15px; }
  .fiche-prix { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .fiche-voile, .fiche-fenetre, .cq-voir, .fiche-ajouter { transition: none; }
}
