.sgi-cookiebar {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 140;
  background: var(--sgi-ink);
  color: var(--sgi-paper);
  border: 1px solid rgba(244, 239, 230, 0.2);
  border-radius: var(--sgi-radius-lg);
  padding: 1.2rem 1.4rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.2rem;
  align-items: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  max-width: 1040px;
  margin-inline: auto;
}

.sgi-cookiebar[hidden] {
  display: none;
}

.sgi-cookiebar__text h2 {
  font-size: 1rem;
  color: var(--sgi-white);
  margin-bottom: 0.3rem;
}

.sgi-cookiebar__text p {
  font-size: 0.84rem;
  color: rgba(244, 239, 230, 0.8);
  margin: 0;
  max-width: 60ch;
}

.sgi-cookiebar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

.sgi-cookiebar__actions .sgi-btn {
  font-size: 0.78rem;
  padding: 0.65rem 1.1rem;
}

.sgi-consent-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(16, 20, 38, 0.62);
}

.sgi-consent-modal[hidden] {
  display: none;
}

.sgi-consent-panel {
  background: var(--sgi-paper);
  color: var(--sgi-text);
  border-radius: var(--sgi-radius-lg);
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.6rem;
}

.sgi-consent-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.sgi-consent-panel__close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--sgi-line);
  background: var(--sgi-white);
  border-radius: var(--sgi-radius);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.sgi-consent-option {
  border: var(--sgi-border);
  border-radius: var(--sgi-radius);
  background: var(--sgi-white);
  padding: 1rem 1.2rem;
  margin-bottom: 0.8rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  align-items: start;
}

.sgi-consent-option h3 {
  font-size: 0.98rem;
  margin-bottom: 0.25rem;
}

.sgi-consent-option p {
  font-size: 0.82rem;
  color: var(--sgi-muted);
  margin: 0;
}

.sgi-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}

.sgi-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.sgi-switch__slider {
  position: absolute;
  inset: 0;
  background: var(--sgi-line);
  border-radius: 30px;
  transition: background 0.2s ease;
}

.sgi-switch__slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: var(--sgi-white);
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.sgi-switch input:checked + .sgi-switch__slider {
  background: var(--sgi-mint-deep);
}

.sgi-switch input:checked + .sgi-switch__slider::before {
  transform: translateX(20px);
}

.sgi-switch input:disabled + .sgi-switch__slider {
  background: var(--sgi-violet);
  cursor: not-allowed;
}

.sgi-switch input:focus-visible + .sgi-switch__slider {
  outline: 3px solid var(--sgi-violet);
  outline-offset: 2px;
}

.sgi-consent-panel__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 1.2rem;
}

@media (max-width: 640px) {
  .sgi-cookiebar {
    grid-template-columns: 1fr;
  }
  .sgi-cookiebar__actions {
    justify-content: stretch;
  }
  .sgi-cookiebar__actions .sgi-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}
