/* استایل‌های پایه */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Vazir, Tahoma, Arial, sans-serif;
  line-height: 1.6;
  color: #333 !important;
  background-color: #f9f9f9;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Breadcrumb */
.breadcrumb {
  padding: 10px 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: #d32f2f;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb i {
  margin: 0 8px;
  font-size: 12px;
}

/* محصول اصلی */
.product-container {
  display: flex;
  gap: 30px;
  margin: 20px 0;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* گالری محصول */
.product-gallery {
  flex: 1;
  min-width: 0;
}

.main-image {
  width: 100%;
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
}

.main-image img {
  width: 60%;
  height: auto;
  display: block;
  margin: 0 auto;

}

.thumbnails {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.thumbnail {
  width: 80px;
  height: 80px;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}

.thumbnail.active {
  border-color: #d32f2f;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* اطلاعات محصول */
.product-info {
  flex: 1;
  min-width: 0;
}

.product-title {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #222;
}

.product-rating {
  margin-bottom: 15px;
}

.rating-stars {
  color: #ffc107;
  font-size: 1.1rem;
}

.product-price {
  margin-bottom: 20px;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.final-price {
  font-size: 1.8rem;
  font-weight: bold;
  color: #d32f2f;
}

.original-price {
  font-size: 1.2rem;
  text-decoration: line-through;
  color: #888;
}

.discount-badge {
  background: #d32f2f;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: bold;
}

.product-actions {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.add-to-cart {
  background: #d32f2f;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: background 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-to-cart:hover {
  background: #b71c1c;
}

.quantity-controller {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantity-controller button {
  background: #f5f5f5;
  border: 1px solid #ddd;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.quantity-controller button:hover {
  background: #e0e0e0;
}

.quantity-controller.hidden {
  display: none;
}

.quantity-number {
  min-width: 30px;
  text-align: center;
  font-weight: bold;
  font-size: 1.1rem;
  color: #d32f2f;
}

.product-details {
  border-top: 1px solid #eee;
  padding-top: 15px;
}

.detail-item {
  display: flex;
  margin-bottom: 10px;
}

.detail-label {
  font-weight: bold;
  width: 120px;
  color: #666;
}

.detail-value {
  flex: 1;
}

/* تب‌ها */
.tabs-container {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin: 20px 0;
  overflow: hidden;
}

.tabs-header {
  display: flex;
  border-bottom: 1px solid #eee;
  background: #f5f5f5;
}

.tab {
  padding: 15px 20px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
}

.tab.active {
  border-bottom-color: #d32f2f;
  background: #fff;
  color: #d32f2f;
  font-weight: bold;
}

.tab-content {
  padding: 20px;
  display: none;
}

.tab-content.active {
  display: block;
}

/* جدول مشخصات فنی */
.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table th,
.specs-table td {
  padding: 12px 15px;
  text-align: right;
  border-bottom: 1px solid #eee;
}

.specs-table th {
  background: #f9f9f9;
  font-weight: bold;
  width: 30%;
  color: #555;
}

/* نظرات */
.comment {
  border-bottom: 1px solid #eee;
  padding: 15px 0;
}

.comment:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  background: #eee;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777;
}

.comment-author {
  font-weight: bold;
}

.comment-date {
  color: #888;
  font-size: 0.9rem;
}

.comment-rating {
  margin-right: auto;
  color: #ffc107;
}

.comment-text {
  line-height: 1.6;
}

/* محصولات مشابه با اسکرول افقی */
.similar-products {
  margin: 30px 0;
}

.section-title {
  font-size: 1.4rem;
  margin-bottom: 20px;
  color: #222;
  display: flex;
  align-items: center;
  gap: 10px;
}

.similar-products-scroll {
  overflow-x: auto;
  padding-bottom: 15px;
  margin: 0 -15px;
  padding: 0 15px;
}

.similar-products-scroll::-webkit-scrollbar {
  height: 6px;
}

.similar-products-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.similar-products-scroll::-webkit-scrollbar-thumb {
  background: #d32f2f;
  border-radius: 3px;
}

.similar-products-scroll::-webkit-scrollbar-thumb:hover {
  background: #b71c1c;
}

.similar-products-wrapper {
  display: flex;
  gap: 20px;
  min-width: max-content;
}

.product-link {
  text-decoration: none;
  color: inherit;
  min-width: 250px;
  flex-shrink: 0;
}

.product-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(211, 47, 47, 0.2);
}

.product-card.out-of-stock {
  opacity: 0.7;
}

.product-card-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.product-card:hover .product-card-image img {
  transform: scale(1.05);
}

.product-card-info {
  padding: 15px;
}

.product-card-title {
  font-size: 0.95rem;
  margin-bottom: 10px;
  height: 40px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-card-price {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.price {
  font-weight: bold;
  color: #d32f2f;
  font-size: 1.1rem;
}

.old-price {
  font-size: 0.9rem;
  text-decoration: line-through;
  color: #888;
}

.discount-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #d32f2f;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  z-index: 1;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, top 0.4s ease;
}

.toast.show {
  opacity: 1;
  top: 40px;
}

.toast.success {
  background: #28a745;
}

.toast.error {
  background: #dc3545;
}

.toast.warning {
  background: #ffc107;
  color: #000;
}

/* رسپانسیو برای تبلت */
@media (max-width: 992px) {
  .product-container {
    flex-direction: column;
    gap: 20px;
  }

  .product-gallery,
  .product-info {
    width: 100%;
  }

  .similar-products-wrapper {
    gap: 15px;
  }

  .product-link {
    min-width: 220px;
  }

  .tabs-header {
    flex-wrap: wrap;
  }

  .tab {
    flex: 1;
    min-width: 120px;
    text-align: center;
  }
}

/* رسپانسیو برای موبایل */
@media (max-width: 768px) {
  .container {
    padding: 0 10px;
  }

  .product-container {
    padding: 15px;
    margin: 10px 0;
  }

  .product-title {
    font-size: 1.3rem;
  }

  .final-price {
    font-size: 1.5rem;
  }

  .product-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .similar-products-wrapper {
    gap: 12px;
  }

  .product-link {
    min-width: 200px;
  }

  .product-card-image {
    height: 160px;
  }

  /*.tabs-header {
    flex-direction: column;
  }*/

  .tab {
    width: 100%;
    text-align: right;
    font-size: 0.9rem;
  }

  .detail-item {
    flex-direction: column;
    margin-bottom: 15px;
  }

  .detail-label {
    width: 100%;
    margin-bottom: 5px;
  }

  .breadcrumb {
    font-size: 12px;
  }

  .breadcrumb i {
    margin: 0 5px;
  }
}

@media (max-width: 480px) {
  .product-link {
    min-width: 180px;
  }

  .thumbnail {
    width: 60px;
    height: 60px;
  }

  .specs-table th,
  .specs-table td {
    padding: 8px 10px;
    font-size: 0.9rem;
  }

  .comment-header {
    flex-wrap: wrap;
    gap: 5px;
  }

  .comment-rating {
    margin-right: 0;
    width: 100%;
  }

  .similar-products-scroll {
    margin: 0 -10px;
    padding: 0 10px;
  }
}