.banners-container {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  padding: 20px;
  box-sizing: border-box;
  width: 100%;
}

.responsive-banner-container {
  position: relative;
  width: calc(50% - 10px);
  max-width: 580px;
  min-width: 280px;
  overflow: hidden;
}

.responsive-banner-image {
  width: 100%;
  height: auto;
  display: block;
  border: none;
}

/* Скрытый чекбокс для управления состоянием */
.erid-checkbox {
  display: none;
}

/* Кнопка для показа ERID */
.erid-toggle-btn {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background-color: rgba(255, 255, 255, 0.9);
  color: #333;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.6rem;
  line-height: 1;
  height: 22px;
  min-height: auto;
  z-index: 10;
  transition: background-color 0.3s ease;
  font-family: Arial, sans-serif;
  box-sizing: border-box;
}

.erid-toggle-btn:hover {
  background-color: white;
}

/* Скрываем кнопку "Показать ERID", когда чекбокс отмечен (окно открыто) */
.erid-checkbox:checked ~ .erid-toggle-btn {
  display: none;
}

/* Стили для оверлея с ERID */
.erid-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 24px 28px;
  border-radius: 10px;
  font-family: Arial, sans-serif;
  white-space: normal;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  word-wrap: break-word;
  line-height: 1.4;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Показываем оверлей с ERID, когда чекбокс отмечен */
.erid-checkbox:checked ~ .erid-overlay {
  opacity: 1;
  visibility: visible;
}

/* Контейнер для информации */
.erid-info {
  width: 100%;
}

/* Поле с информацией — улучшенное выравнивание */
.erid-field {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  margin-bottom: 0;
  flex-wrap: wrap;
  gap: 8px;
}

.erid-label {
  font-weight: bold;
  margin-right: 15px;
  min-width: 70px;
  color: #e0e0e0;
  flex-shrink: 0;
}

.erid-value {
  font-family: 'Courier New', monospace;
  text-align: left;
  flex-grow: 1;
  word-break: break-all;
  overflow-wrap: break-word;
}

/* Кнопка закрытия — справа по середине */
.close-erid-btn {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  font-weight: bold;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 21;
}

.close-erid-btn:hover {
  opacity: 0.8;
}

/* Адаптивность: на экранах меньше 768px — столбец, окно меньше */
@media (max-width: 768px) {
  .banners-container {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .responsive-banner-container {
    width: 100%;
    max-width: 100%;
    min-width: auto;
  }

  .erid-toggle-btn {
    bottom: 5px;
    left: 5px;
    padding: 3px 7px;
    font-size: 0.55rem;
    height: 20px;
  }

  /* Уменьшаем окно с ERID: */
  .erid-overlay {
    padding: 16px 20px; /* Уменьшены отступы */
    font-size: 0.75rem; /* Уменьшен размер шрифта */
    line-height: 1.3; /* Немного уменьшена высота строки */
    max-width: 75vw; /* Окно уже: 75 % ширины экрана вместо 90 % */
    max-height: 70vh; /* Ограничиваем высоту */
  }

  .erid-label {
    min-width: 60px;
    font-size: 0.8rem; /* Немного уменьшен размер шрифта */
  }
}

/* Адаптивность для смартфонов (меньше 480px) — ещё меньше окно */
@media (max-width: 480px) {
  .banners-container {
    padding: 10px;
  }

  .erid-toggle-btn {
    bottom: 4px;
    left: 4px;
    padding: 2px 6px;
    font-size: 0.5rem;
    height: 18px;
  }

  /* Ещё уменьшаем окно с ERID для смартфонов: */
  .erid-overlay {
    padding: 12px 16px; /* Минимальные отступы */
    font-size: 0.65rem; /* Минимальный размер шрифта для маленьких экранов */
    line-height: 1.25; /* Компактная высота строки */
    max-width: 70vw; /* Самое узкое окно: 70 % ширины экрана */
    max-height: 65vh; /* Самая строгая высота */
  }

  .erid-label {
    min-width: 55px;
    font-size: 0.7rem; /* Уменьшенный размер шрифта */
  }

  .erid-field {
    gap: 4px; /* Минимальный отступ при переносе */
  }
}