/* =========================================================
   Simple et Sweet – boutique en ligne
   S'ajoute à style.css (mêmes couleurs et polices).
   ========================================================= */

/* ---------- Bandeau ---------- */

.boutique-entete {
  background: var(--violet-fonce);
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  padding-top: clamp(2.5rem, 6vw, 4rem);
}
.boutique-entete h1 { color: var(--blanc); font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 300; margin-bottom: 0.4em; }
.boutique-entete .script { color: var(--or); font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 auto; }
.boutique-entete p { max-width: 40rem; margin-inline: auto; }
.boutique-note { font-size: 0.95rem; color: rgba(255, 255, 255, 0.75); }
.boutique-entete .pointilles { margin: 2rem 0 0; padding-bottom: 1.5rem; }

#message-boutique { margin-top: 2rem; }
.boutique { padding-top: clamp(2rem, 5vw, 3rem); }
.chargement { grid-column: 1 / -1; text-align: center; color: var(--texte-doux); }

/* ---------- Catégories et produits ---------- */

.filtres { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-bottom: 2.5rem; }
.filtre {
  padding: 0.55rem 1.2rem;
  border: 1px solid rgba(211, 130, 168, 0.5);
  border-radius: 999px;
  background: var(--blanc);
  color: var(--violet-fonce);
  font-family: var(--police-titre);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.filtre:hover { border-color: var(--violet); }
.filtre[aria-pressed="true"] { background: var(--violet-fonce); border-color: var(--violet-fonce); color: var(--blanc); }

.grille-produits { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.5rem; }
@media (max-width: 560px) {
  .grille-produits { grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
}

.produit-ouvrir {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%; height: 100%;
  padding: 0 0 1rem;
  border: 0;
  border-radius: var(--rayon);
  background: var(--blanc);
  box-shadow: 0 6px 18px rgba(74, 52, 89, 0.08);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}
.produit-ouvrir:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(74, 52, 89, 0.16); }
.produit-photo { display: block; aspect-ratio: 1; overflow: hidden; background: var(--lilas-pale); }
.produit-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.produit-photo img.sans-photo { object-fit: contain; padding: 18%; opacity: 0.5; }
.produit-ouvrir:hover .produit-photo img { transform: scale(1.05); }
.produit-nom { display: block; padding: 0.9rem 1rem 0.2rem; font-family: var(--police-titre); font-size: 1.1rem; line-height: 1.25; color: var(--violet-fonce); }
.produit-prix { display: block; padding: 0 1rem; color: var(--or-fonce); font-size: 0.95rem; font-weight: 700; }
.produit-epuise { position: absolute; top: 0.75rem; left: 0.75rem; padding: 0.25rem 0.7rem; border-radius: 999px; background: var(--violet-fonce); color: var(--blanc); font-size: 0.8rem; font-weight: 700; }
@media (max-width: 560px) {
  .produit-nom { padding-inline: 0.75rem; font-size: 0.98rem; }
  .produit-prix { padding-inline: 0.75rem; font-size: 0.88rem; }
}

/* ---------- Fenêtres (fiche produit et panier) ---------- */

.fiche, .panier { border: 0; padding: 0; background: var(--blanc); color: var(--texte); }
.fiche::backdrop, .panier::backdrop { background: rgba(40, 26, 50, 0.55); }

.fermer {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  z-index: 2;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--lilas-pale);
  color: var(--violet-fonce);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}
.fermer:hover { background: var(--rose-pale); }

.fiche {
  width: min(1000px, 100vw - 2rem);
  max-height: min(92vh, 900px);
  border-radius: var(--rayon);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}
.fiche-interieur {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  max-height: min(92vh, 900px);
  overflow-y: auto;
}
.fiche-photos { padding: 1.5rem; background: var(--lilas-pale); }
.fiche-photo { position: sticky; top: 1.5rem; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; }
.fiche-vignettes { position: relative; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.fiche-vignettes button { width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 10px; background: none; overflow: hidden; cursor: pointer; }
.fiche-vignettes button:hover, .fiche-vignettes button:focus-visible { border-color: var(--violet); }
.fiche-vignettes img { width: 100%; height: 100%; object-fit: cover; }

.fiche-details { padding: 2rem 2rem 1.5rem; }
.fiche-details h2 { margin-bottom: 0.3rem; padding-right: 2.5rem; font-size: clamp(1.6rem, 3vw, 2.1rem); }
.fiche-prix { color: var(--or-fonce); font-size: 1.3rem; font-weight: 700; }
.fiche-description { color: var(--texte-doux); font-size: 0.98rem; }
.fiche-delai { padding-left: 0.75rem; border-left: 3px solid var(--rose); color: var(--texte-doux); font-size: 0.9rem; }
.fiche-choix { display: flex; flex-direction: column; gap: 1.25rem; margin: 1.5rem 0; }
.fiche-choix select, .fiche-choix textarea { width: 100%; }

fieldset.liste, .commande-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset.liste legend, .commande-form legend { margin-bottom: 0.5rem; padding: 0; color: var(--violet-fonce); font-weight: 700; }
fieldset.liste legend small { color: var(--texte-doux); font-weight: 400; }
.options { display: flex; flex-direction: column; gap: 0.15rem; }
.choix { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.3rem 0; cursor: pointer; }
.choix input { flex-shrink: 0; accent-color: var(--violet); transform: translateY(2px); }
.choix small { color: var(--or-fonce); font-weight: 700; white-space: nowrap; }
.choix:has(input:disabled) { opacity: 0.45; cursor: default; }

.fiche :is(select, textarea), .commande-form :is(select, input, textarea) {
  padding: 0.7rem 0.85rem;
  border: 1.5px solid #e2d8e8;
  border-radius: 10px;
  background: var(--creme);
  color: var(--texte);
  font: inherit;
  font-size: 1rem;
}
.fiche :is(select, textarea):focus, .commande-form :is(select, input, textarea):focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(133, 80, 159, 0.15);
}

.fiche-ajout {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 0.75rem;
  margin: 0 -2rem -1.5rem;
  padding: 1rem 2rem 1.5rem;
  background: linear-gradient(transparent, var(--blanc) 25%);
}
.fiche-ajout .bouton { flex: 1; }

.quantite { display: inline-flex; align-items: center; border: 1.5px solid #e2d8e8; border-radius: 999px; background: var(--blanc); }
.quantite button { width: 42px; height: 46px; border: 0; background: none; color: var(--violet-fonce); font-size: 1.3rem; cursor: pointer; }
.quantite input { width: 2.6rem; border: 0; background: none; font: inherit; font-weight: 700; text-align: center; -moz-appearance: textfield; }
.quantite input::-webkit-inner-spin-button, .quantite input::-webkit-outer-spin-button { -webkit-appearance: none; }
.quantite.petite button { width: 34px; height: 34px; font-size: 1.1rem; }
.quantite.petite span { min-width: 1.6rem; font-weight: 700; text-align: center; }

.fiche-erreur { margin: 1rem 0 0; padding: 0.75rem 1rem; border-radius: 10px; background: #fde8ec; color: #8a1c3a; font-weight: 600; }

@media (max-width: 760px) {
  .fiche { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .fiche-interieur { grid-template-columns: 1fr; max-height: 100dvh; }
  .fiche-photos { padding: 0; }
  .fiche-photo { position: static; aspect-ratio: 4 / 3; border-radius: 0; }
  .fiche-vignettes { padding: 0 1rem 0.75rem; }
  .fiche-details { padding: 1.5rem 1.25rem 1rem; }
  .fiche-ajout { margin: 0 -1.25rem -1rem; padding: 1rem 1.25rem; }
}

/* ---------- Panier : tiroir à droite ---------- */

.panier {
  width: min(460px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
}
.panier[open] { animation: glisser 0.25s ease; }
@keyframes glisser { from { transform: translateX(40px); opacity: 0; } }

.panier-interieur { position: relative; display: flex; flex-direction: column; height: 100%; }
.panier-entete { padding: 1.25rem 1.5rem; border-bottom: 1px solid #efe7f2; }
.panier-entete h2 { margin: 0; font-size: 1.6rem; }
.panier-entete .fermer { top: 0.9rem; }
.panier-etape { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; }
.panier-etape[hidden] { display: none; }

.panier-lignes { flex: 1; margin: 0; padding: 0.5rem 1.5rem; list-style: none; }
.panier-vide { padding: 2rem 1.5rem; color: var(--texte-doux); text-align: center; }
.panier-ligne { display: grid; grid-template-columns: 64px 1fr auto; gap: 0.9rem; padding: 1rem 0; border-bottom: 1px dashed #e8dfec; }
.panier-ligne img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.panier-ligne-texte { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.panier-ligne-texte strong { color: var(--violet-fonce); line-height: 1.3; }
.panier-ligne-texte span, .panier-ligne-texte small { color: var(--texte-doux); font-size: 0.88rem; }
.panier-ligne-texte .quantite { align-self: flex-start; margin-top: 0.4rem; }
.panier-ligne-prix { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; font-weight: 700; }
.retirer { padding: 0; border: 0; background: none; color: var(--texte-doux); font-size: 0.85rem; text-decoration: underline; cursor: pointer; }
.retirer:hover { color: #8a1c3a; }

.panier-pied { position: sticky; bottom: 0; margin-top: auto; padding: 1.25rem 1.5rem 1.5rem; border-top: 1px solid #efe7f2; background: var(--blanc); }
.panier-pied .bouton { width: 100%; }
.panier-pied .bouton:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.panier-total { display: flex; justify-content: space-between; margin: 0 0 0.25rem; font-size: 1.1rem; }
.panier-taxes { margin: 0.5rem 0 0.9rem; color: var(--texte-doux); font-size: 0.85rem; }

/* ---------- Passage de la commande ---------- */

.commande-form { gap: 1.5rem; padding: 0 1.5rem; }
.commande-form fieldset { display: flex; flex-direction: column; gap: 0.75rem; }
.commande-form .panier-pied { margin-inline: -1.5rem; }
.commande-form .champ { display: flex; flex-direction: column; gap: 0.3rem; }
.commande-form .champ label { font-size: 0.92rem; font-weight: 600; }
.commande-form .fiche-erreur { margin: 0; }
.commande-form .choix.desactive { opacity: 0.5; cursor: default; }
.lien-retour { align-self: flex-start; margin-top: 1rem; padding: 0; border: 0; background: none; color: var(--violet); font: inherit; font-weight: 600; cursor: pointer; }
.aide { margin: 0; color: var(--texte-doux); font-size: 0.9rem; }

/* ---------- Cartes-cadeaux ---------- */

.cartes-cadeaux { background: var(--lilas-pale); padding: clamp(2.5rem, 6vw, 4rem) 0; }
.cartes-cadeaux-interieur { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.cartes-cadeaux .script { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 0; }
.cartes-cadeaux h2 { margin: 0.1em 0 0.3em; }
.cartes-cadeaux p { max-width: 34rem; margin-bottom: 0; }
.cartes-cadeaux .boutons { margin-top: 0; }

/* ---------- Livraison ---------- */

.produit-livrable { display: block; padding: 0.15rem 1rem 0; color: var(--violet); font-size: 0.82rem; font-weight: 600; }
.deux-champs { display: grid; grid-template-columns: 1fr 9rem; gap: 0 0.75rem; }
.livraison-resultat { margin: 0.25rem 0 0; padding: 0.6rem 0.8rem; border-radius: 10px; background: var(--lilas-pale); font-size: 0.9rem; }
.livraison-resultat.succes { background: #e6f4ea; color: #1e5b33; }
.livraison-resultat.erreur { background: #fdecea; color: #8a1f1f; }
.panier-frais { display: flex; justify-content: space-between; margin: 0 0 0.25rem; color: var(--texte-doux); font-size: 0.95rem; }
[data-livraison-etat] { margin-top: 0.4rem; }
/* Les blocs masqués le restent, même quand une règle leur donne un affichage */
.panier [hidden] { display: none !important; }

/* ---------- Recherche ---------- */

.recherche { position: relative; max-width: 32rem; margin: 0 auto 1.25rem; }
.recherche svg { position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%); color: var(--texte-doux); pointer-events: none; }
.recherche input {
  width: 100%;
  padding: 0.8rem 1.2rem 0.8rem 3rem;
  border: 1px solid rgba(211, 130, 168, 0.5);
  border-radius: 999px;
  background: var(--blanc);
  font: inherit;
  color: inherit;
}
.recherche input:focus { outline: 2px solid var(--violet); outline-offset: 2px; border-color: var(--violet); }
