/* FINAL layout polish */

/* Home product slideshow must always work */
body .product-home-slider {
  position: relative !important;
  min-height: 560px !important;
}

body .product-home-slider .slide {
  display: none !important;
}

body .product-home-slider .slide.visible {
  display: block !important;
}

/* Footer must never be cut in half */
body .footer {
  width: 100vw !important;
  max-width: 100vw !important;
  position: relative !important;
  left: 50% !important;
  margin-left: -50vw !important;
  box-sizing: border-box !important;
}

/* Arabic media section: video normal size, fairs separated */
html[lang="ar"] body .video-and-fair {
  width: min(100% - 70px, 1380px) !important;
  direction: ltr !important;
  grid-template-columns: minmax(0, 940px) 390px !important;
  gap: 58px !important;
}

html[lang="ar"] body .home-video-panel {
  width: 940px !important;
  margin-left: -42px !important;
  margin-right: 0 !important;
  justify-self: end !important;
}

html[lang="ar"] body .fair-slideshow {
  width: 390px !important;
  max-width: 390px !important;
  margin-left: 34px !important;
  margin-right: 0 !important;
  justify-self: start !important;
}

/* Do not reverse physical arrow sides */
html[lang="ar"] body .fair-arrow.left,
html[lang="ar"] body .video-arrow.left,
html[lang="ar"] body .media-arrow.left {
  left: 6px !important;
  right: auto !important;
}

html[lang="ar"] body .fair-arrow.right,
html[lang="ar"] body .video-arrow.right,
html[lang="ar"] body .media-arrow.right {
  right: 6px !important;
  left: auto !important;
}

/* Arabic product slideshow: image right, text left */
html[lang="ar"] body .products-section .product-slide-image-frame {
  right: 130px !important;
  left: auto !important;
}

html[lang="ar"] body .products-section .slide .text {
  left: 130px !important;
  right: auto !important;
  direction: rtl !important;
  text-align: center !important;
}

/* Arabic loading popup bullets next to text */
html[lang="ar"] body .loading-popup-content {
  direction: rtl !important;
}

html[lang="ar"] body .loading-popup-content ul {
  direction: rtl !important;
  text-align: right !important;
  list-style-position: outside !important;
  padding-right: 28px !important;
  padding-left: 0 !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

html[lang="ar"] body .loading-popup-content li {
  direction: rtl !important;
  text-align: right !important;
  padding-right: 4px !important;
}

/* Header dropdown mobile safety */
body .products-horizontal-menu {
  max-width: calc(100vw - 30px) !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
}

html[lang="ar"] body .products-horizontal-menu {
  direction: rtl !important;
}

/* Mobile responsive pass */
@media (max-width: 980px) {
  body .header-container {
    flex-wrap: wrap !important;
    min-height: auto !important;
    padding: 8px 10px !important;
  }

  body .logo img {
    max-width: 210px !important;
    height: auto !important;
  }

  body .nav-links {
    order: 3 !important;
    width: 100% !important;
  }

  body .nav-links > ul {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
  }

  body .video-and-fair,
  html[lang="ar"] body .video-and-fair {
    width: min(100% - 28px, 900px) !important;
    grid-template-columns: 1fr !important;
    gap: 22px !important;
  }

  body .home-video-panel,
  html[lang="ar"] body .home-video-panel,
  body .fair-slideshow,
  html[lang="ar"] body .fair-slideshow {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    justify-self: center !important;
  }

  body .product-home-slider {
    min-height: 760px !important;
  }

  body .products-section .product-slide-image-frame,
  html[lang="ar"] body .products-section .product-slide-image-frame {
    position: static !important;
    width: min(92vw, 680px) !important;
    transform: none !important;
    margin: 0 auto 22px !important;
  }

  body .products-section .slide .text,
  html[lang="ar"] body .products-section .slide .text {
    position: static !important;
    width: min(92vw, 680px) !important;
    transform: none !important;
    margin: 0 auto !important;
  }

  body .products-section .product-slider-arrow.prev {
    left: 8px !important;
    right: auto !important;
  }

  body .products-section .product-slider-arrow.next {
    right: 8px !important;
    left: auto !important;
  }
}

@media (max-width: 700px) {
  body .footer-menu {
    grid-template-columns: 1fr !important;
    text-align: left !important;
  }

  html[lang="ar"] body .footer-menu {
    text-align: right !important;
  }

  body .contact-info {
    display: block !important;
  }

  body .contact-card {
    margin-bottom: 16px !important;
  }
}
