.modal,
.eurasian-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.is-active,
.eurasian-modal.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.eurasian-modal-is-locked {
  overscroll-behavior: none;
}

.modal__overlay,
.eurasian-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.is-active .modal__overlay,
.eurasian-modal.is-active .eurasian-modal__overlay {
  opacity: 1;
}

.modal__container,
.eurasian-modal__container {
  position: relative;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
  z-index: 1;
}

.modal.is-active .modal__container,
.eurasian-modal.is-active .eurasian-modal__container {
  transform: translateY(0);
}

.modal__container--small,
.eurasian-modal__container[data-eurasian-modal-size="small"] {
  max-width: 400px;
}

.modal__container--large,
.eurasian-modal__container[data-eurasian-modal-size="large"] {
  max-width: 800px;
}

.modal__close,
.eurasian-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 24px;
  height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex: 0 0 auto;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  line-height: 1;
  transition: color 0.3s ease;
}

.modal__close:hover,
.eurasian-modal__close:hover {
  color: #000;
}

.modal__header {
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

.modal__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
}

.modal__footer {
  padding: 16px 24px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal__button {
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal__button--primary {
  background-color: #0072de;
  color: #fff;
  border: none;
}

.modal__button--primary:hover {
  background-color: #0056b3;
}

.modal__button--secondary {
  background-color: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
}

.modal__button--secondary:hover {
  background-color: #e5e5e5;
}

.eurasian-modal {
  z-index: 10000;
  padding: 1.25rem;
}

.eurasian-modal__container {
  width: min(100%, 56.25rem);
  max-width: 56.25rem;
  max-height: calc(100vh - 2.5rem);
  padding: 0;
  overflow: hidden;
  border-radius: 1.25rem;
  background: #111827;
}

.eurasian-modal__container[data-eurasian-modal-size="video"] {
  width: min(100%, 56.25rem);
  max-width: 56.25rem;
}

.eurasian-modal__title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.eurasian-modal__close {
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-radius: 50%;
  color: #fff;
  background: rgba(17, 24, 39, 0.72);
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  transform: translateZ(0);
}

.eurasian-modal__close span {
  display: none;
}

.eurasian-modal__close::before,
.eurasian-modal__close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.45rem;
  height: 0.1875rem;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
}

.eurasian-modal__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.eurasian-modal__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.eurasian-modal__close:hover {
  color: #fff;
  background: rgba(17, 24, 39, 0.92);
}

.eurasian-modal__media {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111827;
}

.eurasian-modal__iframe,
.eurasian-modal__video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #111827;
}

.eurasian-modal__iframe[hidden],
.eurasian-modal__video[hidden] {
  display: none;
}

/* Анимации */
@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  from {
    transform: translateY(20px);
  }
  to {
    transform: translateY(0);
  }
}

/* Адаптивность */
@media (max-width: 576px) {
  .modal__container,
  .eurasian-modal__container {
    width: 95%;
    margin: 10px;
  }

  .eurasian-modal {
    padding: 0.75rem;
  }

  .eurasian-modal__container {
    width: 100%;
    max-height: calc(100vh - 1.5rem);
    margin: 0;
    border-radius: 0.9375rem;
  }

  .modal__header {
    padding: 16px 20px;
  }

  .modal__footer {
    padding: 12px 20px;
    flex-direction: column;
  }

  .modal__button {
    width: 100%;
  }
}
