/*! @aisohub/cookie-banner — scoped styles. All selectors are namespaced
   under .aiso-cb to avoid colliding with host site CSS. Themable via the
   CSS variables set on the root element. */

.aiso-cb {
  --aiso-cb-bg: #ffffff;
  --aiso-cb-fg: #1a1a1a;
  --aiso-cb-muted: #4a4a4a;
  --aiso-cb-border: rgba(0, 0, 0, 0.12);
  --aiso-cb-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
  --aiso-cb-brand: #0a1628;
  --aiso-cb-brand-fg: #ffffff;
  --aiso-cb-radius: 14px;
  --aiso-cb-z: 2147483640;

  position: fixed;
  z-index: var(--aiso-cb-z);
  font-family:
    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--aiso-cb-fg);
}

.aiso-cb,
.aiso-cb * {
  box-sizing: border-box;
}

.aiso-cb[hidden] {
  display: none !important;
}

/* ----- Banner card (corner placement) ----- */

.aiso-cb__card {
  background: var(--aiso-cb-bg);
  color: var(--aiso-cb-fg);
  border: 1px solid var(--aiso-cb-border);
  border-radius: var(--aiso-cb-radius);
  box-shadow: var(--aiso-cb-shadow);
  padding: 20px 22px;
  max-width: 420px;
  width: calc(100vw - 32px);
}

.aiso-cb--bottom-left .aiso-cb__card {
  position: fixed;
  bottom: 16px;
  left: 16px;
}
.aiso-cb--bottom-right .aiso-cb__card {
  position: fixed;
  bottom: 16px;
  right: 16px;
}
.aiso-cb--bottom-center .aiso-cb__card {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
}
.aiso-cb--bottom-bar .aiso-cb__card {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: none;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
}

.aiso-cb__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--aiso-cb-fg);
}

.aiso-cb__body {
  margin: 0 0 14px;
  color: var(--aiso-cb-muted);
  font-size: 13.5px;
}

.aiso-cb__body a {
  color: var(--aiso-cb-brand);
  text-decoration: underline;
}

.aiso-cb__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.aiso-cb__btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--aiso-cb-border);
  background: transparent;
  color: var(--aiso-cb-fg);
  border-radius: 8px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.aiso-cb__btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.aiso-cb__btn:active {
  transform: translateY(1px);
}

.aiso-cb__btn--primary {
  background: var(--aiso-cb-brand);
  color: var(--aiso-cb-brand-fg);
  border-color: var(--aiso-cb-brand);
}

.aiso-cb__btn--primary:hover {
  filter: brightness(0.92);
  background: var(--aiso-cb-brand);
}

/* ----- Modal (preferences) ----- */

.aiso-cb__modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 22, 40, 0.55);
  padding: 20px;
}

.aiso-cb__modal-card {
  background: var(--aiso-cb-bg, #ffffff);
  color: var(--aiso-cb-fg, #1a1a1a);
  border: 1px solid var(--aiso-cb-border, rgba(0, 0, 0, 0.12));
  border-radius: var(--aiso-cb-radius, 14px);
  box-shadow: var(--aiso-cb-shadow, 0 10px 40px rgba(0, 0, 0, 0.18));
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px 26px;
}

.aiso-cb__modal-title {
  color: var(--aiso-cb-fg, #1a1a1a);
}

.aiso-cb__modal-body {
  color: var(--aiso-cb-muted, #4a4a4a);
}

.aiso-cb__cat-title {
  color: var(--aiso-cb-fg, #1a1a1a);
}

.aiso-cb__cat-desc {
  color: var(--aiso-cb-muted, #4a4a4a);
}

.aiso-cb__always {
  color: var(--aiso-cb-muted, #4a4a4a);
}

.aiso-cb__modal-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.aiso-cb__modal-body {
  margin: 0 0 16px;
  color: var(--aiso-cb-muted);
  font-size: 13.5px;
}

.aiso-cb__cat {
  border-top: 1px solid var(--aiso-cb-border);
  padding: 14px 0;
}
.aiso-cb__cat:last-of-type {
  border-bottom: 1px solid var(--aiso-cb-border);
}

.aiso-cb__cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.aiso-cb__cat-title {
  font-weight: 600;
  font-size: 14px;
}

.aiso-cb__cat-desc {
  margin: 6px 0 0;
  color: var(--aiso-cb-muted);
  font-size: 13px;
}

.aiso-cb__always {
  font-size: 12px;
  color: var(--aiso-cb-muted);
  font-style: italic;
}

/* Toggle */
.aiso-cb__toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
}
.aiso-cb__toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.aiso-cb__toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cfd5dd;
  border-radius: 22px;
  transition: background 0.15s ease;
}
.aiso-cb__toggle-slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.aiso-cb__toggle input:checked + .aiso-cb__toggle-slider {
  background: var(--aiso-cb-brand);
}
.aiso-cb__toggle input:checked + .aiso-cb__toggle-slider::before {
  transform: translateX(16px);
}
.aiso-cb__toggle input:focus-visible + .aiso-cb__toggle-slider {
  outline: 2px solid var(--aiso-cb-brand);
  outline-offset: 2px;
}

.aiso-cb__modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  justify-content: flex-end;
}

@media (max-width: 480px) {
  .aiso-cb__card,
  .aiso-cb__modal-card {
    padding: 16px 18px;
  }
  .aiso-cb__btn {
    flex: 1 1 auto;
    text-align: center;
  }
  .aiso-cb__modal-actions {
    justify-content: stretch;
  }
}
