/* ---------- Cookie consent banner (152-ФЗ) ---------- */

.cookie-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  background: var(--color-white);
  border-top: 1px solid rgba(24, 24, 24, 0.1);
  box-shadow: 0 -8px 32px rgba(24, 24, 24, 0.12);
  padding: 24px max(24px, env(safe-area-inset-bottom, 0px)) calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.cookie-consent--visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cookie-consent__inner {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.cookie-consent__text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-black);
  max-width: 720px;
}

.cookie-consent__link {
  text-decoration: underline;
  white-space: nowrap;
}

.cookie-consent__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.cookie-btn {
  padding: 12px 20px;
  border-radius: 8px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cookie-btn--primary {
  background: var(--color-purple);
  color: var(--color-white);
}

.cookie-btn--primary:hover {
  background: var(--color-purple-active);
}

.cookie-btn--outline {
  background: transparent;
  color: var(--color-black);
  border: 1px solid rgba(24, 24, 24, 0.2);
}

.cookie-btn--outline:hover {
  border-color: var(--color-black);
}

.cookie-btn--ghost {
  background: transparent;
  color: var(--color-gray-blue);
  text-decoration: underline;
}

.cookie-btn--ghost:hover {
  color: var(--color-black);
}

/* ---------- Cookie settings modal ---------- */

.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(24, 24, 24, 0.6);
}

.cookie-modal--visible {
  display: flex;
}

.cookie-modal__panel {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--color-white);
  border-radius: 16px;
  padding: 32px;
}

.cookie-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.cookie-modal__title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 500;
  font-size: 20px;
  color: var(--color-black);
}

.cookie-modal__close {
  font-size: 28px;
  line-height: 1;
  color: var(--color-gray-blue);
}

.cookie-modal__close:hover {
  color: var(--color-black);
}

.cookie-modal__intro {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-gray-blue);
  margin-bottom: 24px;
}

.cookie-modal__category {
  padding: 16px 0;
  border-top: 1px solid rgba(24, 24, 24, 0.1);
}

.cookie-modal__category:last-of-type {
  border-bottom: 1px solid rgba(24, 24, 24, 0.1);
}

.cookie-modal__category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.cookie-modal__category-title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--color-black);
}

.cookie-modal__category-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-gray-blue);
}

.cookie-modal__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
}

.cookie-modal__policy-link {
  font-size: 13px;
  color: var(--color-gray-blue);
  text-decoration: underline;
}

.cookie-modal__policy-link:hover {
  color: var(--color-black);
}

.cookie-modal__footer-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Toggle switch ---------- */

.cookie-toggle {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

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

.cookie-toggle__track {
  position: absolute;
  inset: 0;
  background: rgba(97, 107, 122, 0.3);
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

.cookie-toggle__track::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-white);
  transition: transform 0.2s ease;
}

.cookie-toggle input:checked + .cookie-toggle__track {
  background: var(--color-purple);
}

.cookie-toggle input:checked + .cookie-toggle__track::before {
  transform: translateX(20px);
}

.cookie-toggle--disabled {
  cursor: not-allowed;
}

.cookie-toggle--disabled input {
  cursor: not-allowed;
}

.cookie-toggle--disabled .cookie-toggle__track {
  opacity: 0.6;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .cookie-consent__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .cookie-consent__text {
    max-width: none;
  }

  .cookie-consent__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .cookie-consent {
    padding: 20px 0;
  }

  .cookie-consent__inner {
    padding: 0 16px;
  }

  .cookie-consent__actions {
    width: 100%;
  }

  .cookie-btn {
    flex: 1 1 auto;
  }

  .cookie-modal__panel {
    padding: 24px 20px;
  }
}
