/* Variables partagées avec le site vitrine (une seule palette pour les deux) */
@import url("../css/variables.css");

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--farine);
  color: var(--encre);
  font-family: var(--police-corps);
  line-height: 1.5;
}

/* ---------- En-tête ---------- */

.entete {
  background: var(--encre);
  color: var(--farine);
  padding: 3rem 1.5rem 3.5rem;
  position: relative;
}

.entete::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 10px;
  background: repeating-linear-gradient(
    -45deg, var(--or-ble) 0 10px, transparent 10px 20px
  );
  opacity: 0.85;
}

.entete-inner { max-width: 980px; margin: 0 auto; }

.entete-eyebrow {
  font-family: var(--police-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--or-ble);
}

.entete h1 {
  font-family: var(--police-titre);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  margin: 0.3rem 0 0.6rem;
}

.entete-sous-titre {
  margin: 0;
  max-width: 42ch;
  color: var(--panneau);
  font-size: 1.02rem;
}

/* ---------- Mise en page générale ---------- */

.mise-en-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

.alerte {
  grid-column: 1 / -1;
  background: var(--panneau);
  border: 1px solid var(--encre);
  color: var(--encre);
  padding: 1rem 1.2rem;
  border-radius: 6px;
}

/* ---------- Blocs de formulaire ---------- */

.bloc {
  background: white;
  border: 1px solid var(--ligne);
  border-radius: 10px;
  padding: 1.6rem;
  margin-bottom: 1.6rem;
  box-shadow: var(--ombre);
}

.bloc-titre {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--ligne);
  padding-bottom: 0.8rem;
}

.bloc-numero {
  font-family: var(--police-mono);
  color: var(--or-ble);
  font-size: 0.9rem;
}

.bloc-titre h2 {
  font-family: var(--police-titre);
  font-weight: 600;
  font-size: 1.4rem;
  margin: 0;
}

/* ---------- Produits ---------- */

.categorie { margin-bottom: 1.4rem; }
.categorie:last-child { margin-bottom: 0; }

.categorie-titre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--police-mono);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--vert-sauge);
  margin: 0 0 0.6rem;
  padding: 0.2rem 0 0.6rem;
  border-bottom: 1px solid var(--ligne);
}
.categorie-titre::-webkit-details-marker { display: none; }
.categorie-titre::marker { content: ''; }

.categorie-titre::after {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--vert-sauge);
  border-bottom: 2px solid var(--vert-sauge);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-bottom: 2px;
}
.categorie:not([open]) .categorie-titre::after {
  transform: rotate(-45deg);
  margin-bottom: -2px;
}
.categorie:not([open]) .categorie-titre { border-bottom-color: transparent; margin-bottom: 0.3rem; }

.liste-produits { display: flex; flex-direction: column; gap: 0.55rem; }

.produit {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--ligne);
  border-radius: 8px;
  background: var(--panneau);
  transition: border-color 0.15s ease;
  flex-wrap: wrap;
}

.produit-info { flex: 1 1 260px; }

.produit-controle {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

.produit-tranche {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #6B5F52;
  cursor: pointer;
  white-space: nowrap;
}
.produit-tranche input { cursor: pointer; }

.produit:has(.stepper-valeur:not([value="0"])) {
  border-color: var(--or-ble);
}

.produit-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.produit-nom { font-weight: 600; }
.produit-description {
  font-size: 0.82rem;
  color: #6B5F52;
}

.produit-ingredients {
  font-size: 0.76rem;
  color: #7A6D5C;
  margin: 0.3rem 0 0;
  line-height: 1.45;
}

.produit-ingredients-label {
  font-family: var(--police-mono);
  text-transform: uppercase;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: #9A8C77;
  margin-right: 0.3em;
}

mark.allergene {
  background: var(--or-clair);
  color: var(--encre);
  font-weight: 600;
  padding: 0.03em 0.28em;
  border-radius: 3px;
}

.allergenes-puces {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.allergenes-icone {
  font-size: 0.8rem;
  color: var(--oxblood);
}

.allergene-puce {
  font-family: var(--police-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--or-clair);
  color: var(--encre);
  border: 1px solid var(--or-ble);
  border-radius: 999px;
  padding: 0.15em 0.6em;
}

.produit-controle {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-shrink: 0;
}

.produit-prix {
  font-family: var(--police-mono);
  font-size: 0.9rem;
  min-width: 4.2em;
  text-align: right;
}

.stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--encre);
  border-radius: 6px;
  overflow: hidden;
}

.stepper-btn {
  background: var(--encre);
  color: var(--farine);
  border: none;
  width: 28px;
  height: 30px;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}
.stepper-btn:hover { background: var(--oxblood); }

.stepper-valeur {
  width: 2.6em;
  text-align: center;
  border: none;
  font-family: var(--police-mono);
  font-size: 0.95rem;
  -moz-appearance: textfield;
}
.stepper-valeur::-webkit-outer-spin-button,
.stepper-valeur::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.stepper-suffixe {
  font-family: var(--police-mono);
  font-size: 0.75rem;
  color: var(--farine);
  background: var(--encre);
  padding: 0 0.4em 0 0;
  align-self: stretch;
  display: flex;
  align-items: center;
}

/* ---------- Points de retrait ---------- */

.sous-section-titre {
  font-family: var(--police-mono);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--vert-sauge);
  margin: 1.2rem 0 0.6rem;
}
.sous-section-titre:first-of-type { margin-top: 0; }

.points-retrait {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}

.champ-aide {
  font-size: 0.78rem;
  color: var(--vert-sauge);
  margin: 0.4rem 0 0;
}

/* ---------- Date de retrait (prochaine date affichée, ou menu déroulant) ---------- */

.point-prochaine-date {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--police-mono);
  font-size: 0.78rem;
  color: var(--oxblood);
}

.point-date-choix {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.point-date-select {
  font-family: var(--police-corps);
  font-size: 0.88rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--ligne);
  border-radius: 6px;
  background: white;
  color: var(--encre);
  cursor: pointer;
}
.point-date-select:focus { outline: none; border-color: var(--oxblood); }

.point-carte {
  position: relative;
  display: block;
  border: 1px solid var(--ligne);
  border-radius: 8px;
  padding: 0.85rem 0.9rem;
  cursor: pointer;
  background: var(--panneau);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.point-carte input { position: absolute; opacity: 0; }

.point-carte:has(input:checked) {
  border-color: var(--oxblood);
  background: var(--or-clair);
}

.point-carte:has(input:focus-visible) {
  outline: 2px solid var(--oxblood-clair);
  outline-offset: 2px;
}

.point-contenu { display: flex; flex-direction: column; gap: 0.2rem; }
.point-nom { font-weight: 600; }
.point-adresse, .point-horaires { font-size: 0.8rem; color: #6B5F52; }
.point-horaires { font-family: var(--police-mono); font-size: 0.75rem; color: var(--vert-sauge); }

.lien-maps {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.4em;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--oxblood);
  vertical-align: middle;
  transition: background 0.15s ease, color 0.15s ease;
}
.lien-maps:hover { background: var(--or-clair); color: var(--encre); }

.point-dates-detail {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0.4rem 0 0;
  border-top: 1px dashed var(--ligne);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.point-dates-detail li {
  font-family: var(--police-mono);
  font-size: 0.72rem;
  color: #6B5F52;
}
.point-dates-plus { font-style: italic; color: var(--vert-sauge) !important; }

/* ---------- Coordonnées ---------- */

.champs-contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.champ-large { grid-column: 1 / -1; }

.champ { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; font-weight: 500; }

.champ input {
  font-family: var(--police-corps);
  font-size: 0.95rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--ligne);
  border-radius: 6px;
  background: var(--panneau);
}
.champ input:focus {
  outline: none;
  border-color: var(--oxblood);
  background: white;
}

/* ---------- Ticket récapitulatif ---------- */

.ticket { position: sticky; top: 1.5rem; }

.ticket-papier {
  background: white;
  border: 1px solid var(--ligne);
  border-radius: 4px;
  padding: 1.4rem 1.3rem;
  font-family: var(--police-mono);
  box-shadow: var(--ombre);
  position: relative;
}

.ticket-papier::before,
.ticket-papier::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 10px;
  background:
    radial-gradient(circle 5px, transparent 5px, white 5.5px) 0 0 / 20px 20px;
}
.ticket-papier::before { top: -9px; }
.ticket-papier::after { bottom: -9px; transform: rotate(180deg); }

.ticket-entete { margin-bottom: 1rem; text-align: center; }
.ticket-titre {
  display: block;
  font-family: var(--police-titre);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ticket-sous {
  display: block;
  font-size: 0.68rem;
  color: #8A7D6B;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.15rem;
}

.ticket-lignes { display: flex; flex-direction: column; gap: 0.4rem; min-height: 1.6rem; }

.ticket-vide { font-size: 0.78rem; color: #8A7D6B; margin: 0; text-align: center; }

.ticket-ligne-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  gap: 0.5rem;
}
.ticket-ligne-item .nom { color: var(--encre); }
.ticket-ligne-item .montant { color: #6B5F52; white-space: nowrap; }

.ticket-separateur {
  border-top: 1px dashed var(--ligne);
  margin: 0.85rem 0;
}

.ticket-ligne { display: flex; justify-content: space-between; font-size: 0.85rem; }
.ticket-total {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--oxblood);
}

.ticket-prix-indicatif {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--encre);
  background: var(--or-clair);
  border: 1px solid var(--or-ble);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  margin: 0.6rem 0;
}
.ticket-prix-indicatif::before {
  content: '⚠';
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}
.ticket-prix-indicatif strong { display: block; margin-bottom: 0.15rem; }

.case-confirmation-prix {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--encre);
  cursor: pointer;
  margin: 0.8rem 0;
}
.case-confirmation-prix input {
  margin-top: 0.15rem;
  flex-shrink: 0;
  cursor: pointer;
}

.ticket-retrait {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-family: var(--police-corps);
}
.ticket-retrait-label {
  font-family: var(--police-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8A7D6B;
}
.ticket-retrait-valeur { font-size: 0.85rem; font-weight: 600; }

.btn-valider {
  width: 100%;
  margin-top: 1.2rem;
  padding: 0.8rem;
  background: var(--oxblood);
  color: white;
  border: none;
  border-radius: 6px;
  font-family: var(--police-corps);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-valider:hover:not(:disabled) { background: var(--oxblood-clair); }
.btn-valider:active:not(:disabled) { transform: scale(0.98); }
.btn-valider:disabled {
  background: #D8CFC0;
  color: #8A7D6B;
  cursor: not-allowed;
}

.ticket-note {
  font-family: var(--police-corps);
  font-size: 0.72rem;
  color: #8A7D6B;
  text-align: center;
  margin: 0.6rem 0 0;
}

/* ---------- Pied de page ---------- */

.pied {
  text-align: center;
  font-size: 0.78rem;
  color: #8A7D6B;
  padding: 0 1.5rem 3rem;
}
.pied code {
  background: var(--panneau);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

/* ---------- Responsive ---------- */

@media (max-width: 800px) {
  .mise-en-page { grid-template-columns: 1fr; }
  .ticket { position: static; }
  .champs-contact { grid-template-columns: 1fr; }
}

/* ---------- Choix particulier / entreprise ---------- */

.type-client-choix {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.type-client-option {
  position: relative;
  cursor: pointer;
}
.type-client-option input { position: absolute; opacity: 0; }
.type-client-option span {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--ligne);
  border-radius: 999px;
  font-size: 0.88rem;
  background: white;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.type-client-option input:checked + span {
  border-color: var(--oxblood);
  background: var(--or-clair);
  font-weight: 600;
}
.type-client-option input:focus-visible + span {
  outline: 2px solid var(--oxblood-clair);
  outline-offset: 2px;
}

.champs-entreprise {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--ligne);
}
/* .champs-contact impose display:grid, ce qui l'emporte sinon sur le
   masquage par défaut de l'attribut HTML "hidden" (règle de spécificité
   plus faible, venant de la feuille de style du navigateur). */
.champs-entreprise[hidden] {
  display: none;
}

/* ---------- Récapitulatif TVA sur le ticket (entreprise) ---------- */

.ticket-recap-tva {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-family: var(--police-corps);
  font-size: 0.8rem;
  color: #6B5F52;
}
.ticket-recap-tva .ticket-ligne { font-size: 0.8rem; }

/* ---------- Assistant à étapes (reservez.php) ---------- */

.wizard-entete {
  max-width: 980px;
  margin: 0 auto 0.6rem;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.wizard-etapes {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wizard-etape {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--ligne);
  font-size: 0.85rem;
  color: #8A7D6B;
  cursor: default;
}
.wizard-etape.complete { cursor: pointer; color: var(--encre); border-color: var(--or-ble); }
.wizard-etape.complete:hover { border-color: var(--oxblood); }
.wizard-etape.actif { background: var(--encre); color: var(--farine); border-color: var(--encre); }

.wizard-etape-numero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--or-clair);
  color: var(--encre);
  font-family: var(--police-mono);
  font-size: 0.72rem;
  font-weight: 700;
}
.wizard-etape.actif .wizard-etape-numero { background: var(--oxblood); color: white; }
.wizard-etape.complete .wizard-etape-numero { background: var(--or-ble); color: white; }

.wizard-navigation {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
/* .bouton impose display:inline-block, ce qui l'emporte sinon sur le
   masquage par défaut de l'attribut HTML "hidden" (règle de spécificité
   plus faible, venant de la feuille de style du navigateur). */
.wizard-navigation [hidden] {
  display: none;
}

.wizard-navigation-note {
  font-size: 0.82rem;
  color: var(--vert-sauge);
  font-style: italic;
}

@media (max-width: 700px) {
  .wizard-entete { flex-direction: column; align-items: stretch; }
  .wizard-etapes { gap: 0.35rem; }
  .wizard-etape { padding: 0.4rem 0.7rem; font-size: 0.78rem; }
  .wizard-navigation { flex-direction: column; align-items: stretch; }
  .wizard-navigation .bouton { width: 100%; text-align: center; }
}

/* ---------- Tri des points de retrait par distance ---------- */

.champ-code-postal {
  max-width: 240px;
  margin-bottom: 0.8rem;
}
.champ-code-postal input {
  font-family: var(--police-corps);
  font-size: 0.95rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--ligne);
  border-radius: 6px;
  background: var(--panneau);
}
.champ-code-postal input:focus {
  outline: none;
  border-color: var(--oxblood);
  background: white;
}

.point-distance {
  font-family: var(--police-mono);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--oxblood);
}
