* {
  padding: 0;
  margin: 0;
  outline: none;
  border: none;
  box-sizing: border-box;
}
@font-face {
  font-family: peyda;
  src: url("font/Peyda-Medium.ttf") format("truetype");
  font-weight: 400;
}
body {
  background: radial-gradient(
    circle at top right,
    rgba(175, 6, 164, 0.02),
    transparent 32%
  ),
  linear-gradient(180deg, #fcfafc 0%, #f9f6f9 100%);
  font-family: "peyda";
}

.products {
  margin: 50px;
  direction: rtl;
  display: flex;
  flex-direction: row;
  gap: 30px;
  align-items: flex-start;
}

.products-content {
  flex: 1;
  min-width: 0;
}

.products-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 25px;
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.product-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  transition: 0.3s;
  position: relative;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.product-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.card-body {
  padding: 15px;
}

.product-name {
  font-size: 18px;
  margin: 0 0 8px;
  color: #222;
}

.price-container {
  margin: 10px 0;
}

.old-price {
  text-decoration: line-through;
  color: #999;
  font-size: 14px;
  margin-left: 8px;
}

.new-price {
  color: #ff4b2b;
  font-size: 18px;
  font-weight: bold;
}

.normal-price {
  color: #a3238e;
  font-size: 18px;
  font-weight: bold;
}

.btn {
  display: inline-block;
  padding: 8px 14px;
  background: #a3238e;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  transition: 0.3s;
}

.btn:hover {
  background: #810479;
}

.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  color: white;
  padding: 5px 12px;
  border-radius: 25px;
  font-size: 12px;
  font-weight: bold;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* ===== فیلتر دسکتاپ ===== */
.filter-box {
  width: 280px;
  min-width: 240px;
  background: white;
  border-radius: 16px;
  padding: 22px;
  height: fit-content;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid #f1f5f9;
  top: 20px;
}

.filter-box h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f3e5f2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group {
  margin-bottom: 16px;
}

.filter-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}

.filter-group input,
.filter-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-family: peyda;
  font-size: 13px;
  transition: 0.3s;
  background: #f8fafc;
  color: #1e293b;
}

.filter-group input:focus,
.filter-group select:focus {
  border-color: #a3238e;
  outline: none;
  box-shadow: 0 0 0 3px rgba(163, 35, 142, 0.1);
  background: white;
}

.filter-group input::placeholder {
  color: #94a3b8;
}

.price-range {
  display: flex;
  gap: 8px;
  align-items: center;
}

.price-range input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-family: peyda;
  font-size: 13px;
  background: #f8fafc;
  transition: 0.3s;
}

.price-range input:focus {
  border-color: #a3238e;
  outline: none;
  box-shadow: 0 0 0 3px rgba(163, 35, 142, 0.1);
  background: white;
}

.price-range span {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
}

.filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.btn-filter {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  font-family: peyda;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  text-align: center;
  text-decoration: none;
}

.btn-filter-primary {
  background: #a3238e;
  color: white;
}

.btn-filter-primary:hover {
  background: #7a0472;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(163, 35, 142, 0.3);
}

.btn-filter-secondary {
  background: #f1f5f9;
  color: #475569;
}

.btn-filter-secondary:hover {
  background: #e2e8f0;
}

/* ===== مرتب‌سازی ===== */
.sort-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
  flex-wrap: wrap;
}

.sort-box label {
  font-size: 13px;
  color: #475569;
  font-weight: 500;
  white-space: nowrap;
}

.sort-box select {
  padding: 8px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: peyda;
  font-size: 13px;
  background: #f8fafc;
  cursor: pointer;
  color: #1e293b;
  transition: 0.3s;
}

.sort-box select:focus {
  border-color: #a3238e;
  outline: none;
}

.result-count {
  font-size: 13px;
  color: #64748b;
  margin-right: auto;
}

.result-count strong {
  color: #1e293b;
}

/* ===== فیلتر موبایل ===== */
.mobile-filter-section {
  display: none;
  width: 100%;
  margin-top: 16px;
  margin-bottom: 16px;
}

.mobile-filter-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: 0.3s;
  font-family: peyda;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.mobile-filter-btn .left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-filter-btn .left i {
  color: #a3238e;
  font-size: 18px;
}

.mobile-filter-btn .badge {
  background: #a3238e;
  color: white;
  font-size: 10px;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.mobile-filter-btn .arrow-icon {
  transition: 0.3s;
  font-size: 14px;
  color: #94a3b8;
}

.mobile-filter-btn.active .arrow-icon {
  transform: rotate(180deg);
}

.mobile-filter-dropdown {
  display: none;
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 16px;
  margin-top: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.mobile-filter-dropdown.open {
  display: block;
}

.mobile-filter-dropdown .filter-group {
  margin-bottom: 12px;
}

.mobile-filter-dropdown .filter-group label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
  display: block;
}

.mobile-filter-dropdown .filter-group input,
.mobile-filter-dropdown .filter-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: peyda;
  font-size: 13px;
  background: #f8fafc;
  transition: 0.3s;
}

.mobile-filter-dropdown .filter-group input:focus,
.mobile-filter-dropdown .filter-group select:focus {
  border-color: #a3238e;
  outline: none;
  box-shadow: 0 0 0 3px rgba(163, 35, 142, 0.1);
}

.mobile-filter-dropdown .price-range {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mobile-filter-dropdown .price-range input {
  flex: 1;
}

.mobile-filter-dropdown .price-range span {
  color: #94a3b8;
  font-size: 13px;
}

.mobile-filter-dropdown .filter-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.mobile-filter-dropdown .btn-filter {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  font-family: peyda;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  text-align: center;
  text-decoration: none;
}

.mobile-filter-dropdown .btn-filter-primary {
  background: #a3238e;
  color: white;
}

.mobile-filter-dropdown .btn-filter-secondary {
  background: #f1f5f9;
  color: #475569;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 992px) {
  .products {
    margin: 0 20px;
    flex-direction: column;
    gap: 0;
  }

  .filter-box.desktop-filter {
    display: none;
  }

  .mobile-filter-section {
    display: block;
  }
}

@media (max-width: 768px) {
  .products {
    margin: 0 16px;
  }
}

@media (max-width: 576px) {
  .products {
    margin: 0 10px;
  }

  .mobile-filter-section {
    margin-top: 40px;
    margin-bottom: 12px;
  }

  .mobile-filter-btn {
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 10px;
  }

  .mobile-filter-btn .left i {
    font-size: 16px;
  }

  .mobile-filter-dropdown {
    padding: 12px 14px;
    border-radius: 10px;
  }

  .mobile-filter-dropdown .filter-group {
    margin-bottom: 10px;
  }

  .mobile-filter-dropdown .filter-group label {
    font-size: 11px;
  }

  .mobile-filter-dropdown .filter-group input,
  .mobile-filter-dropdown .filter-group select {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
  }

  .mobile-filter-dropdown .price-range input {
    padding: 6px 10px;
    font-size: 12px;
  }

  .mobile-filter-dropdown .price-range span {
    font-size: 12px;
  }

  .mobile-filter-dropdown .btn-filter {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
  }

  .mobile-filter-dropdown .filter-actions {
    margin-top: 10px;
    padding-top: 10px;
  }

  .sort-box {
    padding: 8px 12px;
    gap: 6px;
    border-radius: 8px;
    margin-bottom: 12px;
  }

  .sort-box label {
    font-size: 11px;
  }

  .sort-box select {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 6px;
  }

  .result-count {
    font-size: 11px;
  }

  /* ===== کارت‌های محصول در موبایل - یک ستون وسط ===== */
  .products-container {
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 400px;
    margin: 0 auto;
    justify-items: center;
  }

  .product-card {
    width: 80%;
    max-width: 400px;
    border-radius: 15px;
  }

  .product-card img {
    height: 220px;
  }

  .card-body {
    padding: 15px;
  }

  .product-name {
    font-size: 18px;
    margin: 0 0 8px;
  }

  .normal-price,
  .new-price {
    font-size: 18px;
  }

  .old-price {
    font-size: 14px;
  }

  .btn {
    font-size: 14px;
    padding: 8px 14px;
    width: 50%;
    text-align: center;
  }

  .discount-badge {
    font-size: 12px;
    padding: 5px 12px;
    top: 10px;
    right: 10px;
  }
}

@media (max-width: 420px) {
  .products {
    margin: 0 6px;
  }

  .products-container {
    max-width: 100%;
    gap: 12px;
  }

  .product-card {
    max-width: 100%;
  }

  .product-card img {
    height: 180px;
  }

  .product-name {
    font-size: 16px;
  }

  .normal-price,
  .new-price {
    font-size: 16px;
  }

  .btn {
    font-size: 13px;
    padding: 6px 12px;
  }

  .discount-badge {
    font-size: 11px;
    padding: 4px 10px;
  }
}
/* ===== دکمه‌های کارت محصول ===== */
.product-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}

/* دکمه مشاهده جزئیات (دایره‌ای) */
.btn-detail-circle {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #a3238e, #7a0472);
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(163, 35, 142, 0.3);
  position: relative;
  text-decoration: none;
  font-family: peyda;
}

.btn-detail-circle:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 6px 20px rgba(163, 35, 142, 0.4);
}

.btn-detail-circle:active {
  transform: scale(0.95);
}

.btn-detail-circle .tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: #3b1e39;
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  font-weight: 400;
}

.btn-detail-circle:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

.btn-detail-circle .tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #3b1e36;
}

/* دکمه افزودن به سبد خرید (دایره‌ای) */
.btn-cart-circle {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  border: none;
  background: white;
  color: #a3238e;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(185, 16, 171, 0.3);
  position: relative;
  font-family: peyda;
}

.btn-cart-circle:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 6px 20px rgba(185, 16, 185, 0.4);
}

.btn-cart-circle:active {
  transform: scale(0.95);
}

.btn-cart-circle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: scale(1);
}

.btn-cart-circle .tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: #3b1e38;
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  font-weight: 400;
}

.btn-cart-circle:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

.btn-cart-circle .tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #3b1e35;
}

.btn-cart-circle .cart-icon {
  transition: all 0.3s ease;
}

.btn-cart-circle:hover .cart-icon {
  transform: scale(1.1);
}

.btn-cart-circle.added {
  background: linear-gradient(135deg, #b310b9, #b910a2);
}

.btn-cart-circle.added .cart-icon {
  animation: bounceIn 0.5s ease;
}

.btn-cart-circle .spinner {
  animation: spin 0.8s linear infinite;
}

@keyframes bounceIn {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 576px) {
  .product-actions {
    gap: 6px;
  }

  .btn-detail-circle,
  .btn-cart-circle {
    width: 34px;
    height: 34px;
    min-width: 34px;
    font-size: 14px;
  }
}
