/* ===========================
   COOKIES BANNER & MODAL
   RGPD/CNIL — Maison Liora
   =========================== */

/* ---------- Bannière ---------- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #fff;
  border-top: 1px solid #e8e0d8;
  box-shadow: 0 -4px 24px rgba(40, 30, 20, 0.10);
  padding: 1.25rem 1.5rem;
  animation: slideUpCookie 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideUpCookie {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.cookie-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cookie-banner__text p {
  font-size: 0.9rem;
  color: #4a4440;
  line-height: 1.6;
  max-width: 65ch;
  margin: 0;
}

.cookie-banner__link {
  color: var(--color-primary, #b08060);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ---------- Boutons ---------- */
.cookie-btn {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  white-space: nowrap;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
  min-height: 44px;
}

.cookie-btn--primary {
  background: var(--color-primary, #b08060);
  color: #fff;
}
.cookie-btn--primary:hover {
  background: var(--color-primary-hover, #8c6240);
}

.cookie-btn--secondary {
  background: transparent;
  border: 1.5px solid var(--color-primary, #b08060);
  color: var(--color-primary, #b08060);
}
.cookie-btn--secondary:hover {
  background: rgba(176, 128, 96, 0.08);
}

.cookie-btn--ghost {
  background: transparent;
  color: #7a7470;
  border: 1.5px solid #d4cdc8;
}
.cookie-btn--ghost:hover {
  background: #f5f1ee;
  color: #4a4440;
}

/* ---------- Modal ---------- */
.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cookie-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 20, 10, 0.55);
  backdrop-filter: blur(3px);
}

.cookie-modal__content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(40, 30, 20, 0.2);
  animation: scaleFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes scaleFadeIn {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.cookie-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e8e0d8;
}

.cookie-modal__header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #28201a;
  margin: 0;
}

.cookie-modal__close {
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #7a7470;
  padding: 0.25rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 180ms ease;
}
.cookie-modal__close:hover { background: #f5f1ee; }

.cookie-modal__body {
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cookie-modal__footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e8e0d8;
  flex-wrap: wrap;
}

/* ---------- Catégories ---------- */
.cookie-category {
  padding: 1rem 0;
  border-bottom: 1px solid #f0ebe6;
}
.cookie-category:last-child { border-bottom: none; }

.cookie-category__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-category h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #28201a;
  margin: 0 0 0.25rem;
}

.cookie-category p {
  font-size: 0.825rem;
  color: #7a7470;
  margin: 0;
  line-height: 1.5;
  max-width: 100%;
}

/* ---------- Badge Requis ---------- */
.cookie-badge--required {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f0ebe6;
  color: #7a7470;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- Toggle switch ---------- */
.cookie-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.cookie-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle__slider {
  width: 46px;
  height: 26px;
  background: #d4cdc8;
  border-radius: 999px;
  position: relative;
  transition: background 200ms ease;
}

.cookie-toggle__slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-toggle input:checked + .cookie-toggle__slider {
  background: var(--color-primary, #b08060);
}
.cookie-toggle input:checked + .cookie-toggle__slider::before {
  transform: translateX(20px);
}

.cookie-toggle input:focus-visible + .cookie-toggle__slider {
  outline: 2px solid var(--color-primary, #b08060);
  outline-offset: 2px;
}

/* ---------- Lien "Gérer mes cookies" dans footer ---------- */
.cookie-reopen-link {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  font-size: 0.875rem;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  opacity: 0.75;
  transition: opacity 150ms;
}
.cookie-reopen-link:hover { opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .cookie-banner__inner {
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-banner__actions {
    flex-direction: column;
  }
  .cookie-btn {
    width: 100%;
    text-align: center;
  }
  .cookie-modal__footer {
    flex-direction: column-reverse;
  }
  .cookie-modal__footer .cookie-btn {
    width: 100%;
    text-align: center;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .cookie-banner, .cookie-modal__content {
    animation: none;
  }
}
