/* ═══════════════════════════════════════════
   KickstartWeb Consent v2 - Banner + Preferences
   ═══════════════════════════════════════════ */

/* ─── Overlay ─── */

.kc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  z-index: 999998;
  transition: opacity 0.3s;
}

.kc-overlay.kc-hidden {
  opacity: 0;
  pointer-events: none;
}

/* ─── Banner card ─── */

.kc-banner {
  position: fixed;
  z-index: 999999;
  background: #fff;
  color: #333;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  padding: 28px 32px;
  max-width: 520px;
  width: calc(100% - 32px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.kc-banner.kc-bottom-left {
  bottom: 16px;
  left: 16px;
}

.kc-banner.kc-bottom-right {
  bottom: 16px;
  right: 16px;
}

.kc-banner.kc-bottom {
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 100%;
  border-radius: 0;
}

.kc-banner.kc-hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.kc-banner-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
}

.kc-banner-text {
  margin: 0 0 20px;
  color: #555;
  font-size: 14px;
}

/* ─── Buttons ─── */

.kc-banner-buttons {
  display: flex;
  gap: 10px;
}

.kc-banner-buttons .kc-btn {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
}

.kc-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
  white-space: nowrap;
  text-align: center;
}

.kc-btn:hover {
  opacity: 0.85;
}

.kc-btn.kc-btn-filled {
  color: #fff !important;
}

.kc-btn-outline {
  background: transparent;
  border: 2px solid;
}

.kc-btn-outline:hover {
  opacity: 0.7;
}

.kc-btn-full {
  flex: 1;
  min-width: 0;
}

/* ─── Preferences panel ─── */

.kc-prefs {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1000000;
  background: #fff;
  color: #333;
  width: 100%;
  max-width: 580px;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s ease;
  overflow: hidden;
}

.kc-prefs.kc-prefs-visible {
  transform: translateX(0);
}

.kc-prefs.kc-hidden {
  transform: translateX(100%);
}

.kc-prefs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.kc-prefs-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
}

.kc-prefs-close {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kc-prefs-close:hover {
  background: #f3f4f6;
}

.kc-prefs-desc {
  padding: 20px 28px;
  color: #555;
  flex-shrink: 0;
}

.kc-prefs-desc p {
  margin: 0 0 12px;
}

.kc-prefs-desc p:last-child {
  margin-bottom: 0;
}

/* ─── Cookie categories ─── */

.kc-prefs-categories {
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid #e5e7eb;
}

.kc-cat {
  border-bottom: 1px solid #e5e7eb;
}

.kc-cat-header {
  display: flex;
  align-items: center;
  padding: 16px 28px;
  cursor: pointer;
  user-select: none;
  gap: 12px;
}

.kc-cat-header:hover {
  background: #f9fafb;
}

.kc-cat-arrow {
  font-size: 18px;
  color: #9ca3af;
  transition: transform 0.2s;
  width: 14px;
  flex-shrink: 0;
}

.kc-cat-open > .kc-cat-header .kc-cat-arrow {
  transform: rotate(90deg);
}

.kc-cat-label {
  font-weight: 600;
  color: #1a1a1a;
  flex: 1;
}

.kc-cat-right {
  flex-shrink: 0;
}

.kc-cat-badge {
  font-size: 13px;
  font-weight: 600;
}

.kc-cat-desc {
  display: none;
  padding: 0 28px 16px 54px;
  color: #666;
}

.kc-cat-open > .kc-cat-desc {
  display: block;
}

.kc-cat-desc p {
  margin: 0;
}

/* ─── Toggle switch ─── */

.kc-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.kc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.kc-toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 24px;
  transition: background 0.3s;
}

.kc-toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}

.kc-toggle input:checked + .kc-toggle-slider {
  background: #4858d4;
}

.kc-toggle input:checked + .kc-toggle-slider::before {
  transform: translateX(20px);
}

/* ─── Prefs footer ─── */

.kc-prefs-footer {
  display: flex;
  gap: 10px;
  padding: 16px 28px;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

/* ─── Mobile ─── */

@media (max-width: 640px) {
  .kc-banner {
    max-width: 100%;
    width: 100%;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    border-radius: 12px 12px 0 0;
    padding: 24px 20px;
  }

  .kc-banner-buttons {
    flex-direction: column;
  }

  .kc-banner-buttons .kc-btn {
    width: 100%;
  }

  .kc-prefs {
    max-width: 100%;
  }

  .kc-prefs-footer {
    flex-direction: column;
  }

  .kc-prefs-footer .kc-btn {
    width: 100%;
  }

  .kc-prefs-header {
    padding: 16px 20px;
  }

  .kc-prefs-desc {
    padding: 16px 20px;
  }

  .kc-cat-header {
    padding: 14px 20px;
  }

  .kc-cat-desc {
    padding: 0 20px 14px 46px;
  }

  .kc-prefs-footer {
    padding: 12px 20px;
  }
}
