.games-carousel {
  position: relative;
  width: 100%;
  padding: 0 40px;
  box-sizing: border-box;
}

.games-carousel__viewport {
  overflow: hidden;
  width: 100%;
}

.games-carousel__track {
  display: flex;
  flex-wrap: nowrap;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.games-carousel__page {
  flex: 0 0 100%;
  min-width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 240px);
  gap: 12px;
  box-sizing: border-box;
}

/* Сброс стилей из main.css */
.games-carousel .product-wrapper {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  min-height: 240px !important;
  max-height: 240px !important;
  overflow: hidden;
  box-sizing: border-box;
}

.games-carousel .product-wrapper .product {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 240px;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.games-carousel .product-wrapper .product:hover {
  transform: translateY(-3px);
}

.games-carousel .product-wrapper .product .m-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.85);
  transition:
    filter 0.3s ease,
    transform 0.3s ease;
}

.games-carousel .product-wrapper .product:hover .m-img {
  filter: brightness(1);
  transform: scale(1.04);
}

.games-carousel .product-wrapper .product::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70%;
  background: linear-gradient(to top, rgba(10, 10, 14, 0.95) 0%, rgba(10, 10, 14, 0) 100%);
  z-index: 1;
}

.games-carousel .product-wrapper .product::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(42, 124, 184, 0.08);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.games-carousel .product-wrapper .product:hover::after {
  opacity: 1;
}

.games-carousel .product-wrapper .product.non-cheats {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.games-carousel .product-wrapper .product .main-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 10px 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.games-carousel .product-wrapper .product .icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 6px;
  overflow: hidden;
  margin-right: 8px;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.games-carousel .product-wrapper .product .icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.games-carousel .product-wrapper .product .global {
  flex: 1;
  min-width: 0;
}

.games-carousel .product-wrapper .product .info-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.games-carousel .product-wrapper .product .count-products {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 !important;
  line-height: 1.3;
}

.games-carousel .product-wrapper .product .count-products-status {
  font-size: 11px;
  color: #9296a9;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.games-carousel .product-wrapper .product .count-products-status .price {
  font-weight: 600;
  color: #fff;
  font-size: 12px;
}

/* Описание скрыто — недостаточно места */
.games-carousel .product-wrapper .product p[style] {
  display: none !important;
}

.games-carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(19, 23, 34, 0.85);
  border: 1.5px solid rgba(42, 124, 184, 0.4);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition:
    background 0.2s,
    border-color 0.2s,
    opacity 0.2s;
  outline: none;
  padding: 0;
}

.games-carousel__btn:hover {
  background: rgba(42, 124, 184, 0.9);
  border-color: #2a7cb8;
}

.games-carousel__btn--prev {
  left: 0;
}
.games-carousel__btn--next {
  right: 0;
}

.games-carousel__btn:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

.games-carousel__btn i {
  font-size: 14px;
  line-height: 1;
}

.games-carousel__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.games-carousel__dot {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  padding: 0;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
  outline: none;
  position: relative;
  overflow: hidden;
}

.games-carousel__dot:hover {
  background: rgba(42, 124, 184, 0.4);
}

.games-carousel__dot--active {
  width: 52px;
  background: rgba(255, 255, 255, 0.15);
}

.games-carousel__dot--active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #2a7cb8 0%, #6d609a 100%);
  transform: scaleX(0);
  transform-origin: left;
  animation: dotProgress 5s linear forwards;
}

.games-carousel:hover .games-carousel__dot--active::after {
  animation-play-state: paused;
}

@keyframes dotProgress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.games-carousel--single .games-carousel__btn,
.games-carousel--single .games-carousel__dots {
  display: none;
}

@media (max-width: 1100px) {
  .games-carousel__page {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 240px);
  }
}

@media (max-width: 768px) {
  .games-carousel {
    padding: 0 32px;
  }

  .games-carousel__page {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 200px);
    gap: 8px;
  }

  .games-carousel .product-wrapper {
    min-height: 200px !important;
    max-height: 200px !important;
  }

  .games-carousel .product-wrapper .product {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .games-carousel {
    padding: 0 28px;
  }

  .games-carousel__page {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 180px);
    gap: 8px;
  }

  .games-carousel .product-wrapper:nth-child(n + 5) {
    display: none;
  }

  .games-carousel .product-wrapper {
    min-height: 180px !important;
    max-height: 180px !important;
  }

  .games-carousel .product-wrapper .product {
    height: 180px;
  }
}
