@import url("./styles.css");

/*=============== CATEGORIES ===============*/
.categories {
  overflow: hidden;
}

.categories__container {
  position: relative;
}

.section__title {
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

.category-scroll {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 1rem 0;
}

.category-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  padding: 10px;
  color: white;
  cursor: pointer;
}

.next-btn {
  right: 10px;
}

.prev-btn {
  left: 10px;
}

.category__item {
  width: 200px;
  text-align: center;
  border: 1px solid var(--border-color);
  padding: 0.625rem 0.625rem 1.25rem;
  border-radius: 1.25rem;
}

.category__img {
  width: 100%;
  border-radius: .75rem;
  margin-bottom: 1.25rem;
}

.category__title {
  color: var(--yellow-color);
  font-size: var(--small-font-size);
}

/* Swiper class */
.category-btn {
  top: -1.875rem;
  background-color: var(--first-color-alt);
  border: 1px solid var(--border-color);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--first-color);
  font-size: var(--tiny-font-size);
}

.prev-btn {
  left: initial;
  right: 2.5rem;
}

.next-btn {
  right: 0;
}

/*=============== DEALS ===============*/
.deals__container {
    grid-template-columns: repeat(2, 1fr);
}

.deals__item:nth-child(1) {
  background-image: url(../img/deals-1.jpg);
}

.deals__item:nth-child(2) {
  background-image: url(../img/deals-2.png);
}

.deals__item {
  padding: 3rem;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  row-gap: 1.5rem;
}

.deals__brand {
  color: var(--first-color);
  font-size: var(--h3-font-size);
  margin-bottom: .25rem;
}

.deals__category {
  font-family: var(--second-font);
  font-size: var(--small-font-size);
}

.deals__title {
  max-width: 240px;
  font-size: var(--large-font-size);
  font-weight: var(--weight-400);
  line-height: 1.3;
}

.deals__price .new__price,
.deals__price.old__price {
  font-size: var(--large-font-size);
}

.deals__price .new__price {
  color: hsl(352, 100%, 60%);
}

.deals__countdown-text {
  margin-bottom: 0.25rem;
}

.countdown {
  display: flex;
  column-gap: 1.5rem;
}

.countdown__amount {
  position: relative;
}

.countdown__amount::after {
  content: ':';
  color: var(--title-color);
  font-size: var(--large-font-size);
  position: absolute;
  right: -25%;
  top: 20%;
}

.countdown__period {
  background-color: var(--first-color);
  color: var(--body-color);
  width: 60px;
  height: 50px;
  line-height: 50px;
  text-align: center;
  border-radius: .25rem;
  font-size: var(--large-font-size);
  font-weight: var(--weight-600);
  margin-bottom: .5rem;
}

.unit {
  font-size: var(--small-font-size);
  text-align: center;
  display: block;
}

.deals__btn .btn {
  background-color: transparent;
  color: var(--first-color);
}

/*=============== ADD TO CART ANIMATION ===============*/
@keyframes addToCartAnimation {
  0% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
  }
  50% {
      transform: translate(-50%, -50%) scale(1.5);
      opacity: 0.7;
  }
  100% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 0;
      top: 20px;
      left: calc(100% - 100px);
  }
}

.add-to-cart-animation {
  position: fixed;
  width: 20px;
  height: 20px;
  background-color: var(--yellow-color);
  border-radius: 50%;
  animation: addToCartAnimation 0.8s ease-out forwards;
  z-index: 1000;
  pointer-events: none;
}

/* For large devices */
@media screen and (max-width: 1200px) {
  category-btn {
    top: -28px;
    width: 26px;
    height: 26px;
  }

  prev-btn {
    right: 36px;
  }
}

/* For small devices */
@media screen and (max-width: 576px) {
  .category__item {
    width: 150px;
    padding-bottom: 1rem;
  }

  .category__img {
    margin-bottom: 1rem;
  }
}

@media screen and (max-width: 350px) {
  category-btn {
    display: none;
  }
}