/* ============================================================
   MASQUAGE DE LA SCROLLBAR NATIVE (FORCÉ GLOBALEMENT)
   ============================================================ */
*, *::before, *::after {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

/* ============================================================
   SCROLLBAR INTERACTIVE (STYLE ÉPAIS & BLEND MODE)
   ============================================================ */
.custom-scrollbar {
  position: fixed;
  top: 0;
  right: 8px;
  width: 32px;
  height: 100vh;
  z-index: 89000;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  mix-blend-mode: difference; /* <-- AJOUT : Permet de s'adapter au fond comme le logo */
}

.scrollbar-track {
  position: relative;
  width: 3px; /* <-- MODIFIÉ : Un peu plus épaisse au repos (avant : 2px) */
  height: calc(100vh - 550px);
  background-color: rgba(255, 255, 255, 0.15); /* Piste légèrement visible */
  border-radius: 4px;
  pointer-events: auto;
  cursor: pointer;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.scrollbar-track:hover,
.scrollbar-track.is-dragging {
  width: 5px; /* <-- MODIFIÉ : Plus épaisse au survol/drag (avant : 4px) */
  background-color: rgba(255, 255, 255, 0.35);
}

.scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40px; /* <-- POUR JOUER SUR LA LONGUEUR : C'est cette valeur qu'il faut changer ! */
  background-color: #ffffff; /* Reste blanc pur pour que le "difference" fonctionne */
  border-radius: 4px;
  cursor: grab;
  transform: translateY(0);
  will-change: transform;
  transition: background-color 0.3s ease;
}

.scrollbar-track.is-dragging .scrollbar-thumb {
  cursor: grabbing;
}

/* ============================================================
   STYLES DU PANIER & DU BADGE (PARTAGÉS)
   ============================================================ */
.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #EF4444;
  color: #ffffff;
  border-radius: 50%;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  z-index: 100;
}

body.theme-light .cart-badge {
  background: #DC2626;
}

.cart-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 89000; 
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.cart-overlay.active {
  opacity: 1;
  pointer-events: auto; 
  cursor: pointer;
}

.cart-badge.visible {
  opacity: 1;
  transform: scale(1);
}

.sidebar-pane {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 100vw;
  height: 100vh;
  background: var(--sidebar-bg, rgba(7, 10, 15, 0.85));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  z-index: 90000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: background-color 0.8s ease, border-color 0.8s ease;
  pointer-events: auto;
}

body.theme-light .sidebar-pane {
  background: var(--sidebar-bg, rgba(244, 246, 248, 0.85));
}

#close-cart-btn {
  position: absolute;
  top: 2.5rem;
  right: 2.5rem;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 50;
  line-height: 1;
  transition: transform 0.2s ease;
}
#close-cart-btn:hover {
  transform: scale(1.15);
}

.sidebar-header {
  padding: 3rem 3rem 1.5rem 3rem;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
}

.step-indicator {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.45));
  margin-bottom: 1rem;
}

.sidebar-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -1px;
}

.views-container {
  position: relative;
  flex-grow: 1;
  width: 100%;
}

.sidebar-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 2.5rem 3rem;
  display: flex;
  flex-direction: column;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.item-name {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}

.item-desc {
  font-size: 0.8rem;
  color: var(--text-secondary, rgba(255, 255, 255, 0.45));
}

.item-price {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
}

.cart-summary {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--text-secondary, rgba(255, 255, 255, 0.45));
}

.summary-total {
  display: flex;
  justify-content: space-between;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 1.5rem;
  color: var(--text-primary);
}

.input-group {
  margin-bottom: 2rem;
}

.input-group label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.45));
  margin-bottom: 1rem;
}

.custom-input, #stripe-element-container {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--text-secondary, rgba(255, 255, 255, 0.45));
  padding: 0.5rem 0;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--text-primary);
  transition: border-color 0.3s;
}

.custom-input:focus, #stripe-element-container.StripeElement--focus {
  border-color: var(--text-primary);
  outline: none;
}

.custom-input::placeholder {
  color: var(--text-secondary, rgba(255, 255, 255, 0.45));
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-secondary, rgba(255, 255, 255, 0.45));
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 3rem;
  cursor: pointer;
  transition: color 0.3s;
}
.btn-back:hover {
  color: var(--text-primary);
}

.magnetic-wrap {
  margin-top: 1.5rem;
  display: inline-block;
  width: 100%;
}

.btn-main {
  width: 100%;
  background: var(--text-primary);
  color: var(--bg-color);
  border: none;
  padding: 1.2rem;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.8s;
}
.btn-main:hover {
  transform: scale(0.98);
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.3rem 0.8rem;
  border-radius: 40px;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  width: max-content;
  margin-top: 0.5rem;
}

body.theme-light .qty-control {
  background: rgba(0, 0, 0, 0.03);
}

.qty-btn {
  background: none;
  border: none;
  color: var(--text-secondary, rgba(255, 255, 255, 0.45));
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s, transform 0.2s;
}

.qty-btn:hover {
  color: var(--text-primary);
  transform: scale(1.2);
}

.qty-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 20px;
  text-align: center;
}

.sidebar-view {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.sidebar-view::-webkit-scrollbar {
  display: none;
}

.form-row-grid {
  display: flex;
  gap: 1rem;
}
.form-row-grid .input-group {
  flex: 1;
}

.input-group small {
  display: block;
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ============================================================
   ADAPTATIONS MOBILE (PANIER & SCROLLBAR)
   ============================================================ */
@media (max-width: 991px), (pointer: coarse) {
  /* Masque la scrollbar artificielle sur mobile pour privilégier le tactile natif */
  .custom-scrollbar {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .sidebar-pane {
    width: 100vw;
  }

  .sidebar-header {
    padding: 2rem 1.5rem 1.25rem 1.5rem;
  }

  #close-cart-btn {
    top: 1.75rem;
    right: 1.5rem;
  }

  .sidebar-title {
    font-size: 1.6rem;
  }

  .sidebar-view {
    padding: 1.5rem;
  }

  .btn-back {
    margin-bottom: 1.5rem;
  }

  .input-group {
    margin-bottom: 1.25rem;
  }

  .form-row-grid {
    flex-direction: column;
    gap: 0;
  }

  #stripe-element-container {
  border-bottom: none !important;
  padding: 0.5rem 0 !important;
}
}

/* ============================================================
   STYLES LÉGAUX & CONSENTEMENT PANIER
   ============================================================ */
.legal-consent-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.custom-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.3));
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  margin-top: 0.2rem;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s ease;
}

.custom-checkbox:checked {
  background-color: var(--text-primary);
  border-color: var(--text-primary);
}

.custom-checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--bg-color, #050608);
  font-size: 0.7rem;
  font-weight: 700;
}

.legal-consent-label {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-secondary, rgba(255, 255, 255, 0.6));
  cursor: pointer;
}

.legal-consent-label a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Liens légaux footer */
.cf-legal {
  display: flex;
  justify-content: space-between !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.cf-legal-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cf-legal-links a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.cf-legal-links a:hover {
  color: #EDE8DF;
}

.cf-legal-links .sep {
  opacity: 0.3;
}