/* التجاوب مع الشاشات المختلفة */
@media screen and (max-width: 1200px) {
  .container {
    width: 95%;
  }
}

@media screen and (max-width: 992px) {
  .about-content {
    flex-direction: column;
    gap: 2rem;
  }

  .values-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    background-attachment: scroll;
  }

  #achievements {
    background-attachment: scroll;
  }
}

@media screen and (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    background-color: var(--white);
    width: min(85%, 320px);
    height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    transition: right 0.3s ease-in-out;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.15);
    z-index: 999;
    overflow-y: auto;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links li {
    margin: 1rem 0;
    width: 100%;
    text-align: center;
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 1rem;
    width: 100%;
    font-size: 1.1rem;
  }

  .top-bar .container {
    flex-direction: column;
    gap: 0.625rem;
    text-align: center;
    padding: 0.5rem 1rem;
  }

  .top-contact-info {
    justify-content: center;
  }

  .contact-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .values-list {
    grid-template-columns: 1fr;
  }

  .achievements-list {
    grid-template-columns: repeat(2, 1fr);
  }

  section {
    padding: 50px 0;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }

  .footer-links h4::after {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
  }

  body.nav-open {
    overflow: hidden;
  }

  .logo {
    height: 50px;
  }
}

@media screen and (max-width: 576px) {
  .hero {
    height: 60vh;
    min-height: 400px;
  }

  .hero-content h1 {
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    margin-bottom: 1rem;
  }

  .hero-content p {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    margin-bottom: 1.5rem;
  }

  .btn {
    padding: 12px 30px;
    font-size: 16px;
    min-height: 44px;
  }

  .top-contact-info {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }

  .social-links {
    justify-content: center;
  }

  .achievements-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    margin-bottom: 30px;
  }

  .about-image,
  .about-text {
    min-width: 100%;
  }

  .contact-form {
    padding: 20px;
  }
}

/* دعم الشاشات عالية الدقة */
@media screen and (max-width: 480px) and (max-height: 700px) {
  .nav-links {
    padding-top: 1.5rem;
    justify-content: flex-start;
  }

  .nav-links li {
    margin: 0.625rem 0;
  }
}

/* تحسينات للوضع الأفقي على الهواتف */
@media screen and (max-height: 480px) and (orientation: landscape) {
  .nav-links {
    padding-top: 1rem;
    overflow-y: auto;
  }

  .nav-links li {
    margin: 0.5rem 0;
  }

  .hero {
    min-height: 350px;
    height: 100vh;
  }
}

/* تحسينات الأداء */
img {
  max-width: 100%;
  height: auto;
}

/* تحسين التحميل التدريجي للصور */
img[data-src] {
  opacity: 0;
  transition: opacity 0.3s;
}

img.lazy-loaded {
  opacity: 1;
}

/* تحسينات إضافية للشاشات الكبيرة جداً */
@media screen and (min-width: 1600px) {
  .container {
    max-width: 1400px;
  }
}

/* تحسينات للوضع المظلم */
@media (prefers-color-scheme: dark) {
  body:not(.light-mode) {
    background-color: #121212;
    color: #f5f5f5;
  }

  body:not(.light-mode) .feature,
  body:not(.light-mode) .value-item,
  body:not(.light-mode) .contact-item {
    background-color: #2a2a2a;
  }

  body:not(.light-mode) .product-card,
  body:not(.light-mode) .contact-form {
    background-color: #1e1e1e;
    color: #f5f5f5;
  }

  body:not(.light-mode) .form-group input,
  body:not(.light-mode) .form-group textarea {
    background-color: #2a2a2a;
    color: #f5f5f5;
    border-color: #444;
  }
}
