/**
 * Cookie Consent Styles
 * Confrérie Chausse-Coqs
 * Design élégant et moderne
 */

/* Variables */
:root {
  --cc-primary: #722F37;
  --cc-primary-dark: #5a252c;
  --cc-secondary: #374151;
  --cc-bg-dark: #1f2937;
  --cc-bg-light: #f9fafb;
  --cc-text: #111827;
  --cc-text-light: #6b7280;
  --cc-border: #e5e7eb;
  --cc-success: #10b981;
  --cc-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --cc-radius: 16px;
  --cc-radius-sm: 8px;
  --cc-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Empêcher le scroll quand modal ouverte */
.cc-no-scroll {
  overflow: hidden !important;
}

/* ========== BANNIÈRE ========== */
.cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cc-banner--visible {
  transform: translateY(0);
}

.cc-banner__inner {
  background: linear-gradient(135deg, var(--cc-bg-dark) 0%, #111827 100%);
  color: white;
  padding: 24px;
  box-shadow: var(--cc-shadow);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cc-banner__content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.cc-banner__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--cc-primary) 0%, var(--cc-primary-dark) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-banner__icon .cc-icon {
  width: 24px;
  height: 24px;
  color: white;
}

.cc-banner__text {
  flex: 1;
}

.cc-banner__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: white;
}

.cc-banner__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
}

.cc-banner__actions {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ========== BOUTONS ========== */
.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--cc-radius-sm);
  padding: 12px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--cc-transition);
  white-space: nowrap;
}

.cc-btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.cc-btn--primary {
  background: linear-gradient(135deg, var(--cc-primary) 0%, var(--cc-primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(114, 47, 55, 0.4);
}

.cc-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(114, 47, 55, 0.5);
}

.cc-btn--secondary {
  background: var(--cc-secondary);
  color: white;
}

.cc-btn--secondary:hover {
  background: #4b5563;
  transform: translateY(-1px);
}

.cc-btn--ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.cc-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.cc-btn--sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* Variante pour le modal (fond clair) */
.cc-modal__footer .cc-btn--ghost {
  color: var(--cc-text-light);
  border-color: var(--cc-border);
}

.cc-modal__footer .cc-btn--ghost:hover {
  background: var(--cc-bg-light);
  color: var(--cc-text);
}

.cc-modal__footer .cc-btn--secondary {
  background: var(--cc-bg-light);
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
}

.cc-modal__footer .cc-btn--secondary:hover {
  background: #e5e7eb;
}

/* ========== LIEN ========== */
.cc-link {
  color: #93c5fd;
  text-decoration: underline;
  transition: color 0.2s;
}

.cc-link:hover {
  color: #bfdbfe;
}

/* ========== MODAL ========== */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
}

.cc-modal[aria-hidden="false"] {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cc-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: cc-fadeIn 0.3s ease;
}

.cc-modal__dialog {
  position: relative;
  background: white;
  color: var(--cc-text);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  border-radius: var(--cc-radius);
  overflow: hidden;
  box-shadow: var(--cc-shadow);
  display: flex;
  flex-direction: column;
  animation: cc-slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cc-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cc-slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header */
.cc-modal__header {
  padding: 24px;
  background: linear-gradient(135deg, var(--cc-bg-light) 0%, white 100%);
  border-bottom: 1px solid var(--cc-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cc-modal__header-content {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.cc-modal__header-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--cc-primary) 0%, var(--cc-primary-dark) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-icon-lg {
  width: 24px;
  height: 24px;
  color: white;
}

.cc-modal__title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: var(--cc-text);
}

.cc-modal__subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--cc-text-light);
  line-height: 1.5;
}

.cc-modal__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--cc-text-light);
  transition: var(--cc-transition);
}

.cc-modal__close:hover {
  background: var(--cc-bg-light);
  color: var(--cc-text);
}

.cc-modal__close svg {
  width: 20px;
  height: 20px;
}

/* Content */
.cc-modal__content {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.cc-modal__legal {
  margin: 0 0 20px;
  padding: 12px 16px;
  background: #fef3c7;
  border-radius: var(--cc-radius-sm);
  font-size: 12px;
  color: #92400e;
  line-height: 1.5;
  border-left: 3px solid #f59e0b;
}

/* Catégories */
.cc-cat {
  padding: 16px 0;
  border-bottom: 1px solid var(--cc-border);
}

.cc-cat:last-child {
  border-bottom: none;
}

.cc-cat__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cc-cat__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--cc-bg-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-cat__icon svg {
  width: 20px;
  height: 20px;
  color: var(--cc-primary);
}

.cc-cat__info {
  flex: 1;
  min-width: 0;
}

.cc-cat__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.cc-cat__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--cc-text);
}

.cc-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

.cc-badge--required {
  background: #dcfce7;
  color: #166534;
}

.cc-badge--optional {
  background: #e0e7ff;
  color: #3730a3;
}

.cc-cat__desc {
  margin: 0;
  font-size: 13px;
  color: var(--cc-text-light);
  line-height: 1.5;
}

.cc-cat__ctrl {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Toggle Switch */
.cc-switch {
  position: relative;
  width: 48px;
  height: 26px;
  display: inline-block;
}

.cc-switch input {
  display: none;
}

.cc-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d1d5db;
  border-radius: 999px;
  transition: var(--cc-transition);
}

.cc-slider:before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--cc-transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cc-switch input:checked + .cc-slider {
  background: linear-gradient(135deg, var(--cc-primary) 0%, var(--cc-primary-dark) 100%);
}

.cc-switch input:checked + .cc-slider:before {
  transform: translateX(22px);
}

.cc-switch input:focus + .cc-slider {
  box-shadow: 0 0 0 3px rgba(114, 47, 55, 0.2);
}

.cc-switch__locked {
  font-size: 12px;
  color: var(--cc-success);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cc-switch__locked::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--cc-success);
  border-radius: 50%;
}

/* Footer */
.cc-modal__footer {
  padding: 16px 24px;
  background: var(--cc-bg-light);
  border-top: 1px solid var(--cc-border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ========== BOUTON FLOTTANT ========== */
.cc-manage-btn {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 99998;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--cc-bg-dark) 0%, #111827 100%);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: var(--cc-transition);
}

.cc-manage-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.cc-manage-icon {
  width: 22px;
  height: 22px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
  .cc-banner__inner {
    padding: 20px 16px;
  }

  .cc-banner__content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .cc-banner__actions {
    flex-direction: column;
    width: 100%;
  }

  .cc-btn {
    width: 100%;
    justify-content: center;
  }

  .cc-modal[aria-hidden="false"] {
    padding: 0;
    align-items: flex-end;
  }

  .cc-modal__dialog {
    max-height: 95vh;
    border-radius: var(--cc-radius) var(--cc-radius) 0 0;
    animation: cc-slideUpMobile 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

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

  .cc-modal__header {
    padding: 20px 16px;
  }

  .cc-modal__header-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .cc-modal__content {
    padding: 16px;
  }

  .cc-cat__header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .cc-cat__title-row {
    justify-content: center;
  }

  .cc-modal__footer {
    padding: 16px;
    flex-direction: column;
  }

  .cc-modal__footer .cc-btn {
    width: 100%;
  }

  .cc-manage-btn {
    width: 44px;
    height: 44px;
    left: 16px;
    bottom: 16px;
  }
}
