/**
 * Cookie banner для темы cookies-916 (Inston): PT Sans / Lato, #18212E, акцент #e18b1d, ссылки #007a99.
 * Подключайте после style.css. Карточка в правом нижнем углу, без затемнения страницы.
 */

#cookie-consent.cookie-consent {
  position: fixed !important;
  top: auto !important;
  left: auto !important;
  right: max(clamp(12px, 2.5vw, 22px), env(safe-area-inset-right, 0px)) !important;
  bottom: max(clamp(12px, 2.5vw, 22px), env(safe-area-inset-bottom, 0px)) !important;

  width: min(440px, calc(100vw - 24px)) !important;
  max-width: min(440px, calc(100vw - 24px)) !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;

  z-index: 2147483000 !important;

  display: block !important;
  overflow: visible !important;

  font-family: 'PT Sans', 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color: #f0f4f3;

  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;

  visibility: hidden;
  pointer-events: none;
}

#cookie-consent.cookie-consent.is-visible {
  visibility: visible !important;
  pointer-events: none !important;
}

#cookie-consent .cookie-consent__row {
  position: relative;
  z-index: 1;
  pointer-events: auto;

  width: 100%;
  max-width: none;
  max-height: min(78vh, calc(100dvh - 40px));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  margin: 0;

  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;

  background: #18212e !important;
  color: #f0f4f3 !important;
  border-radius: 6px !important;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(225, 139, 29, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  padding: 18px 18px 16px !important;

  transform: translate(10px, 18px) scale(0.98);
  opacity: 0;
  transition:
    transform 0.26s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.22s ease;
}

#cookie-consent.cookie-consent.is-visible .cookie-consent__row {
  transform: translate(0, 0) scale(1);
  opacity: 1;
}

.cookie-consent__main {
  min-width: 0;
}

.cookie-consent__title {
  margin: 0 0 8px 0;
  font-family: 'Lato', 'PT Sans', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e18b1d;
}

.cookie-consent__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(240, 244, 243, 0.92);
}

.cookie-consent__text a {
  color: #4db8cc;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-consent__text a:hover {
  color: #7ecedc;
  text-decoration: none;
}

.cookie-consent__actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.cookie-consent__actions--stack {
  flex-wrap: wrap;
}

.cookie-consent__actions a.cookie-consent__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.cookie-consent__btn {
  border: 0;
  border-radius: 4px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  font-family: 'PT Sans', sans-serif;
  letter-spacing: 0.02em;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.cookie-consent__btn--accept {
  color: #fff;
  background-color: #e18b1d;
  box-shadow: 0 4px 14px rgba(225, 139, 29, 0.35);
}

.cookie-consent__btn--accept:hover,
.cookie-consent__btn--accept:focus {
  background-color: #f09a2e;
  box-shadow: 0 2px 10px rgba(225, 139, 29, 0.25);
  outline: none;
}

.cookie-consent__btn--secondary {
  background-color: rgba(255, 255, 255, 0.08);
  color: #f0f4f3 !important;
  border: 1px solid rgba(0, 122, 153, 0.45);
  box-shadow: none;
}

.cookie-consent__btn--secondary:hover,
.cookie-consent__btn--secondary:focus {
  background-color: rgba(0, 122, 153, 0.2);
  border-color: rgba(0, 122, 153, 0.65);
  outline: none;
}

.cookie-consent__close {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: rgba(240, 244, 243, 0.55);
  cursor: pointer;
  line-height: 1;
  padding: 4px 6px;
  font-size: 22px;
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
}

.cookie-consent__close:hover,
.cookie-consent__close:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.cookie-consent__settings {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 122, 153, 0.25);
  display: none;
}

.cookie-consent__settings.is-open {
  display: block;
}

.cookie-consent__list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.cookie-consent__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.cookie-consent__item-text {
  min-width: 0;
}

.cookie-consent__label {
  font-weight: 700;
  font-size: 14px;
  margin: 0;
  color: #f0f4f3;
}

.cookie-consent__hint {
  margin: 4px 0 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: rgba(240, 244, 243, 0.72);
}

.cookie-consent__toggle {
  flex: 0 0 auto;
  margin-top: 2px;
}

.cookie-consent__toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #007a99;
  cursor: pointer;
}

.cookie-consent__toggle input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.cookie-consent__note {
  margin: 10px 0 0 0;
  font-size: 12px;
  color: rgba(240, 244, 243, 0.55);
}

@media (max-width: 480px) {
  #cookie-consent.cookie-consent {
    right: max(12px, env(safe-area-inset-right, 0px)) !important;
    bottom: max(12px, env(safe-area-inset-bottom, 0px)) !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
  }

  #cookie-consent .cookie-consent__row {
    max-height: min(82vh, calc(100dvh - 32px));
    padding: 16px 14px 14px !important;
  }

  .cookie-consent__btn {
    padding: 10px 14px;
    font-size: 12px;
  }
}
