/* Cookie-баннер темы: нижняя плашка и floating-попап. */

.kh-cookie {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.kh-cookie[hidden] { display: none; }

.kh-cookie__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  width: min(720px, 100%);
  padding: 18px 20px;
  border: 1px solid var(--kh-border, #e5e7eb);
  border-radius: var(--kh-radius-lg, 16px);
  background: var(--kh-cookie-bar-bg, var(--kh-surface, #fff));
  color: var(--kh-cookie-bar-text, var(--kh-text, #1d2327));
  box-shadow: 0 18px 50px -20px rgba(16, 24, 40, .35);
  pointer-events: auto;
}

.kh-cookie__title { display: block; margin-bottom: 4px; font-size: 15px; }
.kh-cookie__text p { margin: 0; font-size: 13px; line-height: 1.5; color: inherit; opacity: .75; }
.kh-cookie__text a { color: var(--kh-accent, #ff6400); }
.kh-cookie__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.kh-cookie__btn {
  padding: var(--kh-btn-pad-y, 9px) var(--kh-btn-pad-x, 16px);
  border: 1px solid currentColor;
  border-radius: var(--kh-btn-radius, 10px);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.kh-cookie__btn:hover { border-color: var(--kh-accent, #ff6400); }

.kh-cookie__btn--primary {
  border-color: var(--kh-cookie-bar-btn-bg, var(--kh-accent, #ff6400));
  background: var(--kh-cookie-bar-btn-bg, var(--kh-accent, #ff6400));
  color: var(--kh-cookie-bar-btn-text, #fff);
}

/* --- Floating-попап (как Custom Cookie Popup) ---------------------------- */

.kh-cookie-popup {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  width: 56px;
  height: 56px;
}

.kh-cookie-popup[hidden] { display: none; }

.kh-cookie-popup__modal {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(360px, calc(100vw - 32px));
  padding: 24px 26px 20px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 16px;
  background: var(--kh-cookie-modal-bg, #fff);
  color: var(--kh-cookie-text, #1d2327);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(calc(100% + 40px));
  transition: transform .4s cubic-bezier(.16, 1, .3, 1), opacity .3s ease, visibility .4s;
}

.kh-cookie-popup.is-active .kh-cookie-popup__modal {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.kh-cookie-popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px;
  border: 0;
  background: none;
  color: #888;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.kh-cookie-popup__close:hover { color: #111; }

.kh-cookie-popup__title {
  margin: 0 0 10px;
  padding-right: 24px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--kh-cookie-text, #1d2327);
}

.kh-cookie-popup__text {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--kh-cookie-text, #555);
}

.kh-cookie-popup__text a { color: var(--kh-accent, #ff6400); }

.kh-cookie-popup__btn,
.kh-cookie-popup__btn-secondary {
  display: block;
  width: 100%;
  padding: 12px 18px;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.kh-cookie-popup__btn {
  background: var(--kh-cookie-btn-bg, #ff6400);
  color: var(--kh-cookie-btn-text, #fff);
}

.kh-cookie-popup__btn:hover { opacity: .92; }

.kh-cookie-popup__btn-secondary {
  margin-top: 10px;
  background: var(--kh-cookie-forever-bg, #f3f4f6);
  color: var(--kh-cookie-forever-text, #1a1a1a);
}

.kh-cookie-popup__tab {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 50%;
  background: var(--kh-cookie-tab-bg, #fff);
  color: var(--kh-cookie-svg, #1a1a1a);
  box-shadow: 0 0 12px rgba(0, 0, 0, .17);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: scale(0);
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .2s ease, visibility .3s;
}

.kh-cookie-popup.is-minimized .kh-cookie-popup__tab {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.kh-cookie-popup__tab svg { width: 30px; height: 30px; }
.kh-cookie-popup__tab:hover { transform: scale(1.08); }

.kh-cookie-popup--rect .kh-cookie-popup__tab {
  right: 24px;
  bottom: 0;
  width: auto;
  height: auto;
  padding: 8px 16px;
  border-radius: 8px 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--kh-cookie-svg, #1a1a1a);
}

.kh-cookie-popup--rect .kh-cookie-popup__rect { display: inline; }

@media (max-width: 600px) {
  .kh-cookie { right: 12px; bottom: 12px; left: 12px; }
  .kh-cookie__inner { flex-direction: column; align-items: stretch; }
  .kh-cookie__actions { justify-content: flex-end; }
  .kh-cookie-popup { right: 14px; bottom: 14px; }
  .kh-cookie-popup--rect .kh-cookie-popup__tab { right: 14px; }
}
