/* ========== RESET & VARIABLES ========== */
:root {
  --c-black: #111111;
  --c-white: #FFFFFF;
  --c-dark-green: #0F6B5B;
  --c-light-gray: #F4F4F4;
  --c-med-gray: #8A8A8A;
  --c-silver: #CFCFCF;
  --c-accent-green: #17A982;
  --font-main: "Vazirmatn", "IRANSans", sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-soft: 0 4px 12px rgba(0,0,0,0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--c-light-gray);
  color: var(--c-black);
  line-height: 1.6;
  direction: rtl;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.section-padding {
  padding: 48px 0;
}

/* ========== HEADER ========== */
.header {
  background: var(--c-white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-soft);
  padding: 12px 0;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-dark-green);
}

/* جستجو */
.search-wrapper {
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--c-light-gray);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

.search-box input {
  border: none;
  background: transparent;
  width: 100%;
  padding-right: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

/* آیکون‌های هدر */
.header-left {
  display: flex;
  gap: 16px;
  align-items: center;
}

.header-nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.header-nav-item i {
  font-size: 1.2rem;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -12px;
  background: #E53935;
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 10px;
  min-width: 18px;
  text-align: center;
}

/* منوی دسکتاپ */
.desktop-nav {
  display: flex;
  gap: 24px;
}

.desktop-nav a {
  font-weight: 500;
}

/* دکمه همبرگر (فقط موبایل) */
.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ========== اسلایدر (با نسبت ابعاد ثابت) ========== */
.hero-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  background-color: #1a1a1a;
  aspect-ratio: 16 / 9;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #1a1a1a;
  display: none;
  transition: opacity 0.5s ease;
}

.slide.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* برای موبایل نسبت کمی تغییر کند */
@media (max-width: 768px) {
  .hero-slider {
    aspect-ratio: 16 / 10;
  }
}

/* دایره‌های ناوبری */
.slider-dots {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.slider-dot {
  width: 12px;
  height: 12px;
  padding: 0;
  margin: 0;
  border: none;
  background-color: rgba(255,255,255,0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.slider-dot.active {
  background-color: #fff;
  transform: scale(1.2);
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

/* حذف دکمه‌های قبلی/بعدی (در صورت نبود) */
.slider-nav {
  display: none;
}

/* ========== HERO قدیمی (برای صفحات بدون اسلایدر) ========== */
.hero {
  background: linear-gradient(135deg, #0F6B5B 0%, #0a5245 100%);
  color: white;
  padding: 80px 0;
  text-align: center;
  border-radius: 0 0 40px 40px;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 24px;
  opacity: 0.9;
}

.btn, .btn-primary {
  display: inline-block;
  background: white;
  color: var(--c-dark-green);
  padding: 12px 28px;
  border-radius: 40px;
  font-weight: bold;
  transition: 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--c-dark-green);
  color: white;
}

.btn-primary:hover {
  background: #0a5245;
  transform: scale(1.02);
}

/* ========== CATEGORIES (اسکرول افقی در دسکتاپ، گرید در موبایل) ========== */
.categories {
  margin: 40px 0;
}

.category-scroll {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
}

.cat-item {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  min-width: 140px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: 0.2s;
}

.cat-item:hover {
  transform: translateY(-5px);
}

.cat-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.cat-name {
  font-weight: bold;
  display: block;
  margin-bottom: 6px;
}

.cat-desc {
  font-size: 0.8rem;
  color: var(--c-med-gray);
}

/* ========== PRODUCT GRID (اصلی - بدون استایل inline) ========== */
.product-section {
  margin: 40px 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.view-all {
  font-size: 0.9rem;
  color: var(--c-dark-green);
}

.product-carousel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 12px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.product-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-soft);
  position: relative;
  transition: 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
}

.img-placeholder {
  height: 180px;
  background: var(--c-light-gray);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.img-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-discount {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #E53935;
  color: white;
  padding: 4px 8px;
  border-radius: 30px;
  font-size: 0.7rem;
  font-weight: bold;
}

.product-title {
  font-size: 1rem;
  margin: 12px 0 8px;
  font-weight: 600;
}

.price {
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--c-dark-green);
  margin: 8px 0;
}

.add-to-cart {
  background: var(--c-light-gray);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  position: absolute;
  bottom: 12px;
  left: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.add-to-cart:hover {
  background: var(--c-dark-green);
  color: white;
}

/* ========== FOOTER ========== */
.footer {
  background: white;
  padding: 48px 0 24px;
  margin-top: 60px;
  border-top: 1px solid var(--c-silver);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-logo {
  font-size: 1.5rem;
  color: var(--c-dark-green);
  margin-bottom: 12px;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul li a:hover {
  color: var(--c-dark-green);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--c-silver);
  font-size: 0.8rem;
  color: var(--c-med-gray);
}

/* ========== RESPONSIVE (دسکتاپ / تبلت / موبایل) ========== */
/* نمایش در دسکتاپ */
@media (min-width: 1024px) {
  .mobile-only {
    display: none !important;
  }
  .desktop-only {
    display: block;
  }
  .header-container {
    flex-wrap: nowrap;
  }
  .search-wrapper {
    max-width: 350px;
  }
  .product-carousel .product-card {
    min-width: 220px;
  }
  .mobile-bottom-nav {
    display: none !important;
  }
  body {
    padding-bottom: 0;
  }
}

/* تبلت و موبایل بزرگ (تا 1024) */
@media (max-width: 1023px) {
  .desktop-only {
    display: none !important;
  }
  .menu-btn {
    display: block;
  }
  .header-container {
    flex-wrap: wrap;
  }
  .search-wrapper {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin-top: 12px;
  }
  .hero h1 {
    font-size: 1.8rem;
  }
  /* گرید محصولات: 3 ستون برای تبلت */
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

/* موبایل (حداکثر عرض 768) */
@media (max-width: 768px) {
  .section-padding {
    padding: 32px 0;
  }
  .hero {
    padding: 50px 0;
  }
  .hero h1 {
    font-size: 1.5rem;
  }
  /* دسته‌بندی‌ها: حالت گرید دو ستونه به جای اسکرول افقی */
  .category-scroll {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    overflow-x: visible;
  }
  .cat-item {
    min-width: auto;
    padding: 12px;
  }
  /* گرید محصولات: 2 ستون اجباری (حل مشکل دونه به دونه) */
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }
  .product-card {
    padding: 8px;
  }
  .img-placeholder {
    height: 140px;
  }
  .product-title {
    font-size: 0.85rem;
  }
  .price {
    font-size: 0.9rem;
  }
  .add-to-cart {
    width: 30px;
    height: 30px;
    bottom: 8px;
    left: 8px;
  }
  .footer-grid {
    gap: 24px;
  }
  /* در صورت استفاده از carousel محصولات، آن هم به گرید تبدیل شود */
  .product-carousel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    overflow-x: visible;
  }
  .product-carousel .product-card {
    min-width: auto;
  }
}

/* موبایل خیلی کوچک (کمتر از 480) */
@media (max-width: 480px) {
  .product-grid {
    gap: 12px !important;
  }
  .img-placeholder {
    height: 120px;
  }
  .product-title {
    font-size: 0.8rem;
  }
  .cat-item {
    padding: 10px;
  }
  .cat-icon {
    font-size: 1.5rem;
  }
}

/* ========== منوی موبایل (اسلاید شونده) ========== */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80%;
  max-width: 280px;
  background: white;
  z-index: 1000;
  box-shadow: -2px 0 20px rgba(0,0,0,0.1);
  padding: 80px 20px 30px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.mobile-menu.is-open {
  display: block;
  transform: translateX(0);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-nav-links a {
  font-size: 1.1rem;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  display: none;
}

.menu-overlay.is-open {
  display: block;
}

/* ========== منوی پایین موبایل ========== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #ddd;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 9999;
  justify-content: space-around;
}

@media (max-width: 1023px) {
  .mobile-bottom-nav {
    display: flex;
  }
  body {
    padding-bottom: 70px;
  }
}

.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  color: #555;
  text-decoration: none;
}

.mobile-bottom-nav a i {
  font-size: 22px;
  margin-bottom: 4px;
}

.mobile-bottom-nav a.active {
  color: var(--c-dark-green);
}

/* ========== UTILITY CLASSES (اختیاری) ========== */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }