/* RTL (Right-to-Left) overrides for Arabic */

/* Set document direction to RTL */
html[lang="ar"],
body {
  direction: rtl;
  text-align: right;
}

/* Keep section headers centered */
html[lang="ar"] .section-header {
  text-align: center;
}

/* Center testimonials text */
html[lang="ar"] .testimonial {
  text-align: center;
}

html[lang="ar"] .testimonial .body-text {
  text-align: center;
}

/* FORCE signup section to match Swedish/English exactly */
html[lang="ar"] #signup .container {
  direction: ltr;
  display: flex;
  margin: 0 auto 4rem;
  padding: 2rem;
  max-width: 71.25rem;
}

html[lang="ar"] .signup-form-container {
  display: flex;
  width: 100%;
  flex-direction: row;
}

/* Center text in signup box but keep form LTR */
html[lang="ar"] .signup-text-box {
  text-align: center;
  flex: 2;
}

html[lang="ar"] .signup-text-box .heading-secondary,
html[lang="ar"] .signup-text-box .body-text {
  text-align: center;
}

html[lang="ar"] .signup-image-box {
  flex: 1.5;
  border-radius: 0 1rem 1rem 0;
}

/* Keep form labels centered */
html[lang="ar"] label {
  text-align: center;
}

html[lang="ar"] .signup-form {
  direction: rtl;
}

/* Navigation - flip alignment */
.nav-bar {
  flex-direction: row-reverse;
}

.main-nav-list {
  flex-direction: row-reverse;
}

/* Hero section - flip layout */
.hero-container {
  flex-direction: row-reverse;
}

html[lang="ar"] .hero-section .hero-container {
  flex-direction: column;
  text-align: center;
}

/* Features - keep header above grid */
.features-container {
  flex-direction: column;
}

/* Features grid - keep layout centered in RTL */
html[lang="ar"] #features .features-box {direction: ltr;}
html[lang="ar"] #features .feature-content {direction: rtl;}

/* Buttons - adjust spacing */
.hero-copy-box .btn:last-child:link,
.hero-copy-box .btn:last-child:visited {
  margin-left: 0;
  margin-right: 1rem;
}

/* Icons in lists - flip to right side */
.attribute ion-icon {
  margin-right: 0;
  margin-left: 0.625rem;
}

/* Footer - flip grid */
footer .container {
  direction: rtl;
}

/* Form inputs - align text right */
input,
label {
  text-align: right;
}

/* Language switcher - keep LTR */
.language-switcher {
  direction: ltr;
}

/* Meal cards - keep images on top */
.meal-cards-container {
  direction: rtl;
}

/* Download buttons - center alignment */
.download-cta-box {
  direction: ltr;
}

/* Partners section - keep full-bleed layout aligned */
html[lang="ar"] .download-section {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: auto;
  transform: none;
}

/* Testimonials */
.testimonials-box {
  direction: rtl;
}

/* Keep carousels LTR so slides don't go blank */
.carousel-container,
.team-carousel-container,
.carousel-track,
.team-carousel-track {
  direction: ltr;
}

/* Sign up form */
.signup-form-container {
  flex-direction: row-reverse;
}

.signup-image-box {
  border-radius: 1rem 0 0 1rem;
}

/* Mobile responsive adjustments */
@media only screen and (max-width: 768px) {
  .hero-copy-box .btn:last-child:link,
  .hero-copy-box .btn:last-child:visited {
    margin-right: 1rem;
    margin-left: 1rem;
  }
}

@media only screen and (max-width: 960px) {
  html[lang="ar"] .nav-open {
    text-align: center;
  }

  html[lang="ar"] .main-nav-list-mobile {
    flex-direction: column;
    align-items: center;
    gap: 1.6rem;
  }
}

@media only screen and (max-width: 570px) {
  .hero-copy-box .btn:last-child:link,
  .hero-copy-box .btn:last-child:visited {
    margin-right: 0;
    margin-left: 0;
  }
}
