/* ── Cookie Consent España ── */
:root {
  --cces-accent: #1a1a2e;
  --cces-bg: #ffffff;
  --cces-text: #1a1a1a;
  --cces-muted: #6b7280;
  --cces-border: #e5e7eb;
  --cces-radius: 16px;
  --cces-shadow: 0 8px 40px rgba(0,0,0,0.14);
  --cces-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Overlay */
#cces-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99998;
  opacity: 0;
  transition: opacity var(--cces-transition);
  pointer-events: none;
}
#cces-overlay.cces-visible {
  opacity: 1;
  pointer-events: all;
}

/* Banner */
#cces-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  z-index: 99999;
  width: min(680px, calc(100vw - 32px));
  background: var(--cces-bg);
  border-radius: var(--cces-radius);
  box-shadow: var(--cces-shadow);
  padding: 28px 32px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--cces-text);
  line-height: 1.5;
  opacity: 0;
  transition: transform var(--cces-transition), opacity var(--cces-transition);
  border: 1px solid var(--cces-border);
}
#cces-banner.cces-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Header */
.cces-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.cces-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--cces-text);
  letter-spacing: -0.3px;
}
.cces-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

/* Description */
.cces-desc {
  color: var(--cces-muted);
  margin-bottom: 20px;
  font-size: 13.5px;
}
.cces-desc a {
  color: var(--cces-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* Toggles */
.cces-categories {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid var(--cces-border);
}
.cces-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cces-category-info {
  flex: 1;
}
.cces-category-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--cces-text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.cces-category-name .cces-badge {
  font-size: 10px;
  font-weight: 600;
  background: #e5e7eb;
  color: #6b7280;
  padding: 1px 7px;
  border-radius: 100px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.cces-category-name .cces-badge.required {
  background: #dcfce7;
  color: #16a34a;
}
.cces-category-desc {
  font-size: 12px;
  color: var(--cces-muted);
  margin-top: 2px;
}

/* Toggle Switch */
.cces-toggle {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.cces-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.cces-toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 100px;
  cursor: pointer;
  transition: background var(--cces-transition);
}
.cces-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--cces-transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.cces-toggle input:checked + .cces-toggle-slider {
  background: var(--cces-accent);
}
.cces-toggle input:checked + .cces-toggle-slider::before {
  transform: translateX(18px);
}
.cces-toggle input:disabled + .cces-toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Buttons */
.cces-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cces-btn {
  flex: 1;
  min-width: 120px;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--cces-transition);
  text-align: center;
  letter-spacing: -0.1px;
}
.cces-btn-reject {
  background: #f3f4f6;
  color: var(--cces-muted);
}
.cces-btn-reject:hover {
  background: #e5e7eb;
  color: var(--cces-text);
}
.cces-btn-custom {
  background: white;
  color: var(--cces-accent);
  border: 1.5px solid var(--cces-accent);
}
.cces-btn-custom:hover {
  background: var(--cces-accent);
  color: white;
}
.cces-btn-accept {
  background: var(--cces-accent);
  color: white;
}
.cces-btn-accept:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* Reopen button (shortcode) */
.cces-reopen-btn {
  background: none;
  border: 1.5px solid currentColor;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.cces-reopen-btn:hover { opacity: 0.7; }

/* Responsive */
@media (max-width: 520px) {
  #cces-banner { padding: 22px 20px; }
  .cces-btn { min-width: 0; font-size: 13px; padding: 10px 14px; }
}
