/* Reset and Global Styles */
body {
  font-family: "Overpass", sans-serif;
  margin: 0;
  scroll-behavior: smooth;
  color: #171b1e;
}

.hidden {
  display: none;
}

/* For screen readers - accessible but visually hidden */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Typography */
h2,
h3,
h4,
p strong {
  text-align: center;
  color: #235b4e;
  font-family: "Optima", sans-serif;
}

h3,
h4 {
  margin-top: 2rem;
}

h4 {
  margin-top: 1.5rem;
}

p {
  text-align: center;
  max-width: 50rem;
  margin: 1.25rem auto;
  color: #898f65;
  font-family: "Optima", sans-serif;
}

p strong {
  color: #235b4e;
  font-family: "Optima", sans-serif;
}

/* Arabic Fonts */
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] p strong {
  font-family: "Tajawal", sans-serif;
}

[dir="rtl"] p {
  font-family: "Tajawal", sans-serif;
}

[dir="rtl"] li {
  font-family: "Tajawal", sans-serif;
}

[dir="rtl"] a {
  font-family: "Tajawal", sans-serif;
}

[dir="rtl"] button {
  font-family: "Tajawal", sans-serif;
}

/* Unordered Lists */
ul {
  list-style-type: none;
  padding: 0;
  margin: 1rem auto;
  max-width: 800px;
}

ul li {
  margin-bottom: 0.5rem;
  font-family: "Optima", sans-serif;
  color: #898f65;
  text-align: center;
}

[dir="rtl"] ul li {
  font-family: "Tajawal", sans-serif;
}

/* Header Styles */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  background-color: white;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
  padding: 0.625rem 1.25rem;
}

.logo-container {
  margin-bottom: 0.625rem;
}

.logo {
  height: 3.125rem;
}

nav ul {
  display: flex;
  justify-content: center;
  list-style-type: none;
  padding: 0;
  margin: 0;
}

nav ul li {
  margin: 0 0.9375rem;
}

nav ul li a {
  color: #235b4e;
  text-decoration: none;
  font-size: 1rem;
  font-weight: bold;
  font-family: "Optima", sans-serif;
}

[dir="rtl"] nav ul li a {
  font-family: "Tajawal", sans-serif;
}

nav ul li.separator {
  color: #235b4e;
  font-weight: bold;
}

.language-buttons button {
  background: none;
  color: #ee7623;
  font-size: 1rem;
  border: none;
  font-weight: bold;
  cursor: pointer;
  font-family: "Optima", sans-serif;
}

[dir="rtl"] .language-buttons button {
  font-family: "Tajawal", sans-serif;
}

.language-buttons button:hover {
  color: #c25e16;
}

.menu-button {
  display: none;
  cursor: pointer;
  position: absolute;
  background: none;
  border: none;
  outline: none;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.menu-button:focus, .menu-button:hover {
  background-color: rgba(35, 91, 78, 0.1);
}

.section {
  padding-bottom: 1rem;
  min-height: 10vh;
  margin-top: 7.5rem;
  opacity: 0;
}

/* Hero Section */
.hero {
  background: url("../assets/images/cover.webp?v=2") no-repeat center center/cover;
  text-align: center;
  color: white;
  padding: 12.5rem 0;
  position: relative;
}

.hero-text-container {
  background-color: rgba(35, 91, 78, 0.8);
  padding: 1.25rem;
  display: inline-block;
  border-radius: 0.625rem;
}

.hero-text {
  font-size: 3rem;
  opacity: 0;
  transform: translateY(-1.25rem);
  font-family: "Optima", sans-serif;
}

[dir="rtl"] .hero-text {
  font-family: "Tajawal", sans-serif;
}

.hero-subtext {
  font-size: 1.5rem;
  opacity: 0;
  transform: translateY(-1.25rem);
  font-family: "Overpass", sans-serif;
}

[dir="rtl"] .hero-subtext {
  font-family: "Tajawal", sans-serif;
}

/* Products Section */

.product {
  text-align: center;
  margin: 2rem auto;
  position: relative;
  max-width: 25rem;
}

.product-image-container {
  width: 100%;
  perspective: 62.5rem;
  position: relative;
  height: auto;
  margin-bottom: 2rem;
}

.image-container {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.image-container img {
  display: none;
}

.image-container.loaded img {
  display: block;
}

.image-container.loaded .spinner {
  display: none;
}

.product-image {
  width: 50%;
  transition: transform 0.6s;
}

.rotate-icon {
  position: absolute;
  bottom: 0.625rem;
  right: 2.25rem;
  font-size: 1.5rem;
  color: #235b4e;
  cursor: pointer;
  transition: transform 0.6s;
}

[dir="rtl"] .rotate-icon {
  right: auto;
  left: 2.25rem;
}

.rotate-icon.rotate {
  transform: rotate(180deg);
}

.product-image.rotate {
  transform: rotateY(100deg);
}

.product h3 {
  font-size: 1.5rem;
  color: #235b4e;
  margin: 0.625rem 0;
  font-family: "Optima", sans-serif;
}

[dir="rtl"] .product h3 {
  font-family: "Tajawal", sans-serif;
}

.product p {
  color: #898f65;
  font-size: 1rem;
  font-family: "Optima", sans-serif;
}

[dir="rtl"] .product p {
  font-family: "Tajawal", sans-serif;
}

.product-icons {
  list-style-type: none;
  padding: 0;
  display: flex;
  justify-content: center;
  margin-top: 0.625rem;
}

.product-icons li {
  margin: 0 0.625rem;
  font-size: 1rem;
  color: #235b4e;
  font-family: "Optima", sans-serif;
  display: flex;
  align-items: center;
  flex-direction: column;
}

[dir="rtl"] .product-icons li {
  font-family: "Tajawal", sans-serif;
}

.product-icon {
  width: 1.875rem !important;
  height: auto !important;
  margin-bottom: 0.3125rem !important;
}

/* Process Image */
.process-image img {
  max-width: 40%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Contact Us Section */
#contact-us {
  text-align: center;
}

#contact-us form {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 37.5rem;
  margin: 0 auto;
}

#contact-us input,
#contact-us select,
#contact-us textarea {
  padding: 0.625rem;
  margin: 0.625rem 0;
  font-size: 1rem;
  font-family: "Optima", sans-serif;
  width: 80%;
  max-width: 25rem;
}

[dir="rtl"] #contact-us input,
[dir="rtl"] #contact-us select,
[dir="rtl"] #contact-us textarea {
  font-family: "Tajawal", sans-serif;
}

#contact-us button {
  padding: 0.625rem;
  background-color: #235b4e;
  color: white;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  font-family: "Optima", sans-serif;
  width: 100%;
  max-width: 25rem;
  text-align: center;
}

[dir="rtl"] #contact-us button {
  font-family: "Tajawal", sans-serif;
}

/* Footer */
footer {
  background-color: #235b4e;
  text-align: center;
  padding: 1.25rem 0rem 1.25rem 0rem;
  font-family: "Optima", sans-serif;
}

footer p {
  color: white;
}

.social-media a {
  color: white;
  margin: 0 0.625rem;
  text-decoration: none;
  font-family: "Optima", sans-serif;
  font-size: 1.5rem;
}

.social-media a:hover {
  color: #898f65;
}

/* Developer Credit Styles */
.developer-credit {
  margin-top: 1rem;
  font-family: "Optima", sans-serif;
  font-size: 1rem;
  color: #fff;
  position: relative;
  text-align: center;
  overflow: hidden;
}

.developer-credit a {
  color: #fff;
  text-decoration: none;
  position: relative;
  display: inline-block;
  padding: 0.5rem 1rem;
  transition: color 0.3s ease;
}

.developer-credit a::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: #898f65;
  transition: width 0.3s ease;
}

.developer-credit a:hover::before {
  width: 100%;
}

.developer-credit a:hover {
  color: #898f65;
}

.developer-credit a span {
  position: relative;
  z-index: 1;
}

.developer-credit a:hover {
  text-shadow: 0 0 10px rgba(137, 143, 101, 0.7);
}

.developer-credit::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(137, 143, 101, 0.5),
    transparent
  );
  transform: translateX(-100%) skewX(-25deg);
  animation: slide 3s infinite;
  will-change: transform;
}

@keyframes slide {
  from {
    transform: translateX(-100%) skewX(-25deg);
  }
  to {
    transform: translateX(300%) skewX(-25deg);
  }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 2rem;
  border: 1px solid #888;
  width: 90%;
  max-width: 500px;
  border-radius: 8px;
  position: relative;
  text-align: center;
  font-family: "Optima", sans-serif;
}

[dir="rtl"] .modal-content {
  font-family: "Tajawal", sans-serif;
}

.close-button {
  color: #aaa;
  float: right;
  font-size: 1.5rem;
  font-weight: bold;
  position: absolute;
  top: 1rem;
  right: 1rem;
  cursor: pointer;
}

.close-button:hover,
.close-button:focus {
  color: black;
  text-decoration: none;
}

.modal-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.modal-icon.success {
  color: #1c6b2fff;
}

.modal-icon.error {
  color: #991e2aff;
}

/* Spinner */
.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: #235b4e;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  animation: spin 1s linear infinite;
  margin: auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Media Queries */
@media (max-width: 48rem) {
  /* Header adjustments */
  header {
    flex-direction: row;
    justify-content: space-between;
    padding: 0.75rem 1rem;
  }

  .menu-button {
    display: block;
    position: relative;
    top: 0.1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    z-index: 1001;
    color: #235b4e;
    padding: 0.5rem 0.8rem;
    margin: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
  }

  .menu-button:hover {
    background-color: rgba(35, 91, 78, 0.1);
  }
  
  .menu-button.active {
    color: #ee7623;
  }

  [dir="rtl"] .menu-button {
    left: 1.5rem;
    right: auto;
  }

  nav ul li.separator {
    display: none;
  }

  nav {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 999;
  }

  nav ul {
    flex-direction: column;
    display: block;
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background-color: white;
    z-index: 1000;
    padding-top: 80px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    overflow-y: auto;
    pointer-events: all;
  }

  [dir="rtl"] nav ul {
    right: auto;
    left: -280px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }

  nav ul.show {
    transform: translateX(-280px);
  }

  [dir="rtl"] nav ul.show {
    transform: translateX(280px);
  }

  nav::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }

  nav.active::before {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
  }

  nav ul li {
    margin: 0;
    text-align: left;
    border-bottom: 1px solid rgba(35, 91, 78, 0.1);
  }

  [dir="rtl"] nav ul li {
    text-align: right;
  }

  nav ul li a {
    display: block;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    transition: all 0.2s ease;
  }

  nav ul li a:hover {
    background-color: rgba(35, 91, 78, 0.1);
    color: #ee7623;
  }

  .language-buttons {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    border-bottom: none !important;
  }

  .language-buttons button {
    padding: 0.5rem 1rem;
    background-color: rgba(35, 91, 78, 0.1);
    border-radius: 4px;
    margin: 0 0.5rem;
  }

  /* Hero adjustments */
  .hero {
    background: url("../assets/images/cover-mobile.webp?v=2") no-repeat center
      center/cover;
  }

  .rotate-icon {
    right: 3.5rem;
  }
  
  [dir="rtl"] .rotate-icon {
    right: auto;
    left: 3.5rem;
  }

  /* Contact Us form adjustments */
  #contact-us form {
    width: 80%;
    margin: 0 auto;
  }

  #contact-us input,
  #contact-us select,
  #contact-us textarea,
  #contact-us button {
    width: 100%;
  }

  /* Process Image adjustments */
  .process-image img {
    max-width: 80%;
    height: auto;
  }

  /* Developer Credit adjustments */
  .developer-credit {
    font-size: 0.9rem;
  }

  .developer-credit a {
    padding: 0.5rem;
  }

  .developer-credit a i {
    margin-right: 0.3rem;
  }

  /* Modal Styles */
  .modal-content {
    padding: 1rem;
  }

  .close-button {
    font-size: 1.2rem;
    top: 0.5rem;
    right: 0.5rem;
  }
}
