/* Destination : assets/css/cookies_banner.css */

.nh-cookies {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translate(-50%, 0);
  width: min(920px, calc(100% - 2rem));
  background: var(--nh-white);
  border-radius: var(--nh-radius-lg);
  box-shadow: 0 20px 50px rgba(43, 27, 30, 0.25);
  z-index: 1200;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--nh-grey-300);
  /* Respecte les zones sûres des mobiles (encoche, barre de gestes) */
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  animation: nh-cookies-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.nh-cookies[hidden] { display: none; }

@keyframes nh-cookies-in {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.nh-cookies-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
}

.nh-cookies-icon {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: var(--nh-rose-light);
  color: var(--nh-rose);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.nh-cookies-title { font-weight: 700; margin: 0 0 0.25rem; color: var(--nh-dark); }
.nh-cookies-desc { font-size: 0.86rem; color: var(--nh-grey-600); margin: 0; }
.nh-cookies-desc a { font-weight: 600; }

.nh-cookies-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: flex-end; }

.nh-cookies-btn {
  border: none;
  border-radius: 50px;
  padding: 0.65rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--nh-transition);
}
.nh-cookies-refuse { background: var(--nh-grey-300); color: var(--nh-dark); }
.nh-cookies-refuse:hover { background: #c8bab8; }
.nh-cookies-settings { background: transparent; border: 2px solid var(--nh-teal); color: var(--nh-teal); }
.nh-cookies-settings:hover { background: var(--nh-teal); color: var(--nh-white); }
.nh-cookies-accept { background: var(--nh-gradient-primary); color: var(--nh-white); box-shadow: var(--nh-shadow-glow); }
.nh-cookies-accept:hover { transform: translateY(-2px); }

/* ---------- Panneau de personnalisation ---------- */
.nh-cookies-panel {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--nh-grey-300);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.nh-cookies-panel[hidden] { display: none; }

.nh-cookies-panel-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nh-cookies-panel-title { font-weight: 600; font-size: 0.9rem; margin: 0 0 0.15rem; color: var(--nh-dark); }
.nh-cookies-panel-desc { font-size: 0.8rem; color: var(--nh-grey-600); margin: 0; }

.nh-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.nh-switch input { opacity: 0; width: 0; height: 0; }
.nh-switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--nh-grey-300); border-radius: 50px; transition: var(--nh-transition);
}
.nh-switch-slider::before {
  content: ''; position: absolute; height: 20px; width: 20px; left: 3px; bottom: 3px;
  background: var(--nh-white); border-radius: 50%; transition: var(--nh-transition);
}
.nh-switch input:checked + .nh-switch-slider { background: var(--nh-rose); }
.nh-switch input:checked + .nh-switch-slider::before { transform: translateX(20px); }
.nh-switch-disabled { opacity: 0.6; }

.nh-cookies-save { align-self: flex-end; }

/* ==========================================================
   RESPONSIVE MOBILE — bandeau stable, jamais décalé
   ========================================================== */
@media (max-width: 767.98px) {
  .nh-cookies {
    left: 1rem;
    right: 1rem;
    bottom: 0.85rem;
    width: auto;
    transform: none;
    padding: 1.25rem;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    max-height: calc(100vh - 1.7rem);
    overflow-y: auto;
  }
  @keyframes nh-cookies-in {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .nh-cookies-inner {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "icon text"
      "actions actions";
    row-gap: 1rem;
  }
  .nh-cookies-icon { grid-area: icon; width: 42px; height: 42px; font-size: 1.15rem; }
  .nh-cookies-text { grid-area: text; }
  .nh-cookies-actions { grid-area: actions; justify-content: stretch; }
  .nh-cookies-btn { flex: 1 1 auto; text-align: center; }

  .nh-cookies-panel-row { align-items: flex-start; }
}