@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

body {
  font-family: 'Poppins', sans-serif;
}

/* =====================
   PANEL LATERAL
   ===================== */

#reservationPanel {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 100vw;
  height: 100%;
  background: #ffffff;
  box-shadow: -2px 0 20px rgba(0,0,0,0.08);
  padding: 1.75rem 1.5rem 2rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  z-index: 9999;
  font-family: 'Poppins', sans-serif;
}

/* Etat ouvert */
#reservationPanel.active {
  transform: translateX(0);
}

/* IMPORTANT : on ne masque pas le panel avec .hidden */
#reservationPanel.hidden {
  display: block;
}

@media (max-width: 768px) {
  #reservationPanel {
    width: 100%;
    padding: 1.5rem 1.25rem 2rem;
  }
}

/* Bouton fermer */
.btn-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: #f3f3f3;
  color: #333;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  background: #e5e5e5;
}

/* =====================
   PROGRESS BAR
   ===================== */

.progress-bar {
  width: 100%;
  height: 6px;
  background: #f3f4f6;
  margin: 0.75rem 0 1.5rem;
  border-radius: 999px;
  overflow: hidden;
}

.progress-indicator {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #E8635E, #f29c89);
  transition: width 0.3s ease;
}

/* =====================
   ETAPES
   ===================== */

.step {
  margin-top: 1rem;
}

/* Gestion de visibilité des étapes */
.step.hidden {
  display: none;
}

/* Titres des étapes */
.step h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* Sous-texte / hints */
.cart-hint {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

/* =====================
   FORMULAIRES
   ===================== */

label {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  display: inline-block;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #E8635E;
  box-shadow: 0 0 0 1px rgba(232, 99, 94, 0.3);
}

select {
  appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg fill='gray' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 12px center;
  background-size: 16px;
}

/* Checkbox offrir / même adresse */
.same-address-block,
.same-address-wrapper {
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.same-address-block label,
.same-address-wrapper label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.9rem;
}

/* =====================
   BOUTONS
   ===================== */

.btn-primary,
.btn-secondary,
.step button,
.btn-reserver {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.15s ease;
}

/* Primaire = CTA */
.btn-primary,
.step .next-step,
#submitPayment {
  background: #E8635E;
  color: #ffffff;
  box-shadow: 0 8px 15px rgba(232, 99, 94, 0.35);
}

.btn-primary:hover,
.step .next-step:hover,
#submitPayment:hover {
  background: #dd4f4a;
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(232, 99, 94, 0.4);
}

/* Secondaire = actions moins importantes */
.btn-secondary,
.step .prev-step,
#emptyCartBtn {
  background: #ffffff;
  color: #374151;
  border: 1px solid #d1d5db;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
}

.btn-secondary:hover,
.step .prev-step:hover,
#emptyCartBtn:hover {
  background: #f9fafb;
  transform: translateY(-1px);
}

/* Navigation en bas de chaque étape */
.navigation-buttons {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap; 
}

.navigation-buttons .btn-primary,
.navigation-buttons .btn-secondary {
  flex: 1 1 45%;
}

/* Sur petits écrans : boutons full width */
@media (max-width: 480px) {
  .navigation-buttons .btn-primary,
  .navigation-buttons .btn-secondary {
    flex: 1 1 100%;
  }
}

/* =====================
   PANIER (Step 3)
   ===================== */

.cart-summary-panel {
  border-radius: 14px;
  background: #f9fafb;
  padding: 1rem 0.9rem;
  border: 1px solid #e5e7eb;
}

.cart-summary-panel h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.cart-empty {
  font-size: 0.9rem;
  color: #6b7280;
}

/* Ligne du panier */
.cart-item-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.4rem;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.cart-item-label {
  font-size: 0.88rem;
  font-weight: 500;
}

.cart-item-qty {
  font-size: 0.85rem;
  color: #6b7280;
}

.cart-item-total {
  font-size: 0.88rem;
  font-weight: 600;
}

/* Bouton remove = icône */
.cart-item-remove {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cart-item-remove:hover {
  background: #fecaca;
}

/* Récap montants */
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.cart-summary-row.cart-total span:last-child {
  font-weight: 600;
  font-size: 1rem;
}

/* =====================
   ADRESSES (Step 4)
   ===================== */

.per-course-addresses {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.course-address-block {
  padding: 0.75rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.course-address-block h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

/* =====================
   PAIEMENT (Step 5)
   ===================== */

.payment-recap,
.payment-resume {
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 0.85rem 0.85rem;
  margin-bottom: 1rem;
}

.payment-recap p,
.payment-resume p {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin: 0.25rem 0;
}

/* Stripe card element */
#card-element {
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  margin-top: 0.5rem;
}

#card-errors {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #b91c1c;
}

/* Loaders */
#recapLoader,
#paymentLoader {
  text-align: center;
  font-size: 0.9rem;
  padding: 12px;
  background-color: #f3f4f6;
  border-radius: 8px;
  margin-top: 0.75rem;
}

/* gestion via classe hidden pour loaders et autres éléments,
   MAIS pas pour le panel car on l’a surchargé plus haut */
.hidden {
  display: none;
}

/* Boutons primary / secondary harmonisés */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background-color: #E8635E;
  color: #fff;
  box-shadow: 0 10px 25px rgba(232, 99, 94, 0.25);
}

.btn-secondary {
  background-color: #fff;
  color: #1f2933;
  border: 1px solid #e3e6ec;
  box-shadow: 0 6px 15px rgba(15, 23, 42, 0.06);
}

/* Bouton texte "Continuer mes achats" */
.btn-link {
  background: none;
  border: none;
  color: #E8635E;
  font-weight: 500;
  padding: 0;
  margin-top: 0.75rem;
  cursor: pointer;
}

/* Espacement dans le panier */
.cart-summary-panel .btn-secondary,
.cart-summary-panel .btn-primary {
  width: 100%;
  margin-top: 1rem;
}

.toukui-alert--error {
  border: 1px solid #f5c2c7;
  background: #f8d7da;
  color: #842029;
  padding: 12px 14px;
  border-radius: 10px;
  margin: 12px 0;
  font-weight: 600;
}

#shippingBreakdown button:hover {
  background: rgba(0,0,0,0.03) !important;
}

/* =====================
   SHIPPING BREAKDOWN (Step 4) - FIX
   ===================== */

#shippingBreakdown button {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;

  padding: 12px 12px !important;
  border-radius: 12px !important;

  background: transparent !important;
  color: #111827 !important;
  box-shadow: none !important;
  border: 0 !important;

  font-weight: 800 !important;
  font-size: 13px !important;

  cursor: pointer !important;
  text-align: left !important;
}

/* Le petit texte "Voir le détail" à droite */
#shippingBreakdown button span:last-child {
  color: #6b7280 !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  opacity: 1 !important;
}

/* Hover */
#shippingBreakdown button:hover {
  background: rgba(0,0,0,0.03) !important;
}

/* Focus (au lieu du gros contour bleu iOS) */
#shippingBreakdown button:focus {
  outline: none !important;
}

#shippingBreakdown button:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(232, 99, 94, 0.35) !important;
}