/* 
========================================
   Base Styles and Reset
======================================== 
*/
:root {
  --primary-color: #36c783;
  --primary-light: #33c97f;
  --primary-dark: #008a48;
  --secondary-color: #2c3e50;
  --accent-color: #4caf50;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --text-color: #212529;
  --gray-color: #6c757d;
  --light-gray: #f1f1f1;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
  --border-radius: 8px;
  --container-width: 1200px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif, "Arial";
  line-height: 1.6;
  color: var(--text-color);
  background-color: #fff;
  overflow-x: hidden;
  direction: rtl;
  text-align: right;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* 
========================================
   Common Components
======================================== 
*/

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
}

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

.btn-primary:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

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

.btn-secondary:hover {
  background-color: rgba(63, 81, 181, 0.05);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-color);
  border: 2px solid var(--light-gray);
}

.btn-outline:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--secondary-color);
}

.section-header p {
  font-size: 1.1rem;
  color: var(--gray-color);
  max-width: 700px;
  margin: 0 auto;
}

/* 
========================================
   Header and Navigation
======================================== 
*/
.header-animation-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: var(--transition);
}

.header-animation-container.sticky {
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  animation: slideDown 0.5s ease-in-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }

  to {
    transform: translateY(0);
  }
}

.header {
  background-color: white;
  box-shadow: var(--shadow);
  width: 100%;
  padding: 25px 0;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  display: flex;
  align-items: center;
}

.logo h2 {
  color: var(--primary-color);
  font-weight: 700;
}

.nav ul {
  display: flex;
  align-items: center;
  height: 100%;
}

.nav li {
  margin-left: 0;
  margin-right: 30px;
  display: flex;
  align-items: center;
  height: 100%;
}

.nav a {
  color: var(--secondary-color);
  font-weight: 500;
  position: relative;
  padding: 25px 0 5px 0;
  display: flex;
  align-items: center;
  min-height: 100%;
}

.nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: auto;
  right: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: var(--transition);
}

.nav a:hover::after {
  width: 100%;
}

/* Dropdown Menu Styles */
.dropdown {
  position: relative;
}

/* قائمة المنتجات تستخدم تمركز CSS */
.dropdown:nth-child(2) .dropdown-menu {
  position: absolute;
  top: 100%;
  right: 50%;
  transform: translateX(50%) translateY(-10px);
  margin: 0;
}

.dropdown:nth-child(2):hover .dropdown-menu {
  transform: translateX(50%) translateY(0);
}

/* قائمة الحلول تستخدم تمركز CSS */
.dropdown:nth-child(3) .dropdown-menu {
  position: absolute;
  top: 100%;
  right: 50%;
  transform: translateX(50%) translateY(-10px);
  margin: 0;
}

.dropdown:nth-child(3):hover .dropdown-menu {
  transform: translateX(50%) translateY(0);
}

.dropdown-toggle {
  cursor: pointer;
  padding: 25px 0 5px 0;
  display: flex;
  align-items: center;
  min-height: 100%;
}

.dropdown-toggle i {
  margin-right: 10px;
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle i {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: fixed;
  top: 110px; /* ← تم زيادة المسافة لتناسب الـ header الجديد */
  left: 0;
  transform: translateY(-10px);
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  border: 1px solid #e5e7eb;
  width: 700px;
  max-width: 90vw;
  margin: 0;
  box-sizing: border-box;
}

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

.dropdown-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  position: relative;
}

.dropdown-grid::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary-color) 0%, rgba(54, 199, 131, 0.8) 30%, rgba(54, 199, 131, 0.6) 60%, rgba(54, 199, 131, 0.3) 80%, transparent 100%);
  transform: translateX(-50%);
}

.dropdown-section {
  display: flex;
  flex-direction: column;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
  text-align: right;
}

.dropdown-item {
  padding: 10px;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.dropdown-item h4 {
  color: var(--secondary-color);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 5px;
  margin: 0 0 5px 0;
}

.dropdown-item p {
  color: var(--gray-color);
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.4;
}

/* Mobile dropdown styles */
@media (max-width: 768px) {
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
    margin-top: 10px;
    margin-right: 20px;
  }
  
  .dropdown-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .dropdown-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
  }
  
  .dropdown-toggle i {
    margin-left: 5px;
  }
  
  .dropdown.active .dropdown-toggle i {
    transform: rotate(180deg);
  }
}

.nav-mobile {
  display: none;
  position: relative;
  z-index: 1000;
}

#nav-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 20px;
  position: relative;
  padding: 15px;
  margin: -15px;
  z-index: 1001;
  -webkit-tap-highlight-color: transparent;
  /* Improve touch target size */
  touch-action: manipulation;
}

#nav-toggle span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: var(--secondary-color);
  border-radius: 3px;
  left: 0;
  transition: var(--transition);
}

#nav-toggle span:nth-child(1) {
  top: 0;
}

#nav-toggle span:nth-child(2) {
  top: 8px;
}

#nav-toggle span:nth-child(3) {
  top: 16px;
}

/* 
========================================
   Card Styles
======================================== 
*/
.cards-section {
  padding: 100px 0;
  background-color: #f5f7fa;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

@media (min-width: 992px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.custom-card {
  background-color: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

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

.card-image {
  height: 200px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

.card-content {
  padding: 25px;
}

.card-content h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: var(--secondary-color);
}

.card-content ul {
  padding-right: 20px;
  margin-bottom: 0;
}

.card-content ul li {
  margin-bottom: 8px;
  position: relative;
  list-style-type: none;
}

.card-content ul li:before {
  content: "\f00c";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: var(--primary-color);
  margin-left: 10px;
}

/* 
========================================
   SweetAlert Custom Styles
======================================== 
*/
.swal2-popup {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif, "Arial";
  direction: rtl;
  text-align: right;
}

.swal2-title {
  color: var(--secondary-color);
}

.swal2-html-container {
  text-align: right;
}

.swal2-html-container img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
}

.swal2-html-container ul {
  padding-right: 20px;
  margin-bottom: 15px;
  text-align: right;
}

.swal2-html-container ul li {
  margin-bottom: 8px;
  position: relative;
  list-style-type: none;
}

.swal2-html-container ul li:before {
  content: "\f00c";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: var(--primary-color);
  margin-left: 10px;
}

.additional-info {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--light-gray);
}

/* 
========================================
   Footer
======================================== 
*/
.footer {
  background-color: #1a2530;
  color: white;
  padding: 80px 0 30px;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 50px;
}

.footer-logo {
  max-width: 300px;
  margin-bottom: 30px;
}

.footer-logo h2 {
  color: white;
  margin-bottom: 20px;
}

.footer-logo p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 25px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  justify-content: space-between;
  max-width: 700px;
}

.footer-links-column {
  margin-bottom: 30px;
  min-width: 150px;
}

.footer-links-column h3 {
  color: white;
  font-size: 1.2rem;
  margin-bottom: 20px;
}

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

.footer-links-column a {
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
}

.footer-links-column a:hover {
  color: white;
  padding-left: 5px;
}

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

.footer-bottom p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

/* 
========================================
   Responsive Styles
======================================== 
*/
@media (max-width: 1200px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 992px) {
  .hero .container {
    flex-direction: column;
    text-align: center;
  }

  .hero-content {
    margin-bottom: 50px;
    max-width: 100%;
  }

  .footer-content {
    flex-direction: column;
  }

  .footer-logo {
    max-width: 100%;
    text-align: center;
    margin-bottom: 40px;
  }

  .footer-links {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .nav-mobile {
    display: block;
  }

  .cta-button {
    display: none;
  }

  .hero {
    padding: 150px 0 80px;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .section-header h2 {
    font-size: 2rem;
  }



  .section-header h3 {
    font-size: 1.5rem;
  }
}

@media (max-width: 576px) {
  .hero-content h1 {
    font-size: 2rem;
  }

  .btn {
    display: block;
    width: 100%;
    margin-bottom: 15px;
  }

  .section-header h2 {
    font-size: 1.8rem;
  }
}