/* =========================================
   1. CSS Variables (لوحة التحكم في الألوان والخطوط)
   ========================================= */
:root {
  --primary-color: #0d6efd; /* اللون الأزرق الأساسي */
  --secondary-color: #6c757d; /* اللون الثانوي */
  --accent-color: #ffc107; /* لون التمييز (ذهبي) */
  --bg-light: #f8f9fa; /* لون الخلفية الفاتح */
  --text-dark: #212529; /* لون النصوص */
  --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  --hover-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  --font-main: "Tajawal", sans-serif;
}

/* =========================================
   2. Global Reset & Typography (تنسيقات عامة)
   ========================================= */
@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap");

body {
  font-family: var(--font-main);
  background-color: var(--bg-light);
  color: var(--text-dark);
  overflow-x: hidden; /* لمنع السكرول العرضي */
}

/* =========================================
   3. Navbar Styling (القائمة العلوية)
   ========================================= */
.navbar {
  background: #2c3e50 !important; /* لون داكن */
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent-color) !important;
  letter-spacing: 1px;
}

.btn-cart-custom {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: 0.3s;
}

.btn-cart-custom:hover {
  background-color: var(--accent-color);
  color: #000;
  border-color: var(--accent-color);
}

/* =========================================
   4. Product Cards (كروت المنتجات - أهم جزء)
   ========================================= */
.product-card {
  background: #fff;
  border: none; /* إلغاء حدود البوتستراب الافتراضية */
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--card-shadow);
  height: 100%; /* لتوحيد الارتفاعات */
}

.product-card:hover {
  transform: translateY(-7px); /* حركة للأعلى عند الماوس */
  box-shadow: var(--hover-shadow);
}

/* ضبط الصور داخل الكرت */
.product-card img {
  height: 220px;
  width: 100%;
  object-fit: contain; /* للحفاظ على أبعاد الصورة */
  padding: 20px;
  background-color: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.price-tag {
  font-size: 1.25rem;
  color: var(--primary-color);
  font-weight: 800;
  display: block;
  margin-bottom: 15px;
}

/* =========================================
   5. Filter Buttons (أزرار التصنيف)
   ========================================= */
.filter-container {
  margin: 40px 0;
}

.btn-filter {
  border-radius: 50px;
  padding: 8px 25px;
  margin: 0 5px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-filter.active,
.btn-filter:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* =========================================
   6. Modals (نوافذ الدخول والسلة)
   ========================================= */
.modal-content {
  border-radius: 20px;
  border: none;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  background-color: var(--bg-light);
  border-bottom: 1px solid #eee;
  border-radius: 20px 20px 0 0;
  padding: 1.5rem;
}

.modal-body {
  padding: 2rem;
}

.form-control {
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #dee2e6;
  background-color: #fcfcfc;
}

.form-control:focus {
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
  border-color: var(--primary-color);
}

/* =========================================
   7. Cart Badge (أيقونة العداد)
   ========================================= */
.badge-counter {
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 0.7rem;
  padding: 4px 6px;
  border-radius: 50%;
}

/* =========================================
   8. Media Queries (تجاوب مع الموبايل)
   ========================================= */
@media (max-width: 768px) {
  .navbar-brand {
    font-size: 1.2rem;
  }

  .product-card img {
    height: 180px; /* تصغير الصورة في الموبايل */
  }

  .card-body {
    padding: 1rem;
  }

  /* حركة ظهور ناعمة للمنتجات */
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .animate-fade {
    animation: fadeIn 0.5s ease-in-out;
  }
}
