/*
 * Sunny Island Consent Management – Styling
 * -----------------------------------------
 * Farben & Maße exakt aus der bisherigen Cookiebot-Konfiguration der Domain
 * übernommen (Akzent #8a652b, weißer Dialog, schwarzer Text, 8px Radius).
 * Alle Klassen mit .sic- präfixiert und stark gescoped, damit Joomla/UIkit
 * das Banner nicht beeinflusst. Farben über CSS-Variablen rebrandbar.
 */
.sic-root {
  --sic-accent: #8a652b;          /* Cookiebot customColors.acceptBackground / highlight */
  --sic-accent-hover: #6f5122;
  --sic-text: #000000;            /* customColors.text */
  --sic-heading: #000000;
  --sic-border: #d9d4cd;
  --sic-bg: #ffffff;              /* customColors.background */
  --sic-shade: #eeeeee;           /* customColors.shade (Detailbox/Tabellenkopf) */
  --sic-muted: #5a5a5a;
  --sic-radius: 8px;

  position: fixed;
  inset: 0;
  z-index: 2147483646;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: .1px;
  color: var(--sic-text);
}
.sic-lock { overflow: hidden; }

/* Overlay */
.sic-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.5);
}

/* Dialog */
.sic-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px);
  max-width: 700px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--sic-bg);
  border-radius: var(--sic-radius);
  box-shadow: 0 32px 68px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  box-sizing: border-box;
}
.sic-dialog *,
.sic-dialog *::before,
.sic-dialog *::after { box-sizing: border-box; }

/* Kopf: Logo + Tabs */
.sic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px 0;
  flex-wrap: wrap;
}
.sic-logo { height: 36px; width: auto; }
.sic-tabs { display: flex; gap: 4px; }
.sic-tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 10px;
  margin: 0;
  font: inherit;
  color: var(--sic-muted);
  cursor: pointer;
}
.sic-tab.is-active { color: var(--sic-accent); border-bottom-color: var(--sic-accent); }

/* Körper */
.sic-body {
  padding: 16px 24px;
  overflow-y: auto;
}
.sic-body h2 {
  margin: 4px 0 10px;
  font-size: 18px;
  color: var(--sic-heading);
  font-weight: 600;
}
.sic-body p { margin: 0 0 12px; }
.sic-pane { display: none; }
.sic-pane.is-active { display: block; }

.sic-link { color: var(--sic-accent); text-decoration: underline; }
.sic-link:hover { color: var(--sic-accent-hover); }

/* Kategorie-Schalter (Consent-Tab) */
.sic-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 10px;
}
.sic-cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--sic-heading);
}
.sic-cat input { position: absolute; opacity: 0; width: 0; height: 0; }
.sic-switch {
  position: relative;
  width: 38px;
  height: 20px;
  border-radius: 20px;
  background: #c4c0b8;
  transition: background .15s;
  flex: 0 0 auto;
}
.sic-switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s;
}
.sic-cat input:checked + .sic-switch { background: var(--sic-accent); }
.sic-cat input:checked + .sic-switch::after { transform: translateX(18px); }
.sic-cat--locked .sic-switch { background: var(--sic-accent); opacity: .55; }
.sic-cat--locked { cursor: default; }
.sic-cat-label { font-weight: 500; }

/* Details-Tab */
.sic-detail { padding: 14px 0; border-bottom: 1px solid var(--sic-border); }
.sic-detail:last-child { border-bottom: 0; }
.sic-detail-head { margin-bottom: 6px; }
.sic-detail-desc { color: var(--sic-text); margin: 4px 0 10px; }
.sic-empty { color: var(--sic-muted); margin: 0; }

.sic-cookietable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}
.sic-cookietable th,
.sic-cookietable td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid #cfcabf;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.sic-cookietable th { font-weight: 600; color: var(--sic-heading); }

.sic-cid { font-size: 13px; color: var(--sic-muted); }
.sic-cid code { background: var(--sic-shade); padding: 1px 5px; border-radius: 4px; }

/* Fuß: Buttons + Branding */
.sic-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--sic-border);
  flex-wrap: wrap;
}
.sic-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.sic-btn {
  appearance: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: var(--sic-radius);
  border: 1px solid transparent;
  line-height: 1.2;
}
/* "Ablehnen" & "Auswahl erlauben": weiß, brauner Rahmen, schwarzer Text (Cookiebot) */
.sic-btn--outline { background: #fff; color: #000; border-color: var(--sic-accent); }
.sic-btn--outline:hover { background: rgba(138, 101, 43, .08); }
/* "Alle zulassen": vollflächig braun, weißer Text (Cookiebot) */
.sic-btn--primary { background: var(--sic-accent); color: #fff; border-color: var(--sic-accent); }
.sic-btn--primary:hover { background: var(--sic-accent-hover); border-color: var(--sic-accent-hover); }

.sic-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--sic-muted);
}
.sic-brand img { height: 18px; width: auto; opacity: .85; }

/* Floating-Widget zum erneuten Öffnen */
.sic-widget {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 2147483645;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  background: var(--sic-accent, #8a652b);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sic-widget:hover { background: #6f5122; }

/* Mobil: Dialog als untere Sheet, Buttons gestapelt */
@media (max-width: 560px) {
  .sic-dialog {
    left: 0; right: 0; top: auto; bottom: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--sic-radius) var(--sic-radius) 0 0;
  }
  .sic-head { padding: 14px 16px 0; }
  .sic-body { padding: 14px 16px; }
  .sic-foot { padding: 14px 16px; }
  .sic-buttons { width: 100%; flex-direction: column-reverse; }
  .sic-btn { width: 100%; }
  .sic-brand { width: 100%; justify-content: center; }
}
