/* Page paniers — section autonome, indépendante du reste du thème. */
.tel-paniers { max-width: 960px; margin: 0 auto; padding: 1rem; font-size: 1rem; }
.tel-paniers h1 { font-size: 2rem; margin-bottom: .25rem; }
.tel-sub { color: #666; margin-bottom: 1rem; }

.tel-steps { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 1rem 0 2rem; flex-wrap: wrap; }
.tel-steps li { padding: .35rem .9rem; border-radius: 999px; background: #eee; color: #777; font-size: .85rem; }
.tel-steps li.active { background: #4a7c2f; color: #fff; }

.tel-section { margin-bottom: 2.5rem; }
.tel-section h2 { font-size: 1.35rem; border-bottom: 2px solid #4a7c2f; padding-bottom: .35rem; margin-bottom: 1rem; }

.tel-alert { padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.tel-alert-error { background: #fde8e8; color: #9b1c1c; }
.tel-alert-success { background: #e6f4e6; color: #246324; }

.tel-paniers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.tel-panier-card { border: 1px solid #ddd; border-radius: 10px; padding: 1rem; background: #fff; display: flex; flex-direction: column; }
.tel-panier-card h3 { margin: 0 0 .25rem; }
.tel-panier-card .tel-price { font-size: 1.4rem; font-weight: 700; color: #4a7c2f; margin: 0 0 .5rem; }
.tel-panier-card ul { list-style: none; padding: 0; margin: 0 0 1rem; flex: 1; }
.tel-panier-card li { padding: .2rem 0; border-bottom: 1px dashed #eee; }
.tel-panier-card small { color: #888; }

.tel-composition-list { list-style: none; padding: 0; }
.tel-composition-list li { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; border-bottom: 1px dashed #eee; }
.tel-supplement-line { font-weight: 700; color: #b45309; }
.tel-hint { color: #666; font-size: .9rem; }

.tel-modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.tel-modal[hidden] { display: none; }
.tel-modal-content { background: #fff; border-radius: 10px; padding: 1.5rem; max-width: 560px; width: 92%; max-height: 80vh; overflow: auto; position: relative; }
.tel-modal-close { position: absolute; top: .5rem; right: .75rem; border: 0; background: none; font-size: 1.5rem; cursor: pointer; }
.tel-subst-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .5rem; margin-top: 1rem; }
.tel-subst-choice { border: 1px solid #ddd; border-radius: 8px; padding: .6rem; background: #fafafa; cursor: pointer; text-align: left; }
.tel-subst-choice:hover { border-color: #4a7c2f; background: #f0f7ec; }
.tel-supplement-warning { background: #fef3c7; color: #92400e; padding: .75rem; border-radius: 6px; }

.tel-supplement-cat { border: 1px solid #ddd; border-radius: 8px; margin-bottom: .5rem; padding: .5rem .75rem; background: #fff; }
.tel-supplement-cat summary { cursor: pointer; font-weight: 600; }
.tel-badge { background: #fef3c7; color: #92400e; border-radius: 999px; padding: .1rem .6rem; font-size: .75rem; }
.tel-supplement-grid { margin-top: .75rem; }
.tel-supplement-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .35rem 0; border-bottom: 1px dashed #eee; }
.tel-qty-controls { display: flex; align-items: center; gap: .5rem; }
.tel-qty-controls button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #4a7c2f; background: #fff; color: #4a7c2f; cursor: pointer; font-size: 1rem; line-height: 1; }
.tel-qty-controls button:hover { background: #4a7c2f; color: #fff; }

.tel-modes { display: grid; gap: .5rem; }
.tel-mode { display: flex; gap: .75rem; align-items: flex-start; border: 1px solid #ddd; border-radius: 8px; padding: .75rem; background: #fff; cursor: pointer; }
.tel-mode:has(input:checked) { border-color: #4a7c2f; background: #f0f7ec; }

.tel-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
/* display:block/grid ci-dessus l'emporte sur la règle [hidden] du navigateur. */
#tel-form-coordonnees label[hidden], .tel-grid-2[hidden] { display: none; }
#tel-form-identification label, #tel-form-connexion label,
#tel-form-coordonnees label { display: block; margin-bottom: .75rem; font-weight: 600; }
#tel-form-identification input, #tel-form-connexion input,
#tel-form-coordonnees input, #tel-form-coordonnees textarea { width: 100%; padding: .5rem .65rem; border: 1px solid #ccc; border-radius: 6px; font-weight: 400; }
/* Les trois écrans de l'étape 4 s'alternent : [hidden] doit rester décisif. */
#tel-section-coordonnees form[hidden] { display: none; }
.tel-connexion-intro { background: #f6f6f6; border-radius: 6px; padding: .65rem .8rem; margin-bottom: .9rem; }
.tel-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tel-checkbox { font-weight: 400 !important; display: flex !important; gap: .5rem; align-items: flex-start; }
.tel-checkbox input { width: auto !important; margin-top: .25rem; }

.tel-recap-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.tel-recap-table td { padding: .4rem 0; border-bottom: 1px dashed #eee; }
.tel-recap-table td:last-child { text-align: right; }
.tel-total td { font-weight: 700; font-size: 1.1rem; border-top: 2px solid #4a7c2f; }

.tel-paiement-choix { display: flex; gap: .75rem; margin-bottom: 1rem; }
#tel-paiement-iframe { width: 100%; min-height: 480px; border: 1px solid #ddd; border-radius: 10px; background: #fff; }
.tel-paiement-embarque { padding: 1rem; }
.tel-paiement-option { border: 1px solid #ddd; border-radius: 8px; padding: 1rem; margin-bottom: .75rem; background: #fff; }
.tel-paiement-total { font-size: 1.1rem; }
.tel-confirmation { background: #e6f4e6; border-radius: 10px; padding: 1.5rem; text-align: center; }

@media (max-width: 600px) {
  .tel-grid-2 { grid-template-columns: 1fr; }
  .tel-steps { font-size: .75rem; }
}

/* --- v1.2.0 : photos, tableaux, remises, mises en évidence --- */
.tel-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; flex: none; vertical-align: middle; margin-right: .4rem; background: #f3f3f3; }
.tel-thumb-vide { display: inline-block; }
.tel-panier-card ul li { display: flex; align-items: center; gap: .35rem; margin-bottom: .25rem; }

.tel-table { width: 100%; border-collapse: collapse; }
.tel-table th { text-align: left; font-size: .8rem; color: #666; padding: .35rem .4rem; border-bottom: 2px solid #4a7c2f; }
.tel-table td { padding: .45rem .4rem; border-bottom: 1px dashed #eee; vertical-align: middle; }

.tel-ligne-remise { background: #fffbea; }
.tel-ligne-remise td { border-bottom-color: #f5e5b8; }
.tel-badge-remise { background: #d97706; color: #fff; }
.tel-badge-suppl { background: #fef3c7; color: #92400e; }

.tel-line-modified { background: #e8f5e0; border-radius: 6px; }
.tel-badge-modif { background: #4a7c2f; color: #fff; }

.tel-modal-petite { max-width: 420px; }

/* Options de paiement (iframe ps_checkout) au markup canonique du checkout */
.tel-paiement-options .payment-option { border: 1px solid #ddd; border-radius: 8px; padding: .75rem 1rem; margin-bottom: .5rem; background: #fff; }
#payment-confirmation { margin-top: 1rem; }

/* --- retours de recette du 05/08 --- */
.tel-qty-badge { display: inline-block; background: #4a7c2f; color: #fff; border-radius: 10px; padding: 0 .5em; font-size: .8rem; margin-left: .3rem; white-space: nowrap; }
.tel-prod-infos { display: flex; flex-direction: column; }
.tel-prod-origine { color: #777; }

.tel-subst-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.tel-tuile { border: 1px solid #e2e2e2; border-radius: 10px; padding: .6rem; text-align: center; background: #fff; display: flex; flex-direction: column; gap: .25rem; }
.tel-tuile .tel-thumb { width: 64px; height: 64px; margin: 0 auto; }
.tel-tuile-nom { font-weight: 600; margin: 0; }
.tel-tuile-prix { margin: 0; color: #4a7c2f; }
.tel-tuile-recoit { margin: 0; font-size: .85rem; }
.tel-tuile button { margin-top: auto; }
.tel-tuile p { margin: 0; }

.tel-opt-autre { font-weight: 700; }

/* Iframe paiement : seul le formulaire de l'option sélectionnée est visible
   (rôle tenu par checkout.js du thème sur la vraie page commande). */
.tel-paiement-embarque .js-payment-option-form,
.tel-paiement-embarque [id$="-additional-information"] { display: none; }
.tel-paiement-embarque .tel-option-visible { display: block; }

/* --- retours de recette du 05/08 (2e passe) --- */
/* La grille de tuiles remplit toute la largeur de la modale (l'ancien
   display:grid du conteneur la coinçait dans une seule colonne). */
.tel-subst-choices { display: block; }
.tel-subst-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
@media (max-width: 480px) {
  .tel-subst-tuiles { grid-template-columns: repeat(2, 1fr); }
}

/* Modale : entête collante (titre + croix toujours visibles au scroll) */
.tel-modal-entete { position: sticky; top: 0; z-index: 5; background: #fff; display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; padding-bottom: .3rem; }
.tel-modal-entete h3 { margin: 0; }
.tel-modal-entete .tel-modal-close { position: static; }
.tel-modal-pied { text-align: center; margin: .8rem 0 0; }

/* Suppléments : favoris en tuiles, remises distinguées */
.tel-supplement-favoris h4 { margin: .6rem 0 .4rem; }
.tel-tuile-remise { background: #fffbea; border-color: #f5e5b8; }
.tel-tuile .tel-qty-controls { justify-content: center; margin-top: auto; }

/* Total panier permanent, en bas à GAUCHE (le bouton "remonter" est à droite) */
#tel-total-bar { position: fixed; left: 12px; bottom: 12px; z-index: 900; background: #4a7c2f; color: #fff; padding: .5rem .9rem; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.25); font-size: .95rem; }

/* --- retours de recette du 05/08 (3e passe) --- */
/* Modale : jamais plus large que l'écran (2e colonne rognée sur mobile) */
.tel-modal-content { width: min(560px, 94vw); max-width: 94vw; box-sizing: border-box; }
/* Tuiles un peu plus étroites ; 2 colonnes garanties sur mobile, 1 seule
   colonne si l'écran est vraiment trop petit */
.tel-subst-tuiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
@media (max-width: 480px) {
  .tel-subst-tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 300px) {
  .tel-subst-tuiles { grid-template-columns: 1fr; }
}

/* Produits déjà dans le panier : fond légèrement coloré pour les repérer */
.tel-tuile-deja { background: #eef6e9; border-color: #cfe3c2; }

/* Boutons + / − : taille fixe non déformable (identique partout) */
.tel-qty-controls button {
  flex: 0 0 auto; width: 32px; height: 32px; padding: 0;
  border-radius: 50%; line-height: 1; display: inline-flex;
  align-items: center; justify-content: center;
}
.tel-qty-controls b { white-space: nowrap; }

/* Multi-paniers : titre de chaque panier dans la composition */
.tel-panier-titre { background: #f4f8f1; border-radius: 4px; padding: .35rem .6rem; margin-top: .6rem; list-style: none; }
.tel-nb-paniers { display: inline-flex; align-items: center; gap: .4rem; margin-right: .6rem; }
.tel-nb-paniers select { width: auto; padding: .2rem .4rem; }
.tel-panier-choix { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }

/* Étapes verrouillées après l'enregistrement des coordonnées */
.tel-locked { opacity: .55; pointer-events: none; user-select: none; }
.tel-lock-banner { position: sticky; top: 0; z-index: 950; background: #fff7e0; border: 1px solid #eadfae; border-radius: 6px; padding: .5rem .8rem; margin: .8rem 0; }

/* Sections binaires ps_checkout : masquées sauf pour l'option choisie */
.tel-paiement-embarque .js-payment-binary { display: none; }
.tel-paiement-embarque .js-payment-binary.tel-option-visible { display: block; }

/* --- retours de recette du 05/08 (4e passe) --- */
/* Mélange de catégories : badge « dans votre commande » sur les cartes */
.tel-panier-dans-commande { margin: .4rem 0 0; color: #2e7d32; font-weight: 600; }
.tel-panier-retirer { color: #b23; padding: 0 .3rem; }

/* Mention « stock maximum atteint » sur les tuiles de suppléments */
.tel-stock-max { display: block; color: #b23; margin-top: .25rem; }
.tel-qty-controls button:disabled { opacity: .4; cursor: not-allowed; }

/* Lignes d'échange (substitutions) dans le récapitulatif : détail au centime. */
.tel-recap-table .tel-recap-sub td {
  padding-left: 1.25rem;
  font-size: 0.9em;
  color: #556;
  font-style: italic;
}
