/* ===== VARIABLES ===== */
:root {
  --primary-color: #1B5E3F;
  --primary-light: #27A862;
  --secondary-color: #2C2C2C;
  --text-dark: #2C2C2C;
  --text-light: #666666;
  --text-gray: #999999;
  --bg-light: #F5F5F5;
  --bg-white: #FFFFFF;
  --border-color: #E0E0E0;
  --success: #4CAF50;
  --warning: #FFC107;
  --danger: #E53935;
  --transition: all 0.3s ease;
}

/* ===== GLOBAL STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  direction: rtl;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-white);
  overflow-x: hidden;
}

body.dark-mode {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

body.dark-mode .container,
body.dark-mode .card,
body.dark-mode .product-card {
  background-color: #2a2a2a;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== HEADER & NAVIGATION ===== */
.header {
  background-color: var(--bg-white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  z-index: 1000;
}

.header.sticky-header {
  position: sticky;
  top: 0;
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  flex-wrap: wrap;
  gap: 20px;
}

.navbar-logo img {
  height: 50px;
  width: auto;
}

.search-container {
  flex: 1;
  max-width: 400px;
  display: flex;
  background-color: var(--bg-light);
  border-radius: 8px;
  overflow: hidden;
  transition: var(--transition);
}

.search-container:focus-within {
  box-shadow: 0 0 0 3px rgba(27, 94, 63, 0.1);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 15px;
  background-color: transparent;
  font-size: 14px;
}

.search-btn {
  padding: 12px 15px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.search-btn:hover {
  background-color: var(--primary-light);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 30px;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--bg-white);
  min-width: 200px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
  padding: 10px 0;
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 12px 20px;
  color: var(--text-dark);
  text-decoration: none;
  transition: var(--transition);
}

.dropdown-menu a:hover {
  background-color: var(--bg-light);
  color: var(--primary-color);
  padding-right: 25px;
}

.nav-icons {
  display: flex;
  gap: 15px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background-color: var(--bg-light);
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition);
  font-size: 18px;
  position: relative;
}

.icon-btn:hover {
  background-color: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

.badge {
  position: absolute;
  top: -8px;
  left: -8px;
  background-color: var(--danger);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

/* ===== HERO SECTION ===== */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  margin: 30px 0;
}

.hero-slider {
  position: relative;
  height: 400px;
  background-color: var(--bg-light);
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  z-index: 10;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-title {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 15px;
  animation: slideInUp 0.6s ease-out;
}

.hero-subtitle {
  font-size: 18px;
  margin-bottom: 30px;
  animation: slideInUp 0.6s ease-out 0.2s both;
}

.slider-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 20;
}

.slider-btn {
  width: 40px;
  height: 40px;
  border: none;
  background-color: rgba(255, 255, 255, 0.8);
  color: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  transition: var(--transition);
}

.slider-btn:hover {
  background-color: white;
  transform: scale(1.1);
}

.slider-dots {
  display: flex;
  gap: 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--transition);
}

.dot.active {
  background-color: white;
  width: 30px;
  border-radius: 5px;
}

/* ===== FEATURES SECTION ===== */
.features {
  padding: 50px 0;
  background-color: var(--bg-light);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
}

.feature-card {
  text-align: center;
  padding: 30px;
  background-color: white;
  border-radius: 12px;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.feature-card i {
  font-size: 40px;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.feature-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--text-dark);
}

.feature-card p {
  font-size: 14px;
  color: var(--text-light);
}

/* ===== SECTIONS STYLING ===== */
.section-title {
  text-align: center;
  font-size: 32px;
  margin-bottom: 40px;
  color: var(--text-dark);
  position: relative;
  padding-bottom: 20px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

/* ===== CATEGORIES SECTION ===== */
.categories {
  padding: 50px 0;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.category-card {
  position: relative;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}

.category-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.category-card:hover .category-image {
  transform: scale(1.1);
}

.category-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: white;
  opacity: 0;
  transition: var(--transition);
}

.category-card:hover .category-overlay {
  opacity: 1;
}

.category-overlay h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

/* ===== FILTERS ===== */
.filters {
  display: flex;
  gap: 15px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  padding: 10px 20px;
  border: 2px solid var(--border-color);
  background-color: transparent;
  color: var(--text-dark);
  border-radius: 25px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--primary-color);
  background-color: var(--primary-color);
  color: white;
}

/* ===== PRODUCTS SECTION ===== */
.products {
  padding: 50px 0;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 25px;
}

.product-card {
  background-color: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.product-card:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transform: translateY(-5px);
}

.product-image {
  position: relative;
  height: 200px;
  overflow: hidden;
  background-color: var(--bg-light);
}

.img-primary,
.img-hover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.img-hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

.product-card:hover .img-primary {
  opacity: 0;
}

.product-card:hover .img-hover {
  opacity: 1;
}

.product-badges {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.badge {
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  color: white;
}

.badge-sale {
  background-color: var(--danger);
}

.badge-new {
  background-color: var(--primary-light);
}

.quick-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 10px;
  padding: 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.3) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover .quick-actions {
  opacity: 1;
}

.quick-btn {
  flex: 1;
  padding: 8px;
  border: none;
  background-color: white;
  color: var(--primary-color);
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
}

.quick-btn:hover {
  background-color: var(--primary-color);
  color: white;
  transform: scale(1.05);
}

.product-info {
  padding: 15px;
}

.product-name {
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text-dark);
  min-height: 35px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.stars {
  display: flex;
  gap: 2px;
  color: var(--warning);
}

.stars i {
  font-size: 12px;
}

.rating-count {
  font-size: 12px;
  color: var(--text-gray);
}

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

.price-current {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary-color);
}

.price-old {
  font-size: 14px;
  color: var(--text-gray);
  text-decoration: line-through;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(27, 94, 63, 0.3);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: white;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.add-to-cart {
  margin-top: 10px;
}

/* ===== NEWSLETTER ===== */
.newsletter {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: white;
  padding: 50px 0;
  text-align: center;
}

.newsletter h2 {
  font-size: 28px;
  margin-bottom: 15px;
}

.newsletter p {
  font-size: 16px;
  margin-bottom: 30px;
  opacity: 0.9;
}

.newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 500px;
  margin: 0 auto;
}

.newsletter-form input {
  flex: 1;
  padding: 12px 15px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
}

.newsletter-form button {
  background-color: white;
  color: var(--primary-color);
}

/* ===== FOOTER ===== */
.footer {
  background-color: var(--secondary-color);
  color: #ccc;
  padding: 50px 0 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 30px;
}

.footer-section h4 {
  color: white;
  margin-bottom: 15px;
  font-size: 16px;
}

.footer-section p {
  line-height: 1.8;
  font-size: 14px;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section a {
  color: #ccc;
  text-decoration: none;
  transition: var(--transition);
}

.footer-section a:hover {
  color: var(--primary-light);
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.social-links a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: white;
  transition: var(--transition);
}

.social-links a:hover {
  background-color: var(--primary-color);
}

.payment-methods {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.payment-methods img {
  height: 30px;
  width: auto;
  object-fit: contain;
  opacity: 0.7;
  transition: var(--transition);
}

.payment-methods img:hover {
  opacity: 1;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
}

/* ===== ANIMATIONS ===== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .navbar-container {
    flex-direction: column;
    padding: 10px 0;
  }

  .nav-menu {
    gap: 15px;
    font-size: 14px;
  }

  .search-container {
    max-width: 100%;
  }

  .hero-slider {
    height: 250px;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .section-title {
    font-size: 24px;
  }

  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 480px) {
  .navbar-container {
    gap: 10px;
  }

  .nav-menu {
    display: none;
  }

  .hero-slider {
    height: 200px;
  }

  .hero-title {
    font-size: 20px;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .newsletter-form {
    flex-direction: column;
  }
}

/* ===== DARK MODE ===== */
body.dark-mode {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

body.dark-mode .header {
  background-color: #2a2a2a;
  border-bottom-color: #3a3a3a;
}

body.dark-mode .nav-link {
  color: #e0e0e0;
}

body.dark-mode .search-container {
  background-color: #3a3a3a;
}

body.dark-mode .search-input {
  color: #e0e0e0;
}

body.dark-mode .product-card,
body.dark-mode .feature-card,
body.dark-mode .footer {
  background-color: #2a2a2a;
  color: #e0e0e0;
}

body.dark-mode .dropdown-menu {
  background-color: #2a2a2a;
}