/* ===============================
   ریست استایل‌ها
=============================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body, main, footer {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0f1b2b 0%, #1a2a44 100%);
  color: #e0e0e0;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===============================
   هدر
=============================== */
header {
  position: fixed;   /* هدر همیشه ثابت */
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;    /* روی همه چیز قرار بگیره */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: linear-gradient(90deg, #0f1b2b, #1a2a44);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* برای اینکه محتویات اصلی زیر هدر شروع بشه */
main {
  padding-top: 100px; /* ارتفاع هدر رو تقریباً تنظیم کن */
}


header h1 {
  font-size: 2rem;
}

/* ===============================
   سرچ بار وسط هدر
=============================== */
.search-bar {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.search-bar input {
  padding: 12px;
  border-radius: 8px;
  border: none;
  width: 95%;
  background: #0f1b2b;
  color: #fff;
  border: 1px solid #1dd1a1;
  transition: 0.3s;
}

.search-bar input:focus {
  outline: none;
  border-color: #10ac84;
  box-shadow: 0 0 15px rgba(16, 172, 132, 0.6);
}

/* ===============================
   نوبار
=============================== */
nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  
}

nav ul {
  display: flex;
  list-style: none;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
  padding: 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

nav ul li a:hover {
  background-color: rgba(29, 209, 161, 0.2);
  color: #1dd1a1;
}

/* دکمه همبرگر */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #fff;
  cursor: pointer;
  transition: transform 0.3s ease; /* انیمیشن خود آیکون */
}

.menu-toggle.active {
  transform: rotate(90deg); /* چرخش آیکون هنگام باز شدن */
}

/* ===============================
   سبد خرید
=============================== */
.cart {
  position: relative;
  margin-left: 15px;
}

.cart button {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 20px;
  position: relative;
}

#cart-count {
  position: absolute;
  top: -5px;
  right: -10px;
  background: #1dd1a1;
  color: #0f1b2b;
  border-radius: 50%;
  font-size: 12px;
  padding: 2px 6px;
  font-weight: bold;
}

/* Dropdown سبد خرید */
.cart-dropdown {
  display: none;
  position: absolute;
  top: 40px;
  right: 0;
  background: #1a2a44;
  border: 2px solid #1dd1a1;
  border-radius: 12px;
  width: 260px;
  padding: 12px;
  z-index: 100;
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.cart-dropdown h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: #1dd1a1;
  text-align: center;
}

.cart-dropdown ul {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
}

.cart-dropdown li {
  font-size: 14px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  color: #e0e0e0;
}

.cart-total {
  margin-top: 10px;
  font-weight: bold;
  text-align: right;
  color: #1dd1a1;
}

/* ===============================
   بخش محصولات
=============================== */
.products-section {
  padding: 3rem 5%;
}

.products-section h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 600;
  border-bottom: 2px solid #1dd1a1;
  padding-bottom: 0.5rem;
  font-size: 1.6rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.product-card {
  background: #1a2a44;
  padding: 1rem;
  border-radius: 20px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}

.product-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 15px;
  height: 200px;
  margin-bottom: 0.8rem;
  transition: transform 0.3s;
}

.product-card h3 {
  text-align: center;
  font-size: 17px;
  margin-bottom: 0.6rem;
}

.product-card button.add-to-cart {
  background-color: #1dd1a1;
  border: none;
  color: #0f1b2b;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.product-card button.add-to-cart:hover {
  background-color: #10ac84;
  transform: scale(1.05);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.6);
  background: linear-gradient(145deg, #223355, #1a2b44);
}

/* ===============================
   فوتر
=============================== */
footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 2px solid #1dd1a1;
  margin-top: 2rem;
}

/* ===============================
   ریسپانسیو
=============================== */

/* تبلت */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* موبایل */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .menu-toggle {
    display: block;
    z-index: 1001;
  }

  /* منوی موبایل */
  nav ul.nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #1a2a44;
    flex-direction: column;
    gap: 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.5s ease;
    z-index: 1000;
    padding: 0;
  }

  nav ul.nav-links.active {
    max-height: 500px;
    padding: 1rem;
  }

  nav ul.nav-links li a {
    display: block;
    padding: 0.8rem;
    text-align: center;
  }

  /* سرچ بار موبایل */
  .search-bar input {
    width: 85%;
    max-width: none;
  }
}
