/* إعدادات عامة ومتغيرات الألوان للوضع النهاري/الليلي */
:root {
  --bg: #ffffff;
  --bg-rgb: 255, 255, 255;
  --text: #1a1a1a;
  --muted: #666666;
  --primary: #267445;   /* أخضر */
  --accent: #267445;    /* أخضر */
  --warn: #F9B122;      /* أصفر */
  --card: #f7f9fc;
  --border: #e5e9f2;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.16);
}
[data-theme="dark"] {
  --bg: #0f1217;
  --bg-rgb: 15, 18, 23;
  --text: #e6e6e6;
  --muted: #a1a8b0;
  --primary: #F9B122;   /* أصفر */
  --accent: #F9B122;    /* أصفر */
  --warn: #267445;      /* أخضر */
  --card: #151a22;
  --border: #222a35;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);
}

/* إعادة ضبط بسيطة */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: "Tajawal", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", Arial, sans-serif;
  scroll-behavior: smooth;
  transition: background-color 0.3s ease, color 0.3s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; transition: transform 0.3s ease; }

/* شريط التنقل العلوي */
.navbar {
  position: sticky; top: 0; z-index: 999;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.nav-wrap {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 18px;
}
.brand img {
    height: 50px;
}
.logo {
  width: 32px; height: 32px; border-radius: 10px;
  background:
    radial-gradient(circle at 75% 25%, var(--warn) 0 35%, transparent 36%),
    radial-gradient(circle at 35% 70%, var(--accent) 0 35%, transparent 36%),
    linear-gradient(135deg, var(--primary), var(--primary));
  outline: 2px solid var(--border);
}
.nav-links { 
  display: flex; 
  gap: 14px; 
  flex-wrap: wrap; 
  align-items: center;
}

@media (max-width: 768px) {
  .nav-links { 
    display: none;
    position: fixed; 
    top: 100%; 
    right: 0; 
    left: 0; 
    background: rgba(var(--bg-rgb), 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--border); 
    flex-direction: column; 
    padding: 20px; 
    gap: 10px; 
    width: 100vw;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    box-shadow: var(--shadow);
    z-index: 998;
  }
  
  .nav-links.show { 
    display: flex;
  }
}
.nav-links a {
  padding: 12px 18px; 
  border-radius: 10px; 
  color: var(--muted); 
  font-size: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: inline-block;
}
@media (min-width: 769px) {
  .nav-links a {
    width: auto;
    display: inline-block;
  }
}
.nav-links a::before {
  content: '';
  position: absolute;
  top: 0; right: 100%;
  width: 100%; height: 100%;
  background: var(--primary);
  z-index: -1;
  transition: right 0.3s ease;
}
.nav-links a:hover::before {
  right: 0;
}
.nav-links a.active, .nav-links a:hover { 
  color: #fff; 
  background: var(--primary);
}

@media (max-width: 768px) {
  .nav-links a {
    padding: 14px 16px;
    min-height: 44px;
    display: flex;
    align-items: center;
    width: 100%;
  }
}

/* زر وضع النهار/الليل */
.hamburger {
  display: none; 
  flex-direction: column; 
  gap: 5px; 
  width: 28px; 
  height: 24px; 
  cursor: pointer;
  background: none; 
  border: none; 
  padding: 6px 4px;
  transition: all 0.3s ease;
}
.hamburger:hover {
  transform: scale(1.1);
}
.hamburger span {
  height: 3px; 
  background: var(--text); 
  border-radius: 2px; 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}
.hamburger.open span:nth-child(1) { 
  transform: rotate(45deg) translate(7px, 7px);
  background: var(--primary);
}
.hamburger.open span:nth-child(2) { 
  opacity: 0; 
  transform: translateX(-10px);
}
.hamburger.open span:nth-child(3) { 
  transform: rotate(-45deg) translate(7px, -7px);
  background: var(--primary);
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
}

@media (min-width: 769px) {
  .hamburger { display: none !important; }
}

.mode-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card);
  cursor: pointer; font-size: 14px;
  color: #54a0ff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.mode-toggle:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(38, 116, 69, 0.3);
}
.mode-toggle:active {
  transform: scale(0.95);
}
/* الحاوية الأساسية */
.container { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }

/* أقسام الصفحة */
section { 
  padding: 80px 0; 
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
section::before {
  content: '';
  position: absolute;
  top: 0; right: -50%; left: -50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.5;
  z-index: 0;
}
section > * {
  position: relative;
  z-index: 1;
}
section:nth-child(even) {
  background: linear-gradient(135deg, rgba(38, 116, 69, 0.02) 0%, transparent 100%);
}
section:last-of-type { border-bottom: none; }
.section-header { margin-bottom: 32px; animation: fadeInUp 0.6s ease; }
.section-title { 
  font-size: 32px; 
  font-weight: 900; 
  display: inline-flex; 
  align-items: center; 
  gap: 12px;
  letter-spacing: -0.5px;
}
.section-desc { 
  margin-top: 12px; 
  color: var(--muted); 
  font-size: 17px;
  line-height: 1.6;
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* عناصر إضافية للعنوان */
.slash { color: var(--primary); }
.accent { color: var(--accent); }
.warn { color: var(--accent); }

/* البطائق */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px; 
  padding: 24px; 
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(38, 116, 69, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(38, 116, 69, 0.3);
}
.card h4 { margin: 8px 0 12px; font-size: 20px; font-weight: 700; }
.card p { margin: 0; color: var(--muted); line-height: 1.6; }

/* الهيرو */
@keyframes heroShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.hero { 
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 20px; align-items: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(38, 116, 69, 0.05) 50%, 
    transparent 100%);
  background-size: 200% 100%;
  animation: heroShimmer 4s linear infinite;
  z-index: 1;
  pointer-events: none;
}
.hero > * { position: relative; z-index: 2; }
.hero .badge {
  display: inline-block; padding: 8px 16px; font-size: 13px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--warn)); 
  color: #0b2a1b; 
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(38, 116, 69, 0.3);
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.hero h1 { 
  font-size: 42px; 
  margin: 16px 0 12px; 
  font-weight: 900;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.btn {
  padding: 12px 24px; 
  border-radius: 12px; 
  border: 2px solid var(--primary);
  background: var(--primary); 
  color: #fff; 
  font-weight: 700; 
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}
.btn::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}
.btn:hover::before {
  width: 300px;
  height: 300px;
}
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(38, 116, 69, 0.35);
  border-color: var(--primary);
}
.btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(38, 116, 69, 0.25);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn.secondary { 
  background: transparent; 
  color: var(--text); 
  border-color: var(--border);
}
.btn.secondary:hover { 
  background-color: var(--primary); 
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(38, 116, 69, 0.35);
}

.btn:focus-visible,
.input input:focus-visible,
.input select:focus-visible,
.input textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Custom scrollbars for Webkit */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--card);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--primary) 80%, black);
}



/* مواقعنا */
.locations { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.loc {
  display: flex; align-items: flex-start; gap: 10px; padding: 16px;
  border: 2px solid var(--border); 
  border-radius: 14px; 
  background: var(--card);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.loc::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(249, 177, 34, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.loc:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.loc-card { flex: 1; }

/* شركاؤنا */
.partners-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: center; }
.partner {
  width: 60px; height: 60px; border: 1px solid var(--border); border-radius: 12px;
  background:
    linear-gradient(135deg, var(--card), transparent 60%),
    repeating-linear-gradient(90deg, transparent 0 6px, rgba(0,0,0,0.03) 6px 7px);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-weight: 700;
}
.card-partner{
  width: 280px;
  height: 120px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
  gap: 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.card-partner:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: rgba(38, 116, 69, 0.3);
}
.card-partner h5 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}
.partner-img {
  width: 70px; 
  height: 70px;
  flex-shrink: 0;
  object-fit: contain;
  margin-right: 0;
  border-radius: 12px;
  transition: all 0.3s ease;
  background: rgba(38, 116, 69, 0.05);
  padding: 4px;
}
.card-partner:hover .partner-img {
  transform: scale(1.1);
  background: rgba(38, 116, 69, 0.1);
}

/* احجز موعدك */
.booking-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.booking-form .full { grid-column: 1 / -1; }
.input { display: flex; flex-direction: column; gap: 8px; }
.input label { 
  font-weight: 700; 
  font-size: 15px; 
  color: var(--text);
  transition: color 0.3s ease;
}
.input input, .input select, .input textarea {
  padding: 12px 16px; 
  border: 2px solid var(--border); 
  border-radius: 12px;
  background: var(--bg); 
  color: var(--text); 
  outline: none;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.input input:focus, .input select:focus, .input textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(38, 116, 69, 0.1);
  background: linear-gradient(to bottom, var(--bg), rgba(38, 116, 69, 0.02));
}
.input textarea {
  resize: vertical;
  min-height: 120px;
}
.booking-msg { 
  margin-top: 12px; 
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* تواصل معنا */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.contact .item { 
  padding: 20px; 
  border: 2px solid var(--border); 
  border-radius: 14px; 
  background: var(--card);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.contact .item::after {
  content: '';
  position: absolute;
  top: 0; right: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(38, 116, 69, 0.1) 0%, transparent 100%);
  transition: right 0.3s ease;
  pointer-events: none;
}
.contact .item:hover::after {
  right: 0;
}
.contact .item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

/* الفوتر */
footer {
  padding: 48px 16px 32px; 
  border-top: 2px solid var(--border);
  background: linear-gradient(180deg, 
    var(--card) 0%, 
    rgba(38, 116, 69, 0.02) 100%);
  color: var(--muted);
  position: relative;
  overflow: hidden;
}
footer::before {
  content: '';
  position: absolute;
  top: 0; right: -30%; bottom: 0; left: -30%;
  background: 
    radial-gradient(circle at 80% 20%, rgba(38, 116, 69, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(249, 177, 34, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}
.footer-wrap { 
  max-width: 1100px; 
  margin: 0 auto; 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 32px;
  position: relative;
  z-index: 1;
}
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { 
  color: var(--muted); 
  transition: all 0.3s ease;
  position: relative;
  padding-bottom: 4px;
}
.footer-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}
.footer-links a:hover {
  color: var(--primary);
}
.footer-links a:hover::after {
  width: 100%;
  right: auto;
  left: 0;
}

/* استجابة الشاشات الصغيرة */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .locations, .contact, .booking-form { grid-template-columns: 1fr; }
  .partners-row { grid-template-columns: repeat(3, 1fr); }
  section { padding: 60px 0; }
  .section-title { font-size: 28px; }
}
@media (max-width: 768px) {
  .grid { grid-template-columns: 1fr; }
  .partners-row { grid-template-columns: repeat(2, 1fr); }
  .nav-wrap { gap: 12px; }
  .section-title { font-size: 24px; }
  .hero h1 { font-size: 32px; }
  .btn { padding: 11px 20px; font-size: 15px; }
  .product-cards { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .partners-row { grid-template-columns: repeat(2, 1fr); }
  .hamburger { display: flex; }
  .nav-wrap { padding: 12px 12px; }
  .brand span { display: none; }
  .brand img { height: 40px; }
  .mode-toggle { padding: 6px 10px; font-size: 12px; }
  section { padding: 48px 0; }
  .section-title { font-size: 20px; gap: 8px; }
  .section-desc { font-size: 15px; }
  .hero h1 { font-size: 26px; margin: 12px 0 8px; }
  .hero .badge { font-size: 12px; padding: 6px 12px; }
  .btn { 
    padding: 10px 18px; 
    font-size: 14px;
    width: 100%;
    max-width: 200px;
  }
  .hero-actions { 
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .booking-form { gap: 10px; }
  .input input, .input select, .input textarea { font-size: 16px; padding: 12px 14px; }
  .card-partner { width: 100%; height: auto; }
.product-card { width: 100%; height: auto; flex: 0 0 calc(100% / var(--visible-slides, 3)); }
}

.hero-media {
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.service-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover .service-img {
  transform: scale(1.08);
}





/* ===== PRODUCTS SLIDER SECTION - FULL WIDTH BAR ===== */
.products-section {
  padding: 60px 0;
  position: relative;
  z-index: 5;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

.products-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(-50vw + 50%);
  width: 100vw;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(38, 116, 69, 0.03) 0%, 
    rgba(249, 177, 34, 0.02) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  z-index: -1;
  pointer-events: none;
}

.products-section .section-header {
  margin: 0 auto 40px;
  max-width: 1100px;
  padding: 0 16px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.products-slider {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
}

.products-section.full-width-slider {
  width: 100vw;

  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 80px 0;
  background: var(--card); /* This gives the full-width background color */
}

.products-slider {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin-top: 32px;
  height: auto; /* Let content dictate height */
  display: block;
  overflow: hidden;
  border-radius: 0; /* Removed for full-width edge-to-edge look */
  background: transparent;
  box-shadow: none; /* Removed the "box" shadow */
  padding: 0 16px; /* Add horizontal padding */
}

/* Slider Track */
.slides {
  display: flex;
  transition: transform 0.5s ease;
}

.slide {
  min-width: 100%;
  box-sizing: border-box;
}

.slider-track {
  display: flex;

  flex-wrap: nowrap;
  padding: 0;
  gap: 24px;
  /* Remove padding - let products-slider handle it */
}

.slider-track.dragging {
  transition: none;
}

/* Product Cards */
.product-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  position: relative;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  touch-action: manipulation;
  contain: layout;
  flex: none;
  cursor: grab;
}

.product-card.dragging {
  cursor: grabbing;
  box-shadow: var(--shadow-lg);
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(249, 177, 34, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transition: all 0.3s ease;
}

.product-card:hover::before {
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(249, 177, 34, 0.25) 0%, transparent 70%);
}

.product-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: rgba(38, 116, 69, 0.4);
}

.product-img {
  width: 100%;
  height: 220px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, var(--card) 0%, rgba(38, 116, 69, 0.05) 100%);
}

.product-card:hover .product-img {
  transform: scale(1.1) rotateY(2deg);
}

.product-title {
  font-size: 18px;
  font-weight: 700;
  margin: 12px 0 8px;
  color: var(--text);
  flex-grow: 0;
  transition: color 0.3s ease;
}

.product-card:hover .product-title {
  color: var(--primary);
}

.product-description {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.5;
  flex-grow: 1;
  min-height: 3.5em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-clamp: 3;
  transition: color 0.3s ease;
}

.product-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin: 16px 0 20px;
  transition: all 0.3s ease;
}

.product-card:hover .product-price {
  font-size: 24px;
  transform: scale(1.1);
}

/* Slider Navigation Buttons */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border: 2px solid var(--border);
  background: rgba(var(--bg-rgb), 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow);
}
/* Ensure buttons stay visible on the full-width background */
.slider-btn {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.slider-btn:hover {
  border-color: var(--primary);
  background: rgba(38, 116, 69, 0.1);
  color: var(--primary);
  transform: translateY(-50%) scale(1.15);
  box-shadow: var(--shadow-md);
}

.slider-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.prev-btn {
  left: 32px;
}

.next-btn {
  right: 32px;
}

/* Slider Dots */
.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 24px auto 0;
  flex-wrap: wrap;
  padding: 0 16px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  padding: 0;
}

.dot:hover {
  background: var(--muted);
  transform: scale(1.3);
}

.dot.active {
  background: var(--primary);
  width: 28px;
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(38, 116, 69, 0.4);
}

.dot:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .products-section {
    padding: 40px 0;
    margin: 0;
    box-shadow: none;
  }
  .products-section .section-header {
    padding: 0 16px;
    margin-bottom: 30px;
  }
  .products-slider {
    padding: 0 16px 30px;
  }
  .product-card {
    min-height: 340px;
    padding: 16px;
  }
  .product-img {
    height: 180px;
  }
  .slider-btn {
    width: 40px;
    height: 40px;
    background: rgba(var(--bg-rgb), 0.98);
  }
  .prev-btn {
    right: auto;
    left: 24px;
  }
  .next-btn {
    right: 24px;
    left: auto;
  }
  .slider-dots {
    gap: 6px;
  }
  .dot {
    width: 6px;
    height: 6px;
  }
  .dot.active {
    width: 24px;
  }
  .slider-dots {
    margin-top: 20px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .products-section {
    padding: 50px 0;
    margin: 0;
    box-shadow: none;
  }
  .products-section .section-header {
    padding: 0 16px;
    margin-bottom: 35px;
  }
  .products-slider {
    padding: 0 16px 35px;
  }
  .product-card {
    min-height: 360px;
    flex: 0 0 auto;
    width: calc(50% - 12px); /* Adjusted for 24px gap split 2 ways */
  }
  .slider-btn {
    width: 42px;
    height: 42px;
  }
  .prev-btn {
    right: auto;
    left: 24px;
  }
  .next-btn {
    right: 24px;
    left: auto;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .products-section {
    margin: 0;
    box-shadow: none;
  }
  .products-slider {
    padding: 0 16px;
  }
  .product-card {
    flex: 0 0 auto;
    width: calc(50% - 12px); /* Adjusted for 24px gap split 2 ways */
  }
}

@media (min-width: 1025px) {
  .products-section {
    margin: 0;
    box-shadow: none;
  }
  .products-slider {
    padding: 0 16px;
  }
  .product-card {
    flex: 0 0 auto;
    width: calc(33.333% - 8px); /* Adjusted for 24px gap split 3 ways */
  }
}

@media (max-width: 768px) {
  .product-img {
    max-height: 200px;
  }
}

/* ========== ENHANCED PRODUCT CARDS ========== */
.product-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.product-image-wrapper .product-img {
  margin-bottom: 0;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image-wrapper .product-img {
  transform: scale(1.08);
}

.product-category-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 2;
  pointer-events: none;
  letter-spacing: 0.3px;
}

.product-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  text-align: right;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.product-seller {
  font-size: 13px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.product-seller::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--warn));
  opacity: 0.8;
  flex-shrink: 0;
}

.product-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.product-actions .btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 14px;
  min-height: 40px;
}

.product-actions .btn.secondary {
  border-color: var(--border);
}

.product-actions .btn.secondary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Button sizes */
.btn-sm {
  padding: 10px 18px;
  font-size: 14px;
  min-height: 40px;
}

/* Product card entrance animation */
.product-card {
  animation: cardFadeIn 0.5s ease backwards;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }
.product-card:nth-child(7) { animation-delay: 0.35s; }
.product-card:nth-child(8) { animation-delay: 0.4s; }

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile refinements for enhanced cards */
@media (max-width: 480px) {
  .product-actions {
    flex-direction: column;
    gap: 8px;
  }
  .product-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .product-category-badge {
    font-size: 11px;
    padding: 4px 10px;
  }
}

/* ========== إضافي ====================== */

/* عناصر الحركة والانتقالات */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(38, 116, 69, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(38, 116, 69, 0);
  }
}

/* Slider Animations */
@keyframes sliderPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes dotPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes slideFromLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideFromRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* تطبيق الحركات على العناصر */
.card {
  animation: scaleIn 0.5s ease;
}

.btn {
  min-width: 100px;
}

.btn:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* تحسينات الوصول */
.nav-links a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.input input:focus-visible,
.input select:focus-visible,
.input textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* تحسين الضبط على الهاتف المحمول */
@media (hover: none) {
  .btn:active::before {
    width: 200px;
    height: 200px;
  }
  
  .card:active {
    transform: translateY(-4px);
  }
}

/* تحسين نص الفائق على الأجهزة التي تدعم hover */
@media (hover: hover) {
  a:hover {
    transition: all 0.3s ease;
  }
}

/* ========== AUTHENTICATION PAGES ========== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(38, 116, 69, 0.1), rgba(249, 177, 34, 0.05));
    padding: 20px;
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-md);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 28px;
    margin: 0 0 10px;
    color: var(--primary);
}

.auth-header p {
    color: var(--muted);
    margin: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(38, 116, 69, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
    color: #721c24;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    border-color: #28a745;
    color: #155724;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

.alert li {
    margin-bottom: 5px;
}

.btn-register {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-register:hover {
    background: color-mix(in srgb, var(--primary) 90%, black);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.auth-links {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Enhanced Remember Me Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: flex-end;
    margin-left: auto;
    width: fit-content;
}




.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.checkbox-group label {
    margin: 0;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    font-size: 15px;
    user-select: none;
    transition: color 0.3s ease;
}

.checkbox-group:hover label {
    color: var(--primary);
}

.checkbox-group input[type="checkbox"]:focus-visible + label {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
    padding: 2px;
}

@media (max-width: 480px) {
    .checkbox-group {
        gap: 8px;
    }
    
    .checkbox-group input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }
}


.password-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 5px;
}

@media (max-width: 768px) {
    .auth-card {
        padding: 30px 20px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========== ADMIN PAGES ========== */
.admin-container {
    background: transparent;
}

.admin-header {
    animation: slideFromLeft 0.5s ease;
}

.form-card {
    animation: scaleIn 0.3s ease;
}

.categories-grid {
    animation: slideFromRight 0.5s ease;
}

.category-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: scaleIn 0.4s ease;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.btn-small {
    transition: all 0.3s ease;
}

.btn-small:hover {
    transform: scale(1.1);
}

.table-responsive {
    animation: scaleIn 0.3s ease;
}

.table-responsive table tr:hover {
    background: rgba(38, 116, 69, 0.05);
}

/* ========== ADS/PRODUCTS PAGES ========== */
.create-ad-container {
    animation: slideFromLeft 0.5s ease;
}

.ads-container {
    animation: slideFromLeft 0.5s ease;
}

.search-filter {
    animation: slideFromLeft 0.4s ease;
}

.ads-grid {
    animation: slideFromRight 0.5s ease;
}

.ad-card {
    animation: scaleIn 0.4s ease;
}

.ad-view-container {
    animation: slideFromLeft 0.5s ease;
}

@media (max-width: 768px) {
    .ad-view-container {
        display: block !important;
    }
    
    .search-filter {
        grid-template-columns: 1fr;
    }
}
