/* === SHOP MODAL FINAL FIX === */

#shopModal.modal {
  z-index: 1100;
  background: url('/static/images/backgrounds/modal.webp') no-repeat center center;
  background-size: 100% 100%;
  border-radius: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0; left: 0;
  display: none;
  overflow: hidden;
}

#shopModal .modal-content {
  position: absolute;
  top: 8%;              /* чуть ниже, чтобы не мешать заголовку */
  left: 15%;            /* ровно по центру: (100-70)/2 = 15% */
  width: 70%;           /* только центральные 70% */
  height: 76%;          /* снизу больше воздуха */
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
  background: none !important;
  border: none;
  box-shadow: none;
}

/* Крестик закрытия */
#shopModal .modal-close {
  position: absolute;
  top: 2vw;
  right: 0vw;
  width: 4vh;
  height: 4vh;
  background: url('/static/images/icons/crossicon.webp') no-repeat center center;
  background-size: contain;
  border: none;
  cursor: pointer;
  z-index: 20;
  color: transparent;
  font-size: 0;
  line-height: 0;
}
#shopModal .modal-close:hover { opacity: 0.8; }

#shopModal h2.modal-header {
  font-size: 20px;
  text-align: center;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  margin: 0 0 16px 0;
  padding: 0;
  flex-shrink: 0;
  top: 5%;
}

/* Табы */
.shop-tabs {
  display: flex;
  justify-content: center;
  gap: 20px;                      /* Увеличиваем расстояние между кнопками */
  margin-bottom: 18px;            /* Больше отступа вниз */
  background: none;
  position: relative;
  z-index: 2;
}

.shop-tab {
  position: relative;
  flex: none;
  min-width: 100px;               /* Шире кнопки */
  padding: 10px 0 10px 0;
  cursor: pointer;
  background: rgba(30,30,30,0.35); /* Полупрозрачная подложка */
  border-radius: 13px 13px 0 0;   /* Верх скруглён, низ нет */
  border: 1.5px solid #4e4e4e;
  border-bottom: none;
  font-size: 14px;
  color: #fff;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.2s, color 0.16s;
  outline: none;
  box-shadow: 0 3px 16px 0 rgba(0,0,0,0.09);
  opacity: 0.78;
  z-index: 1;
}

.shop-tab.active {
  background: rgba(180, 143, 72, 0.26); /* Жёлто-золотистый, почти прозрачный */
  color: #fff;
  font-weight: 700;
  opacity: 1;
  border-bottom: 2.5px solid #d0b665;
  z-index: 2;
}

/* Контент — ровно 2 колонки, никаких прокруток по горизонтали */
.shop-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: center;
  gap: 12px 10px;
  justify-items: center;
  align-items: flex-start;
  width: 100%;
  padding: 0 0 24px 0;
  box-sizing: border-box;
}

.shop-item {
  width: 100%;
  max-width: 140px;
  min-width: 0;
  height: 125px;
  box-sizing: border-box;
  border: 1.5px solid #4e4e4e;
  border-radius: 6px;
  background: none;
  color: #fff;
  padding: 6px 3px 7px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  position: relative;
  text-align: center;
  justify-content: flex-start;
  margin: 0;
  box-shadow: none;
  gap: 2px;
  overflow: hidden;
}

.shop-item.common    { border-color: #4e4e4e; }
.shop-item.uncommon  { border-color: #2faa3e; }
.shop-item.rare      { border-color: #2367b6; }
.shop-item.epic      { border-color: #863cc2; }
.shop-item.legendary { border-color: #cca305; }

.shop-item img {
  width: 34px;
  height: 34px;
  margin: 0 auto 3px auto;
  border-radius: 3px;
  background: #222;
  border: 1px solid #444a53;
  object-fit: contain;
}

/* Название — всегда две строки, с обрезкой */
.shop-item strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: 10px;
  font-weight: 600;
  margin: 0 0 2px 0;
  line-height: 1.12;
  min-height: 22px;
  max-height: 24px;
  white-space: normal;
  word-break: break-word;
}

/* Атрибут */
.shop-item .item-attr {
  font-size: 9px;
  color: #b6e9ff;
  font-weight: 500;
  margin-bottom: 1px;
  min-height: 12px;
  max-height: 15px;
  overflow: hidden;
  white-space: pre-line;
  line-height: 1.12;
}

/* Цена */
.shop-price {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #ffe07a;
  font-weight: 700;
  gap: 5px;
  margin-bottom: 2px;
  line-height: 1;
}
.shop-price img {
  width: 1.2em;
  height: 1.2em;
  display: inline-block;
  vertical-align: middle;
  margin: 0;
  object-fit: contain;
}


/* Кнопка купить — аккуратная, градиентная, всегда внутри */
.shop-item button {
  margin-top: 4px;
  padding: 3.5px 0 3.5px 0;
  width: 80%;
  min-width: 0;
  font-size: 11px;
  font-weight: 700;
  border-radius: 5px;
  border: none;
  background: linear-gradient(90deg, #9f7b39 0%, #e7ce94 100%);
  color: #312200;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: filter 0.15s;
  box-shadow: 0 1px 4px 0 rgba(110,90,40,0.08);
  outline: none;
  align-self: center;
}
.shop-item button:active {
  filter: brightness(0.95);
}
