/* ========== COOKIE CONSENT ========== */
.cookie-wrapper {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
}

@media (min-width: 768px) {
  .cookie-wrapper {
    justify-content: flex-end;
  }
}

.cookie-card {
  width: 100%;
  max-width: 26rem;
  background: var(--bg-cookie);
  border: 1px solid var(--border-cookie);
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.45s ease,
              background 0.4s ease,
              border-color 0.4s ease;
  overflow: hidden;
}

.cookie-card.visible {
  transform: translateY(0);
  opacity: 1;
}

.cookie-view {
  padding: 1.75rem 1.75rem 1.5rem;
}

.cookie-settings {
  background: var(--bg-cookie-settings);
}

.cookie-settings.hidden {
  display: none;
}

.cookie-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cookie-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-cookie-icon);
  color: var(--plag-red);
}

.cookie-title {
  font-family: 'Rubik', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-cookie);
  margin-bottom: 0.3rem;
}

.cookie-desc {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-cookie-muted);
}

.cookie-link {
  color: var(--plag-red);
  font-weight: 600;
  text-decoration: none;
}

.cookie-link:hover {
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cookie-btn {
  width: 100%;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: 1rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.cookie-btn:active {
  transform: scale(0.98);
}

.cookie-btn-primary {
  background: linear-gradient(135deg, var(--plag-green), #18a01a);
  color: #fff;
  box-shadow: 0 6px 18px rgba(74, 196, 30, 0.3);
}

.cookie-btn-primary:hover {
  box-shadow: 0 8px 24px rgba(74, 196, 30, 0.4);
}

.cookie-btn-secondary {
  background: var(--bg-cookie-secondary);
  color: var(--text-cookie);
  font-size: 0.875rem;
}

.cookie-btn-secondary:hover {
  background: var(--bg-cookie-secondary-hover);
}

.cookie-btn-dark {
  background: var(--bg-cookie-save);
  color: #fff;
}

.cookie-btn-dark:hover {
  filter: brightness(1.08);
}

.cookie-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-cookie-muted);
  cursor: pointer;
  margin-bottom: 1.25rem;
  padding: 0;
  transition: color 0.2s;
}

.cookie-back:hover {
  color: var(--plag-red);
}

.cookie-settings-title {
  font-family: 'Rubik', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-cookie);
  margin-bottom: 1.25rem;
}

.cookie-prefs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.cookie-pref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  background: var(--bg-cookie-pref);
  border: 1px solid var(--border-cookie);
  border-radius: 1rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.cookie-pref:hover {
  border-color: rgba(196, 30, 58, 0.3);
}

.cookie-pref-text {
  padding-right: 1rem;
}

.cookie-pref-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-cookie);
  margin-bottom: 0.15rem;
}

.cookie-pref-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-cookie-muted);
}

/* Custom toggle switch */
.cookie-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.cookie-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-switch-track {
  position: absolute;
  inset: 0;
  background: var(--bg-switch-off);
  border-radius: 999px;
  transition: background 0.25s;
}

.cookie-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s;
}

.cookie-switch-input:checked + .cookie-switch-track {
  background: var(--plag-red);
}

.cookie-switch-input:checked ~ .cookie-switch-thumb {
  transform: translateX(20px);
}

/* Disabled (Nécessaires) */
.cookie-switch-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.cookie-switch-disabled .cookie-switch-track.on {
  background: var(--plag-red);
}

.cookie-switch-disabled .cookie-switch-thumb.on {
  transform: translateX(20px);
}
