/* 
==================================================================
   AL JEDYAN AL DAHABI GENERAL TRADING L.L.C - RESPONSIVE STYLESHEET
   Author: Senior Front-End Developer & UI/UX Architect
==================================================================
*/

/* --- Media Queries --- */

/* Laptops & Standard Desktops (under 1200px) */
@media (max-width: 1199px) {
  .container {
    padding: 0 1.5rem;
  }
  .nav-menu {
    gap: 1.5rem;
  }
  .intro-grid, .map-section-grid, .contact-grid {
    gap: 2.5rem;
  }
  .footer-grid {
    grid-template-columns: 1.2fr 0.8fr 0.8fr 1.2fr;
    gap: 2rem;
  }
}

/* Tablets & Small Laptops (under 991px) */
@media (max-width: 991px) {
  :root {
    --header-height: 80px;
  }
  
  section {
    padding: 60px 0;
  }

  /* Hamburger & Navigation Drawer */
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    width: 280px;
    height: calc(100vh - var(--header-height));
    background-color: var(--color-white);
    flex-direction: column;
    align-items: flex-start;
    padding: 3rem 2rem;
    gap: 1.5rem;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    transition: var(--transition-smooth);
    z-index: 999;
    border-right: 2px solid var(--color-light-gray);
    overflow-y: auto;
  }

  /* Mirror drawer for RTL Arabic pages */
  html[lang="ar"] .nav-menu {
    left: auto;
    right: -100%;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    border-right: none;
    border-left: 2px solid var(--color-light-gray);
  }

  .nav-menu.active {
    left: 0;
  }

  html[lang="ar"] .nav-menu.active {
    right: 0;
  }

  .nav-link {
    font-size: 1.1rem;
    width: 100%;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-light-gray);
  }

  .nav-link::after {
    display: none;
  }

  .header-actions .btn-primary {
    display: none; /* Hide desktop header CTA */
  }
  
  .d-mobile-only {
    display: inline-flex !important;
  }

  .logo img {
    height: 48px;
  }
  
  .header.scrolled .logo img {
    height: 44px;
  }
  
  /* Add CTA button to nav drawer list dynamically in JS or write it statically */
  .nav-menu .btn-primary {
    display: inline-flex;
    width: 100%;
    margin-top: 1.5rem;
  }

  /* Grids adjustments */
  .intro-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .intro-image-wrapper {
    max-width: 500px;
    margin: 0 auto;
  }

  .trade-bar-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  .process-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
  
  .process-grid::before {
    display: none; /* Hide line connection */
  }

  .map-section-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .map-visual-container {
    height: 350px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .maps-container {
    grid-template-columns: 1fr;
  }
}

/* Mobiles (under 768px) */
@media (max-width: 767px) {
  .logo img {
    height: 44px !important;
  }

  .hero {
    height: 80vh;
    min-height: 500px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero p {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 1rem;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  .trade-bar-grid {
    grid-template-columns: 1fr 1fr;
  }

  .process-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .product-tabs-nav {
    flex-wrap: wrap;
    gap: 0.8rem;
  }

  .product-tab-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer-col h3 {
    margin-bottom: 1.2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .contact-form-container {
    padding: 2rem 1.5rem;
  }

  .form-group-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .lightbox {
    padding: 1rem;
  }
}

/* Small Mobiles (under 480px) */
@media (max-width: 479px) {
  .logo img {
    height: 38px !important;
  }

  .intro-experience-badge {
    position: static;
    margin-top: 1.5rem;
    width: 100%;
    box-shadow: none;
    border-left: 4px solid var(--color-primary-gold);
  }
  
  html[lang="ar"] .intro-experience-badge {
    border-right: 4px solid var(--color-primary-gold);
  }

  .trade-bar-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .gallery-filters {
    gap: 0.5rem;
  }

  .gallery-filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    width: 100%;
    text-align: center;
  }
}

/* --- Reduced Motion Accessibility Preferences --- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-delay: -1ms !important;
    animation-duration: -1ms !important;
    animation-iteration-count: 1 !important;
    background-attachment: initial !important;
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
}
