/* ----------------------------------------------
   1. إعدادات عامة (اتجاه عربي، خطوط، ألوان)
---------------------------------------------- */
html, body {
  direction: rtl;
  font-family: 'Cairo', Tahoma, Arial, sans-serif;
  background: #f6f6fa;
  color: #222;
  margin: 0;
  padding: 0;
  font-size: 16px;
  scroll-behavior: smooth;
}
a { color: #444; text-decoration: none; transition: color 0.2s }
a:hover, a:focus { color: #0e74d3; }
.container { max-width: 1200px; margin: auto; padding: 0 16px; }

/* ----------------------------------------------
   2. الهيدر (رأس الموقع)
---------------------------------------------- */
.site-header {
  position: fixed;
  width: 100%;
  top: 0; right: 0; left: 0;
  background: #fff;
  box-shadow: 0 2px 10px 0 #eee;
  z-index: 999;
}
.header-top {
  padding: 12px 0;
}
.flex-between {
  display: flex; align-items: center; justify-content: space-between;
}
.site-logo img { height: 38px; max-width: 140px; }
.search-bar {
  display: flex;
  background: #f2f3f7;
  border-radius: 8px;
  overflow: hidden;
  margin: 0 20px;
  flex: 1 1 350px;
  max-width: 400px;
}
.search-bar input[type="text"] {
  border: none;
  background: transparent;
  padding: 10px 12px;
  flex: 1;
  outline: none;
  font-size: 1em;
}
.search-bar button {
  background: #0e74d3;
  color: #fff;
  border: none;
  padding: 0 16px;
  cursor: pointer;
  font-size: 1.2em;
  transition: background 0.2s;
}
.search-bar button:hover { background: #0a4c8e; }
.user-actions {
  display: flex; align-items: center; gap: 10px;
}
.username { color: #09814a; font-weight: 700; font-size: 1em; }
.login-btn, .register-btn, .profile-link, .logout-btn {
  color: #0e74d3;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  background: #f2f3f7;
  transition: background 0.2s, color 0.2s;
}
.login-btn:hover, .register-btn:hover,
.profile-link:hover, .logout-btn:hover {
  background: #0e74d3; color: #fff;
}
.cart-btn {
  position: relative;
  background: #f2f3f7;
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5em;
  margin-right: 5px;
  color: #333;
  transition: background 0.2s;
}
.cart-btn:hover { background: #0e74d3; color: #fff; }
.cart-count {
  position: absolute; left: 2px; top: 2px;
  background: #ff1744;
  color: #fff; font-size: 0.9em; min-width: 18px; text-align: center;
  border-radius: 10px; padding: 1px 5px;
  font-weight: 700;
}

/* زر القائمة للجوال */
.menu-toggle {
  display: none;
  font-size: 2em;
  background: none;
  border: none;
  cursor: pointer;
  color: #0e74d3;
  margin-right: 0;
}

/* ----------------------------------------------
   3. القائمة الرئيسية
---------------------------------------------- */
.main-nav {
  background: #f2f3f7;
  box-shadow: 0 1px 2px #eee;
  font-weight: 500;
  margin-top: 56px;
}
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
  padding: 0;
  margin: 0;
  align-items: center;
}

.main-nav a {
  display: block;
  padding: 12px 0;
  color: #0e74d3;
  border-bottom: 2px solid transparent;
  transition: border 0.2s, color 0.2s;
}
.main-nav a:hover, .main-nav a:focus {
  color: #09814a;
  border-bottom: 2px solid #09814a;
}
.main-nav.show { display: block !important; }

/* ----------------------------------------------
   4. الفوتر
---------------------------------------------- */
.site-footer {
  background: #24262b;
  color: #fff;
  margin-top: 60px;
  font-size: 1em;
}
.footer-top {
  padding: 40px 0 18px 0;
  border-bottom: 1px solid #383b40;
}
.flex-footer {
  display: flex;
  gap: 38px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.footer-col {
  flex: 1 1 200px;
  min-width: 180px;
  margin-bottom: 24px;
}
.footer-col h4 {
  margin-bottom: 16px;
  font-size: 1.08em;
  letter-spacing: 1px;
  color: #4bd572;
}
.footer-col ul { padding: 0; list-style: none; margin: 0; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul li a { color: #e4f2fd; font-size: 1em; }
.footer-col ul li a:hover { color: #fff; text-decoration: underline; }
.footer-icon { color: #0e74d3; margin-left: 6px; }

.footer-social { display: flex; gap: 12px; margin-bottom: 12px; }
.footer-social img { width: 28px; height: 28px; border-radius: 6px; background: #fff; padding: 3px; }
.social-icon:hover img { filter: brightness(1.1) contrast(1.1); }
.footer-payments { margin-top: 14px; display: flex; gap: 10px; }
.footer-payments img { height: 32px; background: #fff; border-radius: 4px; padding: 2px 6px; }
.newsletter-form {
  display: flex; margin-top: 6px;
  background: #fff; border-radius: 16px; padding: 3px 4px;
}
.newsletter-form input[type="email"] {
  flex: 1; border: none; padding: 7px 10px; font-size: 1em; border-radius: 8px;
  outline: none; background: transparent;
}
.newsletter-form button {
  background: #0e74d3; color: #fff; border: none;
  padding: 7px 22px; border-radius: 10px;
  margin-right: 7px; font-weight: 700; cursor: pointer;
  transition: background 0.2s;
}
.newsletter-form button:hover { background: #09814a; }
.footer-bottom {
  background: #1b1c20; padding: 14px 0;
  font-size: 0.97em;
}
.footer-copy a { color: #fff; font-weight: 700; }
.footer-links a { color: #e4f2fd; margin: 0 8px; }
.footer-links a:hover { color: #fff; }

/* ----------------------------------------------
   5. بطاقات المنتجات
---------------------------------------------- */
.products-carousel, .cat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 20px 0;
  justify-content: flex-start;
}
.product-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 18px #e9f1fa99;
  width: 200px;
  max-width: 100%;
  display: flex; flex-direction: column; align-items: center;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.product-card:hover { box-shadow: 0 6px 30px #d8e3ffcc; transform: translateY(-6px) scale(1.03);}
.product-card img {
  max-width: 140px; max-height: 140px;
  margin: 16px auto 8px auto;
  object-fit: contain;
  display: block;
}
.product-title {
  font-size: 1em; font-weight: bold;
  color: #0e74d3; text-align: center; min-height: 40px; margin-bottom: 6px;
}
.product-price {
  margin-bottom: 10px;
  display: flex; align-items: baseline; gap: 6px;
  flex-direction: row;
  justify-content: center;
}
.old-price {
  color: #888; text-decoration: line-through; font-size: 0.98em;
}
.new-price, .main-price {
  color: #09814a; font-size: 1.05em; font-weight: bold;
}
.discount-badge {
  position: absolute; right: 10px; top: 10px;
  background: linear-gradient(90deg,#ff3131 50%,#ff8d00 100%);
  color: #fff; padding: 4px 13px;
  font-size: 0.92em; font-weight: bold; border-radius: 16px 0 12px 0;
  z-index: 1;
  box-shadow: 0 1px 6px #faa9;
}
.add-to-cart-form { width: 100%; display: flex; justify-content: center; }
.add-to-cart-btn {
  margin: 8px 0 18px 0;
  background: #09814a;
  color: #fff; border: none;
  border-radius: 8px; padding: 7px 22px;
  font-size: 1em; font-weight: 700;
  cursor: pointer; transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 10px #d9ffe9a8;
}
.add-to-cart-btn:hover { background: #0e74d3; box-shadow: 0 2px 20px #a5cfff33; }

.cat-grid {
  justify-content: flex-start;
  gap: 20px;
  margin-bottom: 35px;
}
.cat-box {
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 10px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px #e5e6ed80;
  transition: box-shadow 0.2s, background 0.2s;
  min-width: 120px;
  max-width: 170px;
}
.cat-box img {
  width: 48px; height: 48px; margin-bottom: 8px; object-fit: contain;
}
.cat-box span {
  font-weight: bold; color: #0e74d3; font-size: 1em;
}
.cat-box:hover { background: #e9faff; box-shadow: 0 4px 18px #aee3fd77; }

/* ----------------------------------------------
   6. بنرات السلايدر والوسطية
---------------------------------------------- */
.main-banner-slider, .mid-banners {
  width: 100%; margin: 0 auto 26px auto;
  position: relative;
}
.banner-slider-container {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 10px;
}
.banner-slide {
  min-width: 94vw;
  max-width: 100vw;
  border-radius: 18px;
  overflow: hidden;
  margin: 0 7px;
  background: #c6e5ff;
  position: relative;
  box-shadow: 0 3px 24px #b5cefa70;
}
.banner-slide img {
  width: 100%; height: 170px; object-fit: cover;
  display: block;
}
.banner-info {
  position: absolute;
  top: 18px; right: 22px; bottom: 18px;
  color: #fff; max-width: 45vw; min-width: 180px;
  background: rgba(9,36,60,0.45); border-radius: 18px 0 20px 0;
  padding: 18px 18px;
  display: flex; flex-direction: column; justify-content: center;
}
.banner-info h2 { font-size: 1.3em; margin-bottom: 10px; }
.banner-info p { font-size: 1.07em; margin-bottom: 14px; }
.banner-btn {
  background: #0e74d3; color: #fff; padding: 7px 20px;
  border-radius: 12px; font-size: 1em;
  font-weight: 700; box-shadow: 0 2px 10px #2a75d820;
  border: none; transition: background 0.2s;
  display: inline-block;
}
.banner-btn:hover { background: #09814a; }

.mid-banners {
  display: flex; flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin: 30px 0 15px 0;
}
.mid-banners a {
  display: block;
  border-radius: 18px;
  overflow: hidden;
  width: 250px;
  height: 110px;
  box-shadow: 0 2px 12px #c3e7fd40;
  background: #fff;
  transition: box-shadow 0.2s, transform 0.18s;
}
.mid-banners a:hover { box-shadow: 0 4px 24px #bde2ffaa; transform: scale(1.04);}
.mid-banners img {
  width: 100%; height: 100%; object-fit: cover;
}

/* ----------------------------------------------
   7. العناوين والأقسام
---------------------------------------------- */
.section-title {
  color: #09814a; font-size: 1.2em;
  font-weight: 900; margin: 34px 0 10px 0; text-align: right;
}

/* ----------------------------------------------
   8. استجابة الجوال (Mobile Responsive)
---------------------------------------------- */
@media (max-width: 900px) {
  .container { max-width: 100%; }
  .main-nav ul { gap: 14px; }
  .flex-footer { gap: 16px; }
  .product-card, .cat-box { width: 46vw; min-width: 120px; }
  .mid-banners a { width: 40vw; min-width: 120px; height: 80px;}
}
@media (max-width: 700px) {
  html, body { font-size: 15px; }
  .header-top { padding: 5px 0 5px 0; }
  .flex-between { flex-direction: column; gap: 8px;}
  .site-logo img { height: 28px; }
  .search-bar { margin: 10px 0; max-width: 95vw; }
  .user-actions { gap: 4px; }
  .main-nav { margin-top: 0; }
  .main-nav ul { flex-direction: column; gap: 0; background: #fff; }
  .main-nav ul li { width: 100%; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid #e7e7e7; }
  .main-nav { display: none; }
  .main-nav.show { display: block !important; position: absolute; width: 100%; right: 0; z-index: 999; background: #fff;}
  .menu-toggle { display: block; }
  .footer-top { padding: 24px 0 8px 0;}
  .flex-footer { flex-direction: column; gap: 24px; }
  .footer-col { min-width: unset; }
  .products-carousel, .cat-grid { gap: 10px; }
  .product-card, .cat-box { width: 98vw; max-width: 99vw; }
  .main-banner-slider { margin-bottom: 13px; }
  .banner-slide img { height: 105px; }
  .banner-info { top: 10px; right: 10px; padding: 8px 8px; font-size: 0.97em;}
  .mid-banners a { width: 46vw; height: 65px; }
}

/* ----------------------------------------------
   9. عناصر عامة وأزرار
---------------------------------------------- */
button, input[type="submit"], .btn {
  background: #0e74d3;
  color: #fff;
  border: none;
  padding: 8px 22px;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s;
}
button:hover, input[type="submit"]:hover, .btn:hover { background: #09814a; }

input, select, textarea {
  font-family: inherit;
  font-size: 1em;
  border: 1px solid #d2d6e1;
  border-radius: 6px;
  padding: 7px 11px;
  outline: none;
  transition: border 0.18s;
}
input:focus, textarea:focus { border-color: #09814a; }
label { font-weight: 700; margin-bottom: 5px; display: block; }

::-webkit-scrollbar { width: 8px; background: #f5f6fa; }
::-webkit-scrollbar-thumb { background: #b8eaff; border-radius: 8px; }

@media (max-width: 500px) {
  html, body { font-size: 13px; }
  .main-nav ul { font-size: 1em; }
  .site-logo img { max-width: 100px; }
}

/* أزرار ومؤشرات سلايدر البنرات */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  background: rgba(14,116,211,0.6);
  border: none;
  color: #fff;
  font-size: 2.2em;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
  outline: none;
  display: flex; align-items: center; justify-content: center;
}
.slider-btn:hover { background: rgba(9,129,74,0.82);}
.slider-btn-prev { right: 18px; }
.slider-btn-next { left: 18px; }
@media (max-width: 700px) {
  .slider-btn { font-size: 1.45em; width: 34px; height: 34px; right:8px; left:8px;}
  .slider-btn-prev { right: 2px; }
  .slider-btn-next { left: 2px; }
}
.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  position: absolute;
  left: 0; right: 0; bottom: 18px;
  z-index: 7;
}
.slider-dot {
  display: inline-block;
  width: 11px; height: 11px;
  background: #fff;
  border-radius: 50%;
  border: 1.8px solid #0e74d3;
  opacity: 0.65;
  cursor: pointer;
  transition: background 0.2s, opacity 0.18s;
}
.slider-dot.active,
.slider-dot:hover { background: #09814a; opacity: 1; border-color: #09814a;}
.banner-slider-container .banner-slide { display: none; }
.banner-slider-container .banner-slide:first-child { display: block; }
