/* پایه و هدر */
* { box-sizing:border-box; margin:0; padding:0; }
body { font-family:Tahoma,sans-serif; direction:rtl; background:#1c1f26; color:#eee; line-height:1.8; padding-top:70px; }
a { color:#f1c40f; text-decoration:none; }
a:hover { text-decoration:underline; color:#e1b600; }

header { position:fixed; top:0; left:0; right:0; height:70px; background:#2a2e39; display:flex; align-items:center; justify-content:center; z-index:1000; padding:0 20px; }
header .logo { text-align:center; font-size:22px; font-weight:bold; z-index:10; }

.desktop-menu { position:absolute; right:20px; top:50%; transform:translateY(-50%); }
.desktop-menu ul { display:flex; list-style:none; gap:18px; }
.desktop-menu ul li a { color:#fff; font-weight:bold; text-decoration:none; }
.desktop-menu ul li a:hover { color:#f1c40f; }

.menu-toggle { display:none; position:absolute; right:15px; top:50%; transform:translateY(-50%); font-size:28px; cursor:pointer; z-index:1100; color:#fff; }
.mobile-menu { display:none; position:absolute; top:70px; right:0; width:220px; background:#2a2e39; padding:0; border-radius:0; z-index:1000; }
.mobile-menu ul { list-style:none; display:none; flex-direction:column; margin:0; padding:0; }
.mobile-menu ul li a { display:block; padding:12px 20px; color:#fff; font-weight:bold; text-decoration:none; }
.mobile-menu ul li a:hover { color:#f1c40f; }
.mobile-menu ul.active { display:flex; }

/* محصولات */
.products-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap:20px;
}
.products-grid .product-card {
  background:#2f343f; border-radius:12px; text-align:center; padding:15px; box-shadow:0 6px 18px rgba(0,0,0,0.25);
}
.products-grid .product-card img { width:100%; border-radius:10px; margin-bottom:10px; }
.products-grid .product-card h4 { color:#f1c40f; margin-bottom:10px; }
.products-grid .product-card p { margin-bottom:10px; }
.product-buttons { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; }
.product-buttons .btn.buy-btn { background-color:#27ae60; color:#fff; }
.product-buttons .btn.buy-btn:hover { background-color:#1e8449; }

/* دسته‌بندی */
.categories-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); /* مثل دسکتاپ */
  gap:20px;
}
.categories-grid .card {
  background:#2f343f; border-radius:12px; text-align:center; padding:15px; box-shadow:0 6px 18px rgba(0,0,0,0.25);
}
.categories-grid .card img { width:100%; border-radius:10px; }
.categories-grid .card h3 { margin-top:10px; color:#f1c40f; }

/* دکمه */
.btn { background:#e74c3c; color:#fff; padding:10px 20px; border-radius:6px; text-decoration:none; font-size:14px; }
.btn:hover { background:#c0392b; }

/* Container و Grid */
.container { max-width:1100px; margin:0 auto; padding:20px; }
h2 { text-align:center; margin-bottom:20px; }

/* Footer */
footer { background:#2a2e39; color:#fff; text-align:center; padding:18px 10px; font-size:14px; }
footer a { color:#f1c40f; text-decoration:none; }
footer a:hover { text-decoration:underline; }

/* موبایل */
@media (max-width:768px){
  .desktop-menu { display:none; }
  .menu-toggle { display:block; }
  .mobile-menu { display:block; }

  /* محصولات: 1 یا 2 کارت در هر ردیف */
  .products-grid { 
    grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); 
    gap:15px; 
  }

  /* دسته‌بندی‌ها: مثل محصولات، چند کارت همزمان */
  .categories-grid { 
    grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); 
    gap:15px; 
  }
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
}
.product-card {
  width: 100%;
  max-width: 250px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* صفحه جزییات محصول */
.product-details {
  max-width: 900px;
  margin: 30px auto;
  padding: 20px;
  background: #2f343f;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  color: #fff;
}

.product-details img {
  display: block;
  max-width: 60%;
  margin: 0 auto 20px auto;
  border-radius: 10px;
}

.product-details h2 {
  text-align: center;
  color: #f1c40f;
  margin-bottom: 15px;
}

.product-details p {
  line-height: 1.8;
  margin-bottom: 15px;
  font-size: 16px;
}

.product-details .price {
  font-size: 18px;
  font-weight: bold;
  color: #2ecc71; /* رنگ سبز روشن‌تر */
  text-align: center;
  margin-bottom: 20px;
}

.product-details .btn-buy {
  display: block;
  width: 200px;
  margin: 0 auto;
  text-align: center;
  padding: 10px 0;
  background: #27ae60;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: 0.3s;
}

.product-details .btn-buy:hover {
  opacity: 0.8;
}







/* گالری تصاویر */
.gallery {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.gallery img {
  width: 250px;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid #444;
  transition: 0.3s;
}
.gallery img:hover {
  transform: scale(1.05);
  border-color: #f1c40f;
}

/* لایت‌باکس */
#lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
}
#lightbox img {
  max-width: 80%;
  max-height: 80%;
  border-radius: 10px;
  margin-bottom: 15px;
}

/* دکمه‌ها */
#lightbox .close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 36px;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
}
#lightbox .prev,
#lightbox .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  font-size: 36px;
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 5px;
}
#lightbox .prev:hover,
#lightbox .next:hover {
  background: rgba(0,0,0,0.8);
}
#lightbox .prev { right: 20px; }
#lightbox .next { left: 20px; }

/* موبایل بهینه */
@media (max-width:600px){
  .gallery {
    flex-wrap: nowrap;
    justify-content: space-between;
  }
  .gallery img {
    width: 32%; /* سه عکس کنار هم */
    height: auto;
    flex-shrink: 0;
  }
}
