/* Language Toggle Button */
.language-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background-color: #1e3a8a;
  color: white;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 1rem;
}

.language-toggle:hover {
  background-color: #1e40af;
  transform: scale(1.05);
}

/* RTL Base Styles - Only apply when [dir="rtl"] is present */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] body {
  font-family: 'Arial', 'Tahoma', sans-serif;
}

/* RTL Header Adjustments */
[dir="rtl"] .header-content {
  flex-direction: row-reverse;
}

[dir="rtl"] .logo-link {
  flex-direction: row-reverse;
}

[dir="rtl"] .logo-icon {
  padding: 0.5rem;
}

[dir="rtl"] .logo-text {
  margin-right: 0;
  margin-left: 0;
}

[dir="rtl"] .nav-desktop {
  flex-direction: row-reverse;
}

[dir="rtl"] .language-toggle {
  margin-left: 0;
  margin-right: 1rem;
}

/* RTL Spacing Utilities */
[dir="rtl"] .space-x-2 > * + * {
  margin-left: 0;
  margin-right: 0.5rem;
}

[dir="rtl"] .space-x-4 > * + * {
  margin-left: 0;
  margin-right: 1rem;
}

[dir="rtl"] .space-x-8 > * + * {
  margin-left: 0;
  margin-right: 2rem;
}

[dir="rtl"] .mr-2 {
  margin-right: 0;
  margin-left: 0.5rem;
}

[dir="rtl"] .ml-2 {
  margin-left: 0;
  margin-right: 0.5rem;
}

/* RTL Flex Adjustments */
[dir="rtl"] .flex {
  flex-direction: row-reverse;
}

[dir="rtl"] .flex-col {
  flex-direction: column;
}

/* RTL Grid Adjustments */
[dir="rtl"] .grid {
  direction: rtl;
}

/* RTL Text Alignment */
[dir="rtl"] .text-left {
  text-align: right;
}

[dir="rtl"] .text-right {
  text-align: left;
}
[dir="rtl"] .card-header h3 {
  padding-right: 1rem;
  padding-left: 0;
}
/* RTL Car Card */
[dir="rtl"] .gap-1,
[dir="rtl"] .gap-2,
[dir="rtl"] .gap-3,
[dir="rtl"] .gap-4 {
  direction: rtl;
}

/* RTL Icons - Mirror certain icons for RTL */
[dir="rtl"] svg.mirror-rtl {
  transform: scaleX(-1);
}

/* RTL Footer */
[dir="rtl"] .footer-top {
  flex-direction: row-reverse;
}

[dir="rtl"] .footer-links {
  flex-direction: row-reverse;
}

[dir="rtl"] .footer-logo {
  flex-direction: row-reverse;
}

/* RTL Forms */
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select {
  text-align: right;
}

[dir="rtl"] .form-group {
  text-align: right;
}

/* RTL Contact Cards */
[dir="rtl"] .contact-grid {
  direction: rtl;
}

[dir="rtl"] .card-content {
  text-align: center;
}

/* RTL Policy Cards */
[dir="rtl"] .policy-list li {
  flex-direction: row-reverse;
  text-align: right;
  padding-left: 0;
  padding-right: 1.5rem;
}

[dir="rtl"] .policy-list li:before {
  right: 0;
  left: auto;
}

[dir="rtl"] .bullet {
  margin-right: 0;
  margin-left: 0.75rem;
}

[dir="rtl"] .card-header {
  flex-direction: row-reverse;
  text-align: right;
}



/* RTL Policy Title Fix */
.policy-title {
  color: #1e3a8a;
  text-align: left;
  position: relative;
}

[dir="rtl"] .policy-title {
  text-align: right !important;
  direction: rtl;
  font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
  margin-left: 0;
  margin-right: 0;
}

/* RTL Cancellation Items */
[dir="rtl"] .cancellation-item {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .cancellation-details {
  text-align: right;
}

[dir="rtl"] .cancellation-fee {
  text-align: left;
}

/* RTL Restriction Items */
[dir="rtl"] .restriction-item {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .warning-icon {
  margin-right: 0;
  margin-left: 0.75rem;
}

/* RTL Stats Grid */
[dir="rtl"] .stats-grid {
  direction: rtl;
}

/* RTL Story Section */
[dir="rtl"] .story-content {
  direction: rtl;
}

[dir="rtl"] .story-text {
  text-align: right;
}

/* RTL Values Grid */
[dir="rtl"] .values-grid {
  direction: rtl;
}

[dir="rtl"] .value-card {
  text-align: right;
}

/* RTL Hero Section */
[dir="rtl"] .hero {
  text-align: center;
}

/* RTL Hero Overlay */
[dir="rtl"] .hero-overlay {
  background: linear-gradient(to left, 
      rgba(30, 58, 138, 0.85), 
      rgba(30, 58, 138, 0.65), 
      transparent);
}

/* RTL Car Card Badges */
[dir="rtl"] .absolute.top-4.left-4 {
  left: auto;
  right: 1rem;
}

[dir="rtl"] .absolute.top-4.right-4 {
  right: auto;
  left: 1rem;
}

/* RTL Buttons with Icons */
[dir="rtl"] button svg,
[dir="rtl"] a svg {
  margin-right: 0;
  /* margin-left: 0.5rem; */
}

[dir="rtl"] .inline-flex svg:first-child {
  margin-left: 0.5rem;
  margin-right: 0;
}

[dir="rtl"] .inline-flex svg:last-child {
  /* margin-right: 0.5rem; */
  margin-left: 0;
}

/* RTL Car Details Specifics */
[dir="rtl"] .flex.items-center.gap-1,
[dir="rtl"] .flex.items-center.gap-2 {
  flex-direction: row-reverse;
}

/* RTL Specification Lists */
/* Fixed broken selector for .flex.justify-between in RTL */
[dir="rtl"] .flex.justify-between {
  flex-direction: row-reverse;
}

/* Smooth transitions for direction changes - only apply in RTL */
[dir="rtl"] * {
  transition: margin 0.3s ease, padding 0.3s ease;
}

/* Preserve center alignment regardless of direction */
[dir="rtl"] .text-center,
[dir="ltr"] .text-center {
  text-align: center !important;
}

/* Preserve justify-center regardless of direction */
[dir="rtl"] .justify-center,
[dir="ltr"] .justify-center {
  justify-content: center !important;
}

/* Arabic Font Optimization */
[dir="rtl"] body,
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6,
[dir="rtl"] p,
[dir="rtl"] span,
[dir="rtl"] div {
  font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
  letter-spacing: 0;
}

/* Better Arabic number display */
[dir="rtl"] .stat-number,
[dir="rtl"] .text-2xl,
[dir="rtl"] .text-3xl {
  font-family: 'Arial', sans-serif;
}

/* WhatsApp Button RTL */
[dir="rtl"] .whatsapp-float {
  right: auto;
  left: 40px;
}

@media (max-width: 768px) {
  [dir="rtl"] .whatsapp-float {
    left: 20px;
    right: auto;
  }
}
/* RTL Mobile Navigation Menu */
[dir="rtl"] .mobile-nav {
  left: 0 !important;
  right: auto !important;
}

[dir="rtl"] .mobile-nav-list {
  text-align: right;
}

[dir="rtl"] .mobile-nav-list a {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .mobile-menu-btn {
  margin-left: 0;
  margin-right: auto;
}

/* RTL Header adjustments for mobile menu positioning */
[dir="rtl"] .header-container {
  position: relative;
}

@media (max-width: 768px) {
  [dir="rtl"] .header-content {
    flex-direction: row-reverse;
  }
  
  [dir="rtl"] .mobile-menu-btn {
    order: -1;
  }
}
