/* Сетка карточек моделей */
.scma-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.scma-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 260px;
  background: #111;
  color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}

.scma-card img {
  display: block;
  width: 100%;
  height: auto;
}

.scma-title {
  font-weight: 600;
  font-size: 15px;
  padding: 8px 10px 0;
}

.scma-meta {
  font-size: 12px;
  padding: 2px 10px;
  color: #ccc;
}

.scma-tags {
  font-size: 12px;
  padding: 4px 10px 8px;
  color: #9cf;
}

.scma-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px 10px;
}

.scma-btn {
  display: inline-block;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
}

.scma-btn-primary {
  background: #e91e63;
  color: #fff;
}

.scma-btn-secondary {
  background: #333;
  color: #fff;
}

.scma-btn:hover {
  opacity: 0.9;
}

/* Обёртка шорткода */
.scma-wrapper {
  margin: 10px 0 20px;
}

/* Модальное окно */

.scma-modal {
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: none; /* по умолчанию скрыто, управляется JS */
}

.scma-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.7);
}

/* центрированное окно */
.scma-modal-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 1000px;
  width: 90%;
  max-height: 90vh;
  background: #fff;
  padding: 10px;
  border-radius: 6px;
  box-sizing: border-box;
  overflow: hidden;
}

.scma-modal-close {
  position: absolute;
  right: 10px;
  top: 10px;
  border: 0;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.scma-modal-content {
  display: flex;
  flex-direction: column; /* СТРОГО сверху вниз */
  gap: 10px;
  margin-top: 30px;
}

/* Вставки из настроек — отдельные блоки над и под player+chat */
.scma-modal-top,
.scma-modal-bottom {
  width: 100%;
}

.scma-modal-top {
  margin-bottom: 10px;
}

.scma-modal-bottom {
  margin-top: 10px;
}

/* Контейнер для player + chat в одну строку */
.scma-modal-middle {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* сами блоки player/chat */
.scma-modal-player,
.scma-modal-chat {
  flex: 1 1 320px;
  min-width: 260px;
}

/* iframe растягиваем по ширине */
.scma-modal-player iframe,
.scma-modal-chat iframe {
  width: 100%;
}

@media (min-width: 768px) {
  .scma-modal-content {
    flex-direction: column;
  }

  .scma-modal-player,
  .scma-modal-chat {
    width: 100%;
  }

  .scma-modal-player iframe,
  .scma-modal-chat iframe {
    width: 100%;
  }
}

/*сетка*/

.scma-pagination {
    margin-top: 16px;
    text-align: center;
}

.scma-page-btn {
    display: inline-block;
    margin: 0 3px;
    padding: 6px 10px;
    border-radius: 4px;
    background: #222;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
}

.scma-page-btn:hover {
    background: #444;
}

.scma-page-current {
    background: #e91e63;
    font-weight: 600;
}

.scma-page-disabled {
    opacity: 0.4;
    cursor: default;
}

.scma-page-prev,
.scma-page-next {
    font-weight: 600;
}

.scma-page-dots {
    margin: 0 4px;
    color: #999;
}

/* Небольшая адаптация сетки */

@media (min-width: 480px) {
  .scma-card {
    max-width: 220px;
  }
}

@media (min-width: 768px) {
  .scma-grid {
    justify-content: flex-start;
  }
}