/* ─── CookieRadar Banner — styles isolés ─────────────────────────────────── */

:root {
  --cr-primary:      #233038;
  --cr-accent:       #d85734;
  --cr-gold:         #f8b04a;
  --cr-white:        #ffffff;
  --cr-text-light:   rgba(255, 255, 255, 0.75);
  --cr-text-muted:   rgba(255, 255, 255, 0.45);
  --cr-border:       rgba(255, 255, 255, 0.12);
  --cr-overlay-bg:   rgba(35, 48, 56, 0.6);
  --cr-radius-sm:    6px;
  --cr-radius-md:    10px;
  --cr-radius-lg:    14px;
  --cr-shadow:       0 8px 32px rgba(0, 0, 0, 0.18);
  --cr-transition:   0.2s ease;
  --cr-z:            99999;
}

/* ─── Overlay ────────────────────────────────────────────────────────────── */

.cr-overlay {
  display:    none;
  position:   fixed;
  inset:      0;
  background: var(--cr-overlay-bg);
  z-index:    calc(var(--cr-z) - 1);
  backdrop-filter: blur(2px);
}

.cr-overlay--visible {
  display: block;
  animation: cr-fade-in var(--cr-transition) both;
}

/* ─── Banner conteneur ────────────────────────────────────────────────────── */

.cr-banner {
  position:   fixed;
  z-index:    var(--cr-z);
  background: var(--cr-primary);
  color:      var(--cr-white);
  box-shadow: var(--cr-shadow);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size:  14px;
  line-height: 1.5;
  transition: transform var(--cr-transition), opacity var(--cr-transition);
}

.cr-banner--bottom {
  bottom:        0;
  left:          0;
  right:         0;
  border-radius: var(--cr-radius-lg) var(--cr-radius-lg) 0 0;
  animation:     cr-slide-up 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cr-banner--top {
  top:           0;
  left:          0;
  right:         0;
  border-radius: 0 0 var(--cr-radius-lg) var(--cr-radius-lg);
  animation:     cr-slide-down 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cr-banner--modal {
  top:       50%;
  left:      50%;
  transform: translate(-50%, -50%);
  width:     min(520px, calc(100vw - 32px));
  border-radius: var(--cr-radius-lg);
  animation: cr-scale-in 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cr-banner--hidden {
  opacity:   0;
  pointer-events: none;
  transform: translateY(100%);
}

.cr-banner--top.cr-banner--hidden {
  transform: translateY(-100%);
}

.cr-banner--modal.cr-banner--hidden {
  transform: translate(-50%, -50%) scale(0.95);
}

/* ─── Vues (barre / modal) ────────────────────────────────────────────────── */

.cr-view {
  padding: 16px 20px;
}

.cr-view--hidden {
  display: none;
}

/* ─── Vue barre courte ────────────────────────────────────────────────────── */

.cr-bar__content {
  display:     flex;
  align-items: center;
  gap:         16px;
  flex-wrap:   wrap;
}

.cr-bar__text {
  flex:        1;
  min-width:   200px;
  display:     flex;
  flex-direction: column;
  gap:         2px;
}

.cr-bar__text strong {
  font-size:   15px;
  font-weight: 600;
  color:       var(--cr-white);
}

.cr-bar__text span {
  font-size:  13px;
  color:      var(--cr-text-light);
}

.cr-bar__actions {
  display:  flex;
  gap:      8px;
  flex-wrap: wrap;
  align-items: center;
}

.cr-bar__footer {
  margin-top:  8px;
  padding-top: 8px;
  border-top:  1px solid var(--cr-border);
}

/* ─── Vue modal granulaire ────────────────────────────────────────────────── */

.cr-modal__header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding-bottom:  12px;
  border-bottom:   1px solid var(--cr-border);
  margin-bottom:   12px;
}

.cr-modal__title {
  font-size:   17px;
  font-weight: 600;
  margin:      0;
  color:       var(--cr-white);
}

.cr-btn-close {
  background:  transparent;
  border:      none;
  color:       var(--cr-text-light);
  font-size:   18px;
  cursor:      pointer;
  padding:     4px 8px;
  border-radius: var(--cr-radius-sm);
  transition:  color var(--cr-transition), background var(--cr-transition);
  line-height: 1;
}

.cr-btn-close:hover {
  color:       var(--cr-white);
  background:  rgba(255, 255, 255, 0.1);
}

.cr-modal__intro {
  font-size:    13px;
  color:        var(--cr-text-light);
  margin:       0 0 14px;
}

.cr-modal__body {
  max-height:   55vh;
  overflow-y:   auto;
  scrollbar-width: thin;
  scrollbar-color: var(--cr-border) transparent;
}

.cr-modal__footer {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  flex-wrap:       wrap;
  gap:             8px;
  padding-top:     12px;
  border-top:      1px solid var(--cr-border);
  margin-top:      12px;
}

.cr-modal__actions {
  display: flex;
  gap:     8px;
  flex-wrap: wrap;
}

/* ─── Toggles ─────────────────────────────────────────────────────────────── */

.cr-toggles {
  display:        flex;
  flex-direction: column;
  gap:            2px;
}

.cr-toggle-row {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             12px;
  padding:         10px 0;
  border-bottom:   1px solid var(--cr-border);
}

.cr-toggle-row:last-child {
  border-bottom: none;
}

.cr-toggle-info {
  flex: 1;
}

.cr-toggle-label {
  font-size:   14px;
  font-weight: 500;
  color:       var(--cr-white);
  margin-bottom: 2px;
}

.cr-toggle-desc {
  font-size: 12px;
  color:     var(--cr-text-light);
  line-height: 1.4;
}

.cr-toggle-services {
  display:   flex;
  flex-wrap: wrap;
  gap:       4px;
  margin-top: 6px;
}

.cr-service-tag {
  font-size:     11px;
  background:    rgba(255, 255, 255, 0.1);
  color:         var(--cr-text-light);
  border-radius: var(--cr-radius-sm);
  padding:       2px 7px;
  border:        1px solid var(--cr-border);
}

/* Toggle button */
.cr-toggle {
  position:      relative;
  width:         44px;
  height:        24px;
  border-radius: 24px;
  border:        none;
  cursor:        pointer;
  flex-shrink:   0;
  transition:    background var(--cr-transition);
  padding:       0;
}

.cr-toggle--on {
  background: var(--cr-accent);
}

.cr-toggle--off {
  background: rgba(255, 255, 255, 0.2);
}

.cr-toggle--locked {
  background: rgba(255, 255, 255, 0.15);
  cursor:     not-allowed;
}

.cr-toggle__thumb {
  position:      absolute;
  top:           3px;
  width:         18px;
  height:        18px;
  border-radius: 50%;
  background:    var(--cr-white);
  transition:    left var(--cr-transition);
  pointer-events: none;
}

.cr-toggle--on    .cr-toggle__thumb { left: 23px; }
.cr-toggle--off   .cr-toggle__thumb { left: 3px;  }
.cr-toggle--locked .cr-toggle__thumb { left: 3px; opacity: 0.6; }

/* ─── Boutons ─────────────────────────────────────────────────────────────── */

.cr-btn {
  font-family:   inherit;
  font-size:     13px;
  font-weight:   500;
  padding:       8px 16px;
  border-radius: var(--cr-radius-sm);
  cursor:        pointer;
  transition:    background var(--cr-transition),
                 color var(--cr-transition),
                 border-color var(--cr-transition),
                 transform var(--cr-transition);
  white-space:   nowrap;
  line-height:   1;
}

.cr-btn:active {
  transform: scale(0.97);
}

.cr-btn--primary {
  background: var(--cr-accent);
  color:      var(--cr-white);
  border:     2px solid var(--cr-accent);
}

.cr-btn--primary:hover {
  background: #c04a2a;
  border-color: #c04a2a;
}

.cr-btn--outline {
  background:   transparent;
  color:        var(--cr-gold);
  border:       1px solid var(--cr-gold);
}

.cr-btn--outline:hover {
  background: rgba(248, 176, 74, 0.1);
}

.cr-btn--ghost {
  background: transparent;
  color:      var(--cr-text-light);
  border:     1px solid transparent;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cr-btn--ghost:hover {
  color:  var(--cr-white);
  border-color: var(--cr-border);
  text-decoration: none;
}

/* ─── Lien politique ──────────────────────────────────────────────────────── */

.cr-policy-link {
  font-size:  12px;
  color:      var(--cr-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--cr-transition);
}

.cr-policy-link:hover {
  color: var(--cr-text-light);
}

/* ─── Animations ──────────────────────────────────────────────────────────── */

@keyframes cr-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes cr-slide-down {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

@keyframes cr-scale-in {
  from { transform: translate(-50%, -50%) scale(0.94); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1);    opacity: 1; }
}

@keyframes cr-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── Page politique (shortcode) ──────────────────────────────────────────── */

.cookieradar-policy {
  font-size:  15px;
  line-height: 1.7;
  color:      inherit;
}

.cookieradar-policy__intro {
  font-size:     15px;
  margin-bottom: 6px;
}

.cookieradar-policy__updated {
  font-size:     13px;
  color:         #666;
  margin-bottom: 24px;
}

.cookieradar-policy__service {
  margin-bottom: 28px;
}

.cookieradar-policy__service h4 {
  font-size:   15px;
  font-weight: 600;
  margin:      0 0 8px;
}

.cookieradar-policy__provider {
  font-weight: 400;
  font-size:   13px;
  color:       #666;
}

.cookieradar-policy__table {
  width:           100%;
  border-collapse: collapse;
  font-size:       13px;
  margin-bottom:   8px;
}

.cookieradar-policy__table th {
  text-align:    left;
  padding:       7px 10px;
  background:    #f5f5f5;
  font-weight:   600;
  border-bottom: 2px solid #e0e0e0;
}

.cookieradar-policy__table td {
  padding:       7px 10px;
  border-bottom: 1px solid #efefef;
  vertical-align: top;
}

.cookieradar-policy__table code {
  font-size:     12px;
  background:    #f0f0f0;
  padding:       1px 5px;
  border-radius: 3px;
  font-family:   monospace;
}

.cookieradar-reopen-banner {
  display:       inline-block;
  padding:       10px 20px;
  background:    #233038;
  color:         #fff;
  border:        none;
  border-radius: 6px;
  font-size:     14px;
  font-weight:   500;
  cursor:        pointer;
  margin:        8px 0 24px;
  transition:    background 0.2s;
}

.cookieradar-reopen-banner:hover {
  background: #d85734;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .cr-bar__content {
    flex-direction: column;
    align-items:    stretch;
  }

  .cr-bar__actions {
    flex-direction: column;
  }

  .cr-btn {
    width:      100%;
    text-align: center;
    padding:    11px 16px;
  }

  .cr-modal__footer {
    flex-direction: column;
    align-items:    stretch;
  }

  .cr-modal__actions {
    flex-direction: column;
  }

  .cr-banner--modal {
    top:       auto;
    bottom:    0;
    left:      0;
    right:     0;
    transform: none;
    width:     100%;
    border-radius: var(--cr-radius-lg) var(--cr-radius-lg) 0 0;
    animation: cr-slide-up 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .cr-banner--modal.cr-banner--hidden {
    transform: translateY(100%);
  }
}
/* ─── Badges d'état dans le modal (Accepté / Refusé) ─────────────────────── */

.cr-status-badge {
  display:       inline-block;
  font-size:     11px;
  font-weight:   500;
  padding:       2px 8px;
  border-radius: 20px;
  margin-top:    5px;
  transition:    background 0.2s, color 0.2s;
}

.cr-status-badge--on {
  background: rgba(29, 158, 117, 0.18);
  color:      #9FE1CB;
}

.cr-status-badge--off {
  background: rgba(216, 87, 52, 0.18);
  color:      #f0997b;
}
/* ─── Page politique — résumé et statuts ─────────────────────────────────── */

.crp-summary {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap:                   10px;
  margin:                20px 0 28px;
}

.crp-summary__item {
  display:        flex;
  flex-direction: column;
  gap:            6px;
  padding:        12px 14px;
  border:         1px solid #e5e7eb;
  border-radius:  8px;
  background:     #fafafa;
}

.crp-summary__label {
  font-size:   12px;
  font-weight: 600;
  color:       #374151;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.crp-cat-title {
  display:     flex;
  align-items: center;
  gap:         10px;
  flex-wrap:   wrap;
}

/* Badges partagés */
.crp-summary__badge,
.crp-cat-badge,
.crp-status {
  display:       inline-block;
  font-size:     11px;
  font-weight:   600;
  padding:       3px 10px;
  border-radius: 20px;
  transition:    background 0.25s, color 0.25s;
}

.crp-badge--pending {
  background: #f3f4f6;
  color:      #9ca3af;
}

.crp-badge--essential {
  background: #e3e8ea;
  color:      #233038;
}

.crp-badge--on {
  background: #d1fae5;
  color:      #065f46;
}

.crp-badge--off {
  background: #fee2e2;
  color:      #991b1b;
}

.crp-status-cell {
  white-space: nowrap;
  width:       100px;
}