/* إعدادات عامة */
body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f6f9;
  color: #333;
}

/* الهيدر */
.site-header, .admin-header {
  background: #007bff;
  color: white;
  padding: 15px 0;
}
.site-header h1, .admin-header h1 {
  margin: 0;
  text-align: center;
}
.site-header nav, .admin-header nav {
  text-align: center;
  margin-top: 10px;
}
.site-header nav a, .admin-header nav a {
  color: white;
  margin: 0 10px;
  text-decoration: none;
  font-weight: bold;
}
.site-header nav a:hover, .admin-header nav a:hover {
  text-decoration: underline;
}

/* الحاويات */
.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
  padding: 20px 0;
}

/* المنتجات */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
  gap: 20px;
}
.product {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  padding: 15px;
  text-align: center;
  transition: transform 0.3s;
}
.product:hover {
  transform: translateY(-5px);
}
.product img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.product h3 {
  margin: 10px 0;
}
.product .price {
  font-size: 18px;
  font-weight: bold;
  color: #007bff;
}

/* الجداول */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  margin-top: 20px;
}
table th, table td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: center;
}
table th {
  background: #007bff;
  color: white;
}

/* الأزرار */
button {
  background: #007bff;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
}
button:hover {
  background: #0056b3;
}

/* الفوتر */
.site-footer {
  background: #222;
  color: #aaa;
  text-align: center;
  padding: 15px 0;
  margin-top: 20px;
}

/* موبايل */
@media(max-width:768px){
  nav a { display:block; margin:5px 0; }
}
/* صفحة تسجيل الدخول */
.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(135deg, #007bff, #00c6ff);
}

.login-container {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 350px;
  text-align: center;
}

.login-container h2 {
  margin-bottom: 20px;
  color: #007bff;
}

.login-form label {
  display: block;
  text-align: right;
  margin: 10px 0 5px;
  font-weight: bold;
}

.login-form input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 14px;
}

.login-form input:focus {
  border-color: #007bff;
  outline: none;
}

.login-form button {
  width: 100%;
  padding: 12px;
  font-size: 16px;
}

.error {
  color: red;
  font-size: 14px;
  margin-bottom: 10px;
}
/* خلفية لوحة الأدمن */
.admin-body {
  background: #f4f6f9;
  font-family: 'Segoe UI', Tahoma, sans-serif;
}

/* كارد الفورم */
.form-container {
  background: white;
  max-width: 500px;
  margin: 40px auto;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* العنوان */
.form-container h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #007bff;
}

/* نموذج منسق */
.styled-form label {
  display: block;
  margin: 12px 0 5px;
  font-weight: bold;
  text-align: right;
}

.styled-form input, 
.styled-form select, 
.styled-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

.styled-form input:focus, 
.styled-form textarea:focus, 
.styled-form select:focus {
  border-color: #007bff;
  outline: none;
}

/* زر الحفظ */
.styled-form button {
  margin-top: 15px;
  width: 100%;
  padding: 12px;
  font-size: 16px;
  background: #007bff;
  border: none;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.styled-form button:hover {
  background: #0056b3;
}

/* رسالة نجاح */
.success {
  background: #d4edda;
  color: #155724;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 15px;
  text-align: center;
}

/* رابط الرجوع */
.back-link {
  display: inline-block;
  margin-top: 10px;
  color: #007bff;
  text-decoration: none;
}
.back-link:hover {
  text-decoration: underline;
}
/* كارد لوحة التحكم */
.dashboard-card {
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  text-align: right;
}

.dashboard-card h2 {
  color: #007bff;
  margin-bottom: 10px;
}

.dashboard-card p {
  font-size: 15px;
  margin-bottom: 15px;
  color: #555;
}

.dashboard-list {
  list-style: none;
  padding: 0;
}

.dashboard-list li {
  background: #f1f1f1;
  margin: 8px 0;
  padding: 10px;
  border-radius: 6px;
  font-size: 15px;
}

/* القائمة الفرعية للتصنيفات */
.dropdown {
  display: inline-block;
  position: relative;
}

.dropdown a {
  cursor: pointer;
}

.dropdown-content {
  display: none;
  position: absolute;
  background: #fff;
  min-width: 180px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  border-radius: 6px;
  text-align: right;
  z-index: 1000;
}

.dropdown-content a {
  display: block;
  padding: 10px;
  color: #333;
  text-decoration: none;
}

.dropdown-content a:hover {
  background: #007bff;
  color: #fff;
}

.dropdown:hover .dropdown-content {
  display: block;
}
/* القائمة الفرعية للتصنيفات */
.dropdown-content {
  display: none;
  position: absolute;
  background: #343a40;   /* 🔹 خلفية داكنة بدل الأبيض */
  min-width: 180px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  border-radius: 6px;
  text-align: right;
  z-index: 1000;
}

.dropdown-content a {
  display: block;
  padding: 10px;
  color: #fff;           /* 🔹 نص أبيض بدل الرمادي */
  text-decoration: none;
  transition: 0.3s;
}

.dropdown-content a:hover {
  background: #007bff;   /* 🔹 أزرق عند المرور */
  color: #fff;
}

.dropdown:hover .dropdown-content {
  display: block;
}
/* شبكة التصنيفات */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.category-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  text-align: center;
  overflow: hidden;
  transition: transform 0.3s;
}

.category-card:hover {
  transform: translateY(-5px);
}

.category-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.category-card h3 {
  padding: 10px;
  background: #007bff;
  color: #fff;
  margin: 0;
  font-size: 16px;
}
/* شبكة التصنيفات */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.category-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  text-align: center;
  overflow: hidden;
  transition: transform 0.3s;
}

.category-card:hover {
  transform: translateY(-5px);
}

.category-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.category-card h3 {
  padding: 10px;
  background: #007bff;
  color: #fff;
  margin: 0;
  font-size: 16px;
}

.images-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}

.img-box {
  position: relative;
  display: inline-block;
}

.img-box img {
  border: 1px solid #ddd;
  border-radius: 6px;
}

.img-box .delete-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: red;
  color: #fff;
  padding: 2px 6px;
  border-radius: 50%;
  font-size: 12px;
  text-decoration: none;
}
.img-box .delete-btn:hover {
  background: darkred;
}
/* شبكة المنتجات */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

/* بطاقة المنتج */
.product {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
  padding: 15px;
  transition: transform 0.3s, box-shadow 0.3s;
}

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

/* صورة المنتج */
.product img {
  width: 100%;
  height: 180px;          /* 🔹 حجم موحد */
  object-fit: cover;      /* 🔹 يحافظ على النسبة */
  border-radius: 8px;
  margin-bottom: 10px;
}

/* اسم المنتج */
.product h3 {
  font-size: 18px;
  margin: 10px 0 5px;
}

/* وصف مختصر */
.product .desc {
  font-size: 14px;
  color: #666;
  height: 40px;          /* 🔹 لتوحيد الطول */
  overflow: hidden;
  margin-bottom: 8px;
}

/* السعر */
.product .price {
  font-size: 16px;
  font-weight: bold;
  color: #007bff;
  margin-bottom: 10px;
}

/* فورم الكمية */
.product input[type="number"] {
  width: 60px;
  padding: 5px;
  margin-right: 5px;
  text-align: center;
  border-radius: 6px;
  border: 1px solid #ccc;
}

/* زر الإضافة */
.product button {
  background: #28a745;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: 0.3s;
}

.product button:hover {
  background: #218838;
}
.btn-edit, .btn-delete {
  display: inline-block;
  padding: 6px 10px;
  margin: 5px 3px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  transition: 0.3s;
}

.btn-edit {
  background: #007bff;
  color: #fff;
}
.btn-edit:hover { background: #0056b3; }

.btn-delete {
  background: #dc3545;
  color: #fff;
}
.btn-delete:hover { background: #b52a37; }
/* شبكة التصنيفات */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.category-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  text-align: center;
  overflow: hidden;
  transition: transform 0.3s;
}

.category-card:hover {
  transform: translateY(-5px);
}

.category-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.category-card h3 {
  padding: 10px;
  background: #007bff;
  color: #fff;
  margin: 0;
  font-size: 16px;
}

/* شبكة المنتجات */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 25px;
  margin: 20px 0;
}

/* بطاقة المنتج */
.product-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

/* صورة المنتج */
.product-img {
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.product-card:hover .product-img img {
  transform: scale(1.1);
}

/* معلومات المنتج */
.product-info {
  padding: 15px;
  text-align: center;
}

.product-info h3 {
  font-size: 18px;
  margin: 10px 0;
}

.product-info .price {
  font-size: 16px;
  font-weight: bold;
  color: #28a745;
  margin-bottom: 10px;
}

/* إضافة للسلة */
.add-cart-form {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.add-cart-form input[type="number"] {
  width: 60px;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 6px;
  text-align: center;
}

.add-cart-form button {
  background: #007bff;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.add-cart-form button:hover {
  background: #0056b3;
}
