/* ============================================================
   BANNIÈRE DE CONSENTEMENT COOKIES — Conforme RGPD/CNIL
   ============================================================
   - Bouton "Refuser" au même niveau visuel que "Accepter"
   - Choix granulaire par catégorie
   - Persistance 6 mois
   ============================================================ */

/* Bannière principale (bas de page) */
.bt-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99998;
  background: #1A1A1A;
  color: #F5F5F5;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 -6px 24px rgba(0,0,0,0.35);
  border-top: 3px solid #F39200;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.55;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.bt-cookie-banner.is-visible {
  transform: translateY(0);
}

.bt-cookie-banner__inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

.bt-cookie-banner__text {
  margin: 0;
  color: #F5F5F5;
}
.bt-cookie-banner__text strong {
  color: #F39200;
  font-weight: 700;
}
.bt-cookie-banner__text a {
  color: #F39200;
  text-decoration: underline;
}
.bt-cookie-banner__text a:hover {
  color: #ffb84d;
}

.bt-cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
  justify-content: flex-end;
}

/* Boutons - refus et accepter au même niveau visuel (obligation CNIL) */
.bt-cookie-btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.7rem 1.4rem;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1;
}
/* Bouton refuser : fond blanc plein pour un poids visuel équivalent au bouton accepter (exigence CNIL) */
.bt-cookie-btn--refuse {
  background: #F5F5F5;
  color: #1A1A1A;
  border-color: #F5F5F5;
}
.bt-cookie-btn--refuse:hover {
  background: #FFFFFF;
  border-color: #FFFFFF;
  color: #1A1A1A;
}
.bt-cookie-btn--customize {
  background: transparent;
  color: #F5F5F5;
  border-color: #666;
  font-weight: 500;
}
.bt-cookie-btn--customize:hover {
  border-color: #F5F5F5;
  color: #F5F5F5;
}
.bt-cookie-btn--accept {
  background: #F39200;
  color: #1A1A1A;
  border-color: #F39200;
}
.bt-cookie-btn--accept:hover {
  background: #ffb84d;
  border-color: #ffb84d;
}

/* Responsive - mobile */
@media (max-width: 900px) {
  .bt-cookie-banner {
    padding: 1rem 1rem 1.1rem;
    font-size: 0.875rem;
  }
  .bt-cookie-banner__inner {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }
  .bt-cookie-banner__actions {
    justify-content: stretch;
  }
  .bt-cookie-btn {
    flex: 1 1 auto;
    padding: 0.75rem 0.9rem;
    font-size: 0.875rem;
  }
}
@media (max-width: 480px) {
  .bt-cookie-banner__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .bt-cookie-btn {
    width: 100%;
  }
}

/* ============================================================
   MODALE PRÉFÉRENCES DÉTAILLÉES
   ============================================================ */
.bt-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  font-family: 'Inter', system-ui, sans-serif;
}
.bt-cookie-modal.is-open {
  display: flex;
}

.bt-cookie-modal__dialog {
  background: #FFFFFF;
  color: #1A1A1A;
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  border-top: 4px solid #F39200;
}

.bt-cookie-modal__header {
  padding: 1.5rem 1.75rem 0.5rem;
  border-bottom: 1px solid #EEE;
}
.bt-cookie-modal__header h2 {
  margin: 0 0 0.5rem;
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-size: 1.375rem;
  font-weight: 700;
  color: #1A1A1A;
}
.bt-cookie-modal__header p {
  margin: 0 0 1.1rem;
  color: #555;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.bt-cookie-modal__body {
  padding: 1rem 1.75rem;
}

.bt-cookie-category {
  display: block;
  padding: 1.1rem 0;
  border-bottom: 1px solid #F0F0F0;
}
.bt-cookie-category:last-child {
  border-bottom: 0;
}

.bt-cookie-category__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.4rem;
}
.bt-cookie-category__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1A1A1A;
}
.bt-cookie-category__desc {
  margin: 0;
  font-size: 0.875rem;
  color: #666;
  line-height: 1.55;
}

/* Toggle switch */
.bt-cookie-toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.bt-cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.bt-cookie-toggle__slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #CCC;
  border-radius: 26px;
  transition: 0.25s;
}
.bt-cookie-toggle__slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #FFF;
  border-radius: 50%;
  transition: 0.25s;
}
.bt-cookie-toggle input:checked + .bt-cookie-toggle__slider {
  background: #F39200;
}
.bt-cookie-toggle input:checked + .bt-cookie-toggle__slider::before {
  transform: translateX(20px);
}
.bt-cookie-toggle input:disabled + .bt-cookie-toggle__slider {
  background: #F39200;
  opacity: 0.55;
  cursor: not-allowed;
}
.bt-cookie-toggle input:focus-visible + .bt-cookie-toggle__slider {
  outline: 2px solid #F39200;
  outline-offset: 2px;
}

.bt-cookie-modal__footer {
  padding: 1.25rem 1.75rem;
  background: #FAFAFA;
  border-top: 1px solid #EEE;
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  justify-content: flex-end;
  border-radius: 0 0 12px 12px;
}
.bt-cookie-modal .bt-cookie-btn--refuse {
  color: #1A1A1A;
  border-color: #1A1A1A;
}
.bt-cookie-modal .bt-cookie-btn--refuse:hover {
  background: #1A1A1A;
  color: #FFF;
}
.bt-cookie-modal .bt-cookie-btn--customize {
  color: #555;
  border-color: #CCC;
}
.bt-cookie-modal .bt-cookie-btn--customize:hover {
  color: #1A1A1A;
  border-color: #1A1A1A;
}

@media (max-width: 500px) {
  .bt-cookie-modal__footer {
    flex-direction: column;
    align-items: stretch;
  }
  .bt-cookie-modal__footer .bt-cookie-btn {
    width: 100%;
  }
}

/* Bouton flottant pour rouvrir les préférences (petit, discret, coin bas gauche) */
.bt-cookie-fab {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 99997;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #1A1A1A;
  color: #F39200;
  border: 2px solid #F39200;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transition: transform 0.2s ease, background 0.2s ease;
  font-size: 1.125rem;
}
.bt-cookie-fab.is-visible {
  display: flex;
}
.bt-cookie-fab:hover {
  transform: scale(1.08);
  background: #F39200;
  color: #1A1A1A;
}
