/**
 * Cookie Consent Banner — styles
 * All rules scoped under #ccb-* ids to avoid theme conflicts.
 */

:root {
  --ccb-primary: #7c2d2d;
  --ccb-bg: #ffffff;
  --ccb-text: #374151;
}

/* ---------- Overlay ---------- */
#ccb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 999998;
}
#ccb-overlay.ccb-visible { display: block; }

/* ---------- Banner ---------- */
#ccb-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999999;
  background: var(--ccb-bg);
  color: var(--ccb-text);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  animation: ccb-slide-up 0.35s ease;
}
#ccb-banner.ccb-visible { display: block; }

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

.ccb-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (min-width: 1024px) {
  .ccb-wrap { flex-direction: row; align-items: center; justify-content: space-between; }
}

.ccb-body { flex: 1; min-width: 0; }

.ccb-h2 {
  margin: 0 0 8px !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  color: inherit !important;
  line-height: 1.3 !important;
}

.ccb-text { max-width: 760px; }
.ccb-text p { margin: 0 0 8px !important; font-size: 14px !important; color: inherit !important; }

#ccb-more {
  background: none;
  border: none;
  padding: 0;
  color: var(--ccb-primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}
#ccb-more:hover { opacity: 0.8; }

#ccb-full { margin-top: 8px; }
#ccb-full p { color: rgba(55, 65, 81, 0.85) !important; }

.ccb-links {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  font-size: 12px;
  align-items: center;
}
.ccb-links a {
  color: var(--ccb-primary) !important;
  text-decoration: none !important;
}
.ccb-links a:hover { text-decoration: underline !important; }

/* ---------- Buttons ---------- */
.ccb-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
@media (min-width: 640px)  { .ccb-actions { flex-direction: row; } }

.ccb-btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: opacity 0.15s ease, background 0.15s ease;
  line-height: 1.4;
}
.ccb-btn:hover { opacity: 0.9; }

.ccb-btn-primary {
  background: var(--ccb-primary);
  color: #fff;
  border: 1px solid var(--ccb-primary);
}
.ccb-btn-secondary {
  background: #f3f4f6;
  color: var(--ccb-text);
  border: 1px solid #e5e7eb;
}
.ccb-btn-outline {
  background: transparent;
  color: var(--ccb-text);
  border: 1px solid #d1d5db;
}

/* ---------- Preferences modal ---------- */
#ccb-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
#ccb-modal.ccb-visible { display: flex; }

.ccb-modal-box {
  background: var(--ccb-bg);
  color: var(--ccb-text);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: ccb-pop 0.25s ease;
}
@keyframes ccb-pop {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.ccb-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
  border-bottom: 1px solid #f0f0f0;
}
.ccb-modal-head h2 {
  margin: 0 !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  color: inherit !important;
}
#ccb-modal-x {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #9ca3af;
  padding: 4px 8px;
  line-height: 1;
}
#ccb-modal-x:hover { color: var(--ccb-text); }

.ccb-modal-body { padding: 16px 24px; }

.ccb-cat {
  padding: 14px 0;
  border-bottom: 1px solid #f3f4f6;
}
.ccb-cat:last-child { border-bottom: none; }

.ccb-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ccb-cat-label {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-weight: 600 !important;
  font-size: 14px !important;
  cursor: pointer;
  margin: 0 !important;
  color: inherit !important;
}
.ccb-cat-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--ccb-primary);
  cursor: pointer;
  margin: 0;
}
.ccb-cat-label input[type="checkbox"]:disabled { cursor: not-allowed; }

.ccb-always-on {
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 999px;
}

.ccb-cat-desc {
  margin: 6px 0 0 28px !important;
  font-size: 12px !important;
  color: #6b7280 !important;
  line-height: 1.5 !important;
}

.ccb-modal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px 20px;
  border-top: 1px solid #f0f0f0;
}

/* ---------- Floating settings button ---------- */
#ccb-float {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 999997;
  background: var(--ccb-bg);
  color: var(--ccb-text);
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  transition: box-shadow 0.15s ease;
}
#ccb-float.ccb-visible { display: block; }
#ccb-float:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); }

/* ---------- Mobile tweaks ---------- */
@media (max-width: 639px) {
  .ccb-wrap { padding: 18px 16px; }
  .ccb-btn { width: 100%; text-align: center; }
  .ccb-modal-foot .ccb-btn { flex: 1; }
}

/* ---- Auto-blocking: blocked iframe placeholder ---- */
.ccb-blocked-frame { display: none !important; }
.ccb-frame-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 180px;
  padding: 24px;
  background: #f3f4f6;
  border: 1px dashed #9ca3af;
  border-radius: 8px;
  color: #374151;
  font-size: 14px;
  text-align: center;
}
.ccb-frame-placeholder button {
  background: var(--ccb-primary, #7c2d2d);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
}
.ccb-frame-placeholder button:hover { opacity: 0.9; }
