/* Shared styles for section pages (Share/TR/UA) */
body { margin: 0; font-family: Inter, Arial, sans-serif; background: #ffffff; color: #111111; }
.container { max-width: 520px; margin: 0 auto; padding: 16px 16px 40px; }
a { color: #86b6ff; text-decoration: none; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.search { flex: 1; position: relative; }
.search input { width: 100%; height: 42px; border: none; border-radius: 12px; background: #f1f5f9; color: #111111; padding: 0 42px 0 44px; font-size: 14px; outline: none; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: 0.8; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; background: #f1f5f9; display: inline-flex; align-items: center; justify-content: center; color: #111111; }
.icon-btn .badge { position: absolute; top: -4px; right: -4px; background: #ff8c3a; color: #111; font-weight: 700; font-size: 11px; padding: 1px 6px; border-radius: 999px; }
.icon-btn.cart { position: relative; }

/* Carousel */
.carousel { position: relative; height: 50vh; margin-bottom: 40px; }
.carousel-viewport { height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding: 12px 0; }
.carousel-viewport::-webkit-scrollbar { display: none; }
.carousel-track { display: flex; align-items: center; height: 100%; gap: 12px; padding: 0 12px; }
.carousel-slide { flex: 0 0 auto; width: calc(50vh * 0.75); height: 100%; display: block; position: relative; border-radius: 16px; overflow: hidden; background-size: cover; background-position: center; scroll-snap-align: center; transform: scale(0.88); transition: transform 0.25s ease, box-shadow 0.25s ease; box-shadow: 0 0 0 rgba(0,0,0,0); }
.carousel-slide.active { transform: scale(1); box-shadow: none; }
.carousel-slide .label { position: absolute; left: 12px; bottom: 10px; background: rgba(0,0,0,0.4); padding: 4px 10px; border-radius: 8px; font-size: 12px; }

h1 { margin: 16px 0 8px; font-size: 22px; }
.section-note { margin: 6px 0 20px; color: #c5c5c5; font-size: 13px; }

/* Games grid: 2 per row */
.games-list {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.game-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  min-height: 232px;
  transition: transform 0.12s ease-in-out, background 0.15s, box-shadow 0.15s;
}
.game-card:hover { background: #f2f4f7; box-shadow: 0 6px 24px rgba(0,0,0,0.08); }
.game-card:active { transform: scale(0.98); }

.game-thumb {
  display: block;
  width: 100%;
  height: 120px; /* фиксированная высота изображения */
  object-fit: cover;
}

.game-info {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 10px 10px 12px;
  gap: 6px;
  flex: 1;
}

.game-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.game-price {
  font-size: 14px;
  color: #ffb400;
  font-weight: 600;
  margin: 0;
}
/* Прижимаем цену к низу карточки сетки */
.game-info .game-price { margin-top: auto; }

.game-description {
  font-size: 12.5px;
  color: #6b7280;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* ограничить описание 2 строками */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.loading, .empty-list { text-align: center; padding: 20px 0; color: #6b7280; }
.loading-spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid rgba(0,0,0,0.2); border-radius: 50%; border-top-color: #009cf7; animation: spin 1s ease-in-out infinite; margin-bottom: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Subscription blocks styles */
.subscription-category-block {
  margin-bottom: 32px;
}

/* Region toggle for subscriptions */
.subscription-region-toggle {
  display: flex;
  gap: 8px;
  margin: 4px 0 16px;
}
.subscription-region-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}
.subscription-region-btn.active {
  border-color: #2563eb;
  background: rgba(37,99,235,.08);
  color: #1e40af;
}

.subscription-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.subscription-category-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111111;
}

.subscription-period-toggle {
  display: flex;
  background: rgba(0,0,0,.04);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
}

.subscription-period-btn {
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.subscription-period-btn:hover {
  color: #111111;
}

.subscription-period-btn.active {
  background: #6366f1;
  color: #fff;
}

.subscription-cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.subscription-card {
  background: rgba(0,0,0,.04);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 8px;
  cursor: default;
}

.subscription-card:hover {
  background: rgba(0,0,0,.08);
  transform: translateY(-2px);
}

.subscription-card-image-container {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 8px;
  margin-right: 16px;
}

.subscription-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.subscription-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.subscription-card-price {
  font-size: 18px;
  font-weight: 600;
  color: #111111;
  margin: 0;
}

.subscription-card-title {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

.subscription-add-to-cart-btn {
  margin-left: 8px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(37,99,235,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.subscription-add-to-cart-btn.added {
  background: #16a34a;
}

.subscription-add-to-cart-btn:hover {
  background: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37,99,235,0.4);
}

.subscription-add-to-cart-btn:active {
  transform: translateY(0);
}

/* Mobile improvements */
@media (max-width: 520px) {
  .subscription-category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .subscription-period-toggle {
    width: 100%;
    justify-content: center;
  }
  
  .subscription-period-btn {
    flex: 1;
    text-align: center;
    padding: 6px 12px;
    font-size: 13px;
  }
  
  .subscription-card {
    padding: 12px;
  }
  
  .subscription-card-image-container {
    width: 70px;
    height: 70px;
    margin-right: 12px;
  }
  
  .subscription-card-price {
    font-size: 16px;
  }
  
  .subscription-card-title {
    font-size: 13px;
  }

  .subscription-add-to-cart-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
    margin-left: 10px;
  }
}

/* ========================= Collections horizontal shelves ========================= */
.collection { margin-bottom: 24px; }
.collection-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.collection-title { margin: 0; font-size: 18px; font-weight: 700; color: #111111; }
.collection-count { font-size: 13px; color: #888; margin-left: 8px; }

.collection-games { position: relative; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.collection-games::-webkit-scrollbar { display: none; }
.collection-games-track { display: flex; flex-wrap: nowrap; gap: 16px; padding: 0 4px 16px 4px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }

.collection-game-card { flex: 0 0 auto; width: 200px; position: relative; text-decoration: none; color: inherit; scroll-snap-align: start; transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94); display: flex; }
.collection-game-card:hover { transform: translateY(-4px); }

.collection-game-button { background: #1f2125; border-radius: 16px; box-shadow: 0 6px 22px rgba(0,0,0,.35); position: relative; width: 100%; border: none; overflow: hidden; transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94); cursor: pointer; display: flex; flex-direction: column; min-height: 248px; }
.collection-game-card:hover .collection-game-button { background: #24262b; box-shadow: 0 12px 28px rgba(0,0,0,.45); }

.collection-game-content { display: flex; flex-direction: column; align-items: flex-start; padding: 16px; gap: 10px; flex: 1; }
.collection-game-thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: rgba(255,255,255,.06); transition: all 0.3s ease; flex-shrink: 0; }
.collection-game-card:hover .collection-game-thumb { border-radius: 10px; }
.collection-game-title { font-size: 15px; font-weight: 700; margin: 0; color: #ffffff; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; letter-spacing: -0.01em; min-height: 38px; }
.collection-game-subtitle { font-size: 12.5px; color: #c1c6d0; margin: 0; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 34px; }
.collection-game-price { font-size: 15px; color: #ffb400; margin: 0; font-weight: 700; display: flex; align-items: center; gap: 6px; min-height: 20px; }
/* Прижимаем цену к низу карточки полки */
.collection-game-content .collection-game-price { margin-top: auto; }

@media (max-width: 520px) {
  .collection-game-card { width: 180px; }
  .collection-game-button { min-height: 220px; }
  .collection-game-thumb { aspect-ratio: 4 / 3; }
}


