* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition:
    background-color 0.3s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

body {
  font-family: "Vazirmatn", "Poppins", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* CSS Variables for Light/Dark Mode */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --text-primary: #212529;
  --text-secondary: #495057;
  --border-color: #e9ecef;
  --hero-overlay: rgba(0, 0, 0, 0.55);
  --btn-primary-bg: #0d6efd;
  --btn-primary-hover: #0b5ed7;
  --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  --footer-bg: #f1f3f5;
}

body.dark {
  --bg-primary: #121212;
  --bg-secondary: #1e1e2f;
  --bg-card: #1e1e2e;
  --text-primary: #f1f3f5;
  --text-secondary: #adb5bd;
  --border-color: #2c2c3a;
  --hero-overlay: rgba(0, 0, 0, 0.7);
  --btn-primary-bg: #3b82f6;
  --btn-primary-hover: #2563eb;
  --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  --footer-bg: #0f0f1a;
}

/* Smooth Scroll Behavior */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

/* Navbar Styles */
.navbar {
  backdrop-filter: blur(10px);
  background-color: rgba(var(--bg-primary-rgb), 0.85) !important;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
}
body.dark .navbar {
  background-color: rgba(18, 18, 36, 0.9) !important;
}
.navbar-brand {
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #3b82f6, #a855f7);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.nav-link {
  font-weight: 500;
  color: var(--text-primary) !important;
  margin: 0 5px;
  transition: 0.2s;
}
.nav-link:hover {
  color: #0d6efd !important;
  transform: translateY(-2px);
}

/* Hero Section */
.hero-section {
  position: relative;
  height: 85vh;
  min-height: 550px;
  background: url("https://images.pexels.com/photos/3183197/pexels-photo-3183197.jpeg?auto=compress&cs=tinysrgb&w=1600")
    center/cover no-repeat;
  display: flex;
  align-items: center;
  text-align: center;
  border-radius: 0 0 2rem 2rem;
  overflow: hidden;
}
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--hero-overlay);
  backdrop-filter: brightness(0.8);
}
.hero-content {
  position: relative;
  z-index: 2;
  color: white;
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
  animation: fadeInUp 1s ease-out;
}
.hero-content h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}
.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Category Cards */
.category-card {
  background: var(--bg-card);
  border-radius: 1.5rem;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  border: 1px solid var(--border-color);
  cursor: pointer;
  box-shadow: var(--card-shadow);
}
.category-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.1);
}
.category-card i {
  font-size: 2.8rem;
  color: #3b82f6;
  margin-bottom: 1rem;
}
.category-card h5 {
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.active-category {
  background: #3b82f6;
  color: white !important;
  border-color: #3b82f6;
}
.active-category i,
.active-category h5 {
  color: white !important;
}

/* Product Card */
.product-card {
  background: var(--bg-card);
  border-radius: 1.25rem;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 25px 35px rgba(0, 0, 0, 0.15);
}
.product-img {
  height: 200px;
  object-fit: cover;
  width: 100%;
  transition: transform 0.4s;
}
.product-card:hover .product-img {
  transform: scale(1.03);
}
.product-body {
  padding: 1.2rem;
  flex-grow: 1;
}
.product-title {
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.product-price {
  color: #3b82f6;
  font-weight: 800;
  font-size: 1.2rem;
}
.btn-buy {
  width: 100%;
  border-radius: 40px;
  font-weight: 600;
  transition: 0.2s;
}

/* Pagination */
.pagination .page-item .page-link {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
  margin: 0 3px;
  border-radius: 8px;
  transition: 0.2s;
}
.pagination .page-item.active .page-link {
  background-color: #3b82f6;
  border-color: #3b82f6;
  color: white;
}
.pagination .page-link:hover {
  background-color: #3b82f6;
  color: white;
  transform: scale(1.05);
}

/* Contact Section */
.contact-info {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 1.5rem;
  text-align: center;
  height: 100%;
  border: 1px solid var(--border-color);
}
.contact-info i {
  font-size: 2rem;
  color: #3b82f6;
  margin-bottom: 1rem;
}
.contact-form {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid var(--border-color);
}
.form-control,
.form-control:focus {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}
.btn-submit {
  background: #3b82f6;
  border: none;
  padding: 0.7rem 2rem;
  font-weight: 600;
  border-radius: 40px;
}
.btn-submit:hover {
  background: #2563eb;
  transform: scale(1.02);
}

/* Footer */
footer {
  background-color: var(--footer-bg);
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
}

/* Animation for products loading */
.product-fade {
  animation: fadeSlide 0.4s ease-out;
}
@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dark mode toggle button */
.theme-toggle {
  background: var(--bg-secondary);
  border: none;
  border-radius: 50px;
  padding: 0.4rem 0.8rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* responsive */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2rem;
  }
  .hero-section {
    height: 70vh;
  }
  .category-card {
    padding: 1rem;
  }
}
