/* Cookie-баннер sad-365.ru — полоса на всю ширину, минимальная высота */

:root {
  --cb-bg: #ffffff;
  --cb-text: #1a1a1a;
  --cb-text-muted: #6b6b6b;
  --cb-border: rgba(0, 0, 0, 0.1);
  --cb-border-strong: rgba(0, 0, 0, 0.14);
  --cb-accent: #3a7d22;
  --cb-accent-text: #ffffff;
  --cb-radius-sm: 6px;
}

.cb-root {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: none;
  width: 100%;
  padding: 0;
  pointer-events: none;
}

.cb-root.cb-show {
  display: flex;
}

.cb-card {
  pointer-events: auto;
  width: 100%;
  max-width: none;
  background: var(--cb-bg);
  color: var(--cb-text);
  border: none;
  border-top: 1px solid var(--cb-border-strong);
  border-radius: 0;
  padding: 8px max(12px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px))
    max(12px, env(safe-area-inset-left, 0px));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
}

.cb-root.cb-dismissed {
  display: none !important;
  visibility: hidden;
}

.cb-root.cb-animate-in .cb-card {
  transform: translateY(100%);
  opacity: 0;
}

.cb-root.cb-animate-in.cb-visible .cb-card {
  transform: translateY(0);
  opacity: 1;
}

/* Компактная полоса: текст и кнопки в одну линию */
.cb-card:not(.cb-mode-settings) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.cb-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  flex: 1 1 220px;
  min-width: 0;
}

.cb-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.cb-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--cb-text);
}

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

.cb-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin: 0;
}

.cb-btn {
  flex: 0 0 auto;
  min-width: 0;
  padding: 6px 11px;
  font-size: 12px;
  line-height: 1.2;
  font-family: inherit;
  border-radius: var(--cb-radius-sm);
  border: 1px solid var(--cb-border-strong);
  background: var(--cb-bg);
  color: var(--cb-text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.05s ease;
}

.cb-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.cb-btn:active {
  transform: scale(0.985);
}

.cb-btn--primary {
  background: var(--cb-accent);
  color: var(--cb-accent-text);
  border-color: var(--cb-accent);
}

.cb-btn--primary:hover {
  opacity: 0.92;
  background: var(--cb-accent);
}

/* Панель настроек — на всю ширину, компактнее обычного варианта */
.cb-settings {
  display: none;
  width: 100%;
}

.cb-card.cb-mode-settings {
  display: block;
  padding: 10px max(12px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px))
    max(12px, env(safe-area-inset-left, 0px));
}

.cb-card.cb-mode-settings .cb-head,
.cb-card.cb-mode-settings .cb-actions {
  display: none;
}

.cb-card.cb-mode-settings .cb-settings {
  display: block;
}

.cb-settings-title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
}

.cb-settings-sub {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--cb-text-muted);
  line-height: 1.35;
}

.cb-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.cb-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-sm);
  margin-bottom: 0;
}

.cb-cat-name {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.cb-cat-desc {
  margin: 0;
  font-size: 10px;
  color: var(--cb-text-muted);
  line-height: 1.25;
}

.cb-switch {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 20px;
}

.cb-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cb-slider {
  position: absolute;
  inset: 0;
  background: #cfcfcf;
  border-radius: 999px;
  transition: background 0.18s ease;
}

.cb-slider::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.cb-switch input:checked + .cb-slider {
  background: var(--cb-accent);
}

.cb-switch input:checked + .cb-slider::before {
  transform: translateX(16px);
}

.cb-switch input:disabled + .cb-slider {
  opacity: 0.55;
  cursor: not-allowed;
}

.cb-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
}

@media (max-width: 640px) {
  .cb-card:not(.cb-mode-settings) {
    gap: 6px 8px;
  }

  .cb-head {
    flex: 1 1 100%;
  }

  .cb-actions {
    flex: 1 1 100%;
    justify-content: stretch;
  }

  .cb-btn {
    flex: 1 1 auto;
    white-space: normal;
    text-align: center;
    padding: 7px 8px;
  }

  .cb-settings-grid {
    grid-template-columns: 1fr;
  }
}
