* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  color: #333;
}

/*! ====== Slider ====== !*/
.slider-container {
  position: relative;
  width: 90%;
  max-width: 1200px;
  aspect-ratio: 30 / 12;
  margin: 50px auto 40px auto;
  overflow: hidden;
  border-radius: 20px;
  animation: pop 0.5s ease forwards;
}
@keyframes pop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.slider {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateX(100%);
  transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
}

.slide a,
.slide img {
  pointer-events: auto;
}

.slide.active {
  opacity: 1;
  transform: translateX(0);
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/** ====== دکمه‌های بعدی و قبلی ====== **/
.prev,
.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  padding: 12px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.3s ease;
  font-size: 18px;
  z-index: 10;
}

.prev:hover,
.next:hover {
  background: rgba(0, 0, 0, 0.7);
}

.prev,
.next,
.wave-indicator {
  z-index: 3;
  pointer-events: auto;
}

.prev {
  left: 15px;
}

.next {
  right: 15px;
}

/** ====== نقاط پایین ====== **/
.wave-indicator {
  position: absolute;
  right: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.wave-indicator svg {
  width: 180px;
  height: 60px;
}

.wave-dots {
  display: flex;
  gap: 8px;
  margin-top: -30px;
  z-index: 11;
}

.dot {
  width: 6px;
  height: 14px;
  background: lightgray;
  border-radius: 50px;
  cursor: pointer;
  z-index: 3;
  pointer-events: auto;
  transition: all 0.3s ease;
}

.dot.active {
  background: linear-gradient(56deg, #55befb, #04fc04);
  height: 20px;
  transform: translateY(-3px);
}

.dot:hover {
  background: rgba(0, 0, 0, 0.4);
  height: 20px;
  transform: translateY(-3px);
}

/** ====== واکنش‌گرا ====== **/
@media (max-width: 768px) {
  .slider-container2 {
    height: 260px;
  }

  .prev,
  .next {
    padding: 8px;
    font-size: 14px;
  }

  .wave-indicator {
    bottom: -15px;
  }
}

@media (max-width: 480px) {
  .slider-container2 {
    height: 200px;
  }

  .dot {
    width: 5px;
    height: 10px;
  }
}

/*! Products Slider !*/
.product-slider-h2 {
  display: inline;
  border-bottom: 2px solid #ea2027;
  padding: 10px;
  margin: 10px;
}

.product-slider-img {
  width: 40px;
  height: 30px;
  margin: -13px -20px;
}

.product-slider-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  margin: 30px 0;
  overflow-x: hidden !important;
}

.product-slider {
  display: flex;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  margin: 20px;
  box-shadow: 0px 0px 6px #2ec4b6;
  gap: 10px;
  padding: 10px;
  overflow-x: hidden !important;
  scroll-behavior: unset;
}

.product-slider-top {
  display: flex;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  margin: 20px;
  box-shadow: 0px 0px 6px #2ec4b6;
  gap: 30px;
  overflow-x: hidden !important;
  scroll-behavior: unset;
  padding: 20px 65px;
}

.top-viewed-products h2 {
  margin: 10px 20px;
  border-bottom: 2px solid #ea2027;
  display: inline-block;
}

.product-card {
  flex: 0 0 auto;
  width: 250px;
  height: 350px;
  border-radius: 8px;
  padding: 10px;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  margin: 10px;
  text-align: center;
  transition: 0.2s ease-in;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

.product-card img {
  width: 100%;
  height: 180px;
  border-radius: 10px;
  object-fit: cover;
}

.product-card-title {
  color: black;
  margin: 0px 0px 10px 0px;
}

.product-card-price {
  color: black;
}

.add-to-cart-btn {
  font-family: vazir;
  background-color: #74c69d;
  border: 1px solid #74c69d;
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0px 0px 0px red;
  margin: 20px 0px 0px 0px;
  transition: 0.3s ease-in;
}

.add-to-cart-btn:hover {
  background-color: white;
  color: black;
  border: 1px solid black;
}

.more-products {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f7f7;
  border: 2px dashed #ccc;
  transition: all 0.3s ease;
}

.more-products:hover {
  background: #fff;
  border-color: #ff5722;
}

.more-card-inner {
  text-align: center;
  color: #219ebc;
  font-size: 30px;
}

.more-card-inner i {
  font-size: 2rem;
  color: #ff5722;
  margin-bottom: 0.5rem;
}

.more-card-inner h3 {
  font-size: 1rem;
  font-weight: 600;
}

/** off **/
.product-card .old-price {
  text-decoration: line-through;
  color: #888;
  font-size: 0.9rem;
  position: relative;
  top: -10px;
}

.product-card .new-price {
  color: #e60023;
  font-weight: bold;
}

.product-card .discount-badge {
  background-color: #ff4d4d;
  color: #fff;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  position: absolute;
  top: 8px;
  right: 8px;
}

/** Admin BTN **/
.btn-edit {
  position: relative;
  top: -150px;
  left: 79px;
  color: white;
  background-color: rgba(0, 0, 255, 0.4);
  padding: 4px;
  border-bottom-left-radius: 10px;
  border-top-left-radius: 10px;
  cursor: pointer;
  transition: 0.2s ease-in;
}
.btn-edit:hover {
  background-color: rgb(0, 0, 255);
}

.btn-delete {
  position: relative;
  top: -150px;
  color: white;
  background-color: rgba(255, 0, 0, 0.4);
  right: 79px;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  padding: 3px;
  border: none;
  cursor: pointer;
  transition: 0.2s ease-in;
}
.btn-delete:hover {
  background-color: red;
}

/** Prev & Next **/
.prev-product,
.next-product {
  background: #33333373;
  color: white;
  border: none;
  padding: 10px;
  margin: 0px 20px;
  cursor: pointer;
  border-radius: 20px;
  font-size: 20px;
  transition: 0.2s ease-in;
}
.prev-product:hover,
.next-product:hover {
  transform: scale(1.1);
  background: #333333c0;
}

/*! Footer !*/
footer {
  background: #222;
  color: white;
  padding: 15px;
  font-size: 14px;
}

/* ریسپانسیو کلی */
@media (max-width: 992px) {
  .slider-container {
    max-height: 350px;
    width: 95%;
  }

  .product-card {
    width: 220px;
    height: 330px;
  }

  .product-slider,
  .product-slider-top {
    padding: 15px;
    gap: 15px;
  }
}

/* تبلت */
@media (max-width: 768px) {
  main {
    animation: slideDown 0.5s ease;
  }
  @keyframes slideDown {
    from {
      transform: translateY(-60px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .slider-container {
    max-height: 300px;
  }

  .prev,
  .next {
    padding: 8px;
    font-size: 14px;
  }

  .product-card {
    width: 200px;
    height: 310px;
  }

  .product-card img {
    height: 150px;
  }

  .product-slider,
  .product-slider-top {
    padding: 10px 20px;
    gap: 10px;
  }

  .wave-indicator {
    top: 111px;
    right: 30%;
  }
}

/* موبایل */
@media (max-width: 576px) {
  .slider-container {
    aspect-ratio: 4 / 3;
    margin-top: 30px;
  }

  .wave-indicator svg {
    width: 130px;
    height: 45px;
  }

  .dot {
    width: 5px;
    height: 10px;
  }

  .product-card {
    width: 160px;
    height: 270px;
    margin: 5px;
  }

  .product-card img {
    height: 120px;
  }

  .product-card-title {
    font-size: 0.9rem;
  }

  .btn-edit,
  .btn-delete {
    top: -155px;
    left: 63px;
  }
  .btn-delete {
    right: 63px;
  }

  .prev-product,
  .next-product {
    padding: 7px;
    font-size: 16px;
    margin: 0 10px;
  }

  .product-slider,
  .product-slider-top {
    margin: 10px;
    padding: 10px;
    gap: 8px;
  }

  .product-slider-top {
    display: block;
    padding: 10px 60px;
    margin: 20px;
    text-align: center;
  }
}

/* موبایل خیلی کوچک */
@media (max-width: 400px) {
  .slider-container {
    aspect-ratio: 2 / 2 !important;
    max-height: 155px !important;
  }

  .product-card {
    width: 220px;
    height: 260px;
    margin: 20px 0px;
  }

  .product-card img {
    height: 110px;
  }

  .wave-indicator {
    top: -10px;
    right: 10%;
  }
}
