/* RTL (Right-to-Left) Styles for Arabic Language */

/* Apply RTL-specific styles only when dir="rtl" is set */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

/* Reset text alignment for RTL */
[dir="rtl"] body {
  text-align: right;
}

/* Header adjustments */
[dir="rtl"] .header-container {
  flex-direction: row-reverse;
}

[dir="rtl"] .logo {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-desktop ul {
  flex-direction: row-reverse;
}

[dir="rtl"] .header-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .header-search button {
  right: auto;
  left: 6px;
}

[dir="rtl"] .header-search input {
  padding: 10px 18px 10px 44px;
}

/* Mobile menu */
[dir="rtl"] .mobile-menu {
  left: auto;
  right: -100%;
}

[dir="rtl"] .mobile-menu.active {
  left: auto;
  right: 0;
}

[dir="rtl"] .mobile-menu-header {
  flex-direction: row-reverse;
}

/* Hero section */
[dir="rtl"] .hero-container {
  flex-direction: row-reverse;
}

[dir="rtl"] .hero-btns {
  flex-direction: row-reverse;
}

[dir="rtl"] .hero-visual img {
  transform: rotate(-2deg);
  border-radius: 40px 40px 0 40px;
}

[dir="rtl"] .hero-visual img:hover {
  transform: rotate(0deg) scale(1.02);
}

/* Buttons with icons */
[dir="rtl"] .btn {
  flex-direction: row-reverse;
}

/* Product cards */
[dir="rtl"] .product-content {
  text-align: right;
}

[dir="rtl"] .product-btn {
  flex-direction: row-reverse;
}

/* Teacher block */
[dir="rtl"] .teacher-block {
  flex-direction: row-reverse;
  border-radius: 50px 50px 0 50px;
}

[dir="rtl"] .teacher-content {
  text-align: right;
}

[dir="rtl"] .teacher-badge {
  flex-direction: row-reverse;
}

/* Footer */
[dir="rtl"] footer {
  border-radius: 60px 60px 0 0;
}

[dir="rtl"] .footer-grid {
  direction: rtl;
}

[dir="rtl"] .footer-col {
  text-align: right;
}

[dir="rtl"] .footer-col ul {
  text-align: right;
}

[dir="rtl"] .footer-col a {
  flex-direction: row-reverse;
}

[dir="rtl"] .footer-col a:hover {
  transform: translateX(-6px);
}

/* Newsletter */
[dir="rtl"] .newsletter-input {
  flex-direction: row-reverse;
}

/* Testimonials */
[dir="rtl"] .testimonial {
  text-align: right;
}

[dir="rtl"] .testimonial-author {
  flex-direction: row-reverse;
}

/* Cart icon */
[dir="rtl"] .cart-count {
  right: auto;
  left: 4px;
}

/* Language switcher */
[dir="rtl"] .language-switcher {
  flex-direction: row-reverse;
}

/* Age cards */
[dir="rtl"] .age-card {
  text-align: center; /* Keep centered for age cards */
}

/* Benefits cards */
[dir="rtl"] .benefit-card {
  text-align: center; /* Keep centered for benefit cards */
}

/* Search results dropdown */
[dir="rtl"] .search-results-dropdown {
  text-align: right;
}

/* Badges */
[dir="rtl"] .badge {
  flex-direction: row-reverse;
}

/* Social media icons - keep LTR */
[dir="rtl"] .footer-col > div[style*="display: flex"] {
  flex-direction: row;
}

/* Adjust margins and paddings for RTL */
[dir="rtl"] .logo i {
  margin-right: 0;
  margin-left: 10px;
}

[dir="rtl"] .footer-col h3 i {
  margin-right: 0;
  margin-left: 6px;
}

/* Shop page filters - RTL adjustments */
[dir="rtl"] .shop-layout {
  flex-direction: row-reverse;
}

[dir="rtl"] .filter-sidebar {
  border-right: none;
  border-left: 1px solid var(--gray-200);
}

[dir="rtl"] .filter-group {
  text-align: right;
}

/* Product grid - maintain grid flow */
[dir="rtl"] .product-grid {
  direction: rtl;
}

/* Ensure numbers stay LTR (prices, phone numbers) */
[dir="rtl"] .product-price,
[dir="rtl"] [href^="tel:"],
[dir="rtl"] .cart-count {
  direction: ltr;
  unicode-bidi: embed;
}

/* Keep email addresses LTR */
[dir="rtl"] [href^="mailto:"] {
  direction: ltr;
  unicode-bidi: embed;
}

/* Animations - mirror for RTL */
@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

[dir="rtl"] .mobile-menu {
  animation: slideInFromRight 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Responsive RTL adjustments */
@media screen and (max-width: 900px) {
  [dir="rtl"] .hero-container {
    flex-direction: column;
  }
  
  [dir="rtl"] .teacher-block {
    flex-direction: column;
  }
}

/* Fix for Arabic font rendering */
[dir="rtl"] body,
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
  font-family: 'Nunito', 'Poppins', 'Arial', 'Tahoma', sans-serif;
}

/* Improve Arabic text readability */
[dir="rtl"] {
  line-height: 1.8;
  letter-spacing: 0;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3 {
  line-height: 1.5;
}
