/**
 * Flomary RTL (Right-to-Left) Stylesheet for Arabic Localization
 * Unified Architectural Design Language
 */

html[dir="rtl"],
body.flomary-rtl,
body.rtl {
  direction: rtl;
  text-align: right;
  font-family: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* Typography Overrides for Arabic */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] .ser {
  font-family: 'Cairo', 'Tajawal', serif, sans-serif !important;
  font-weight: 700;
  letter-spacing: normal !important;
}

html[dir="rtl"] p,
html[dir="rtl"] a,
html[dir="rtl"] span,
html[dir="rtl"] li,
html[dir="rtl"] input,
html[dir="rtl"] button,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
  font-family: 'Cairo', 'Tajawal', sans-serif !important;
}

/* Reversing inline arrows in Arabic */
html[dir="rtl"] .link::after,
html[dir="rtl"] .dd-all::after {
  content: " ←";
}

/* Sticky Header RTL Alignment */
html[dir="rtl"] #h {
  flex-direction: row-reverse;
}

html[dir="rtl"] #h nav ul {
  flex-direction: row-reverse;
}

html[dir="rtl"] #h nav li.has-dd .dd-panel {
  left: auto;
  right: 0;
  text-align: right;
}

html[dir="rtl"] #h nav li.has-mega .mega {
  left: 0;
  right: 0;
  text-align: right;
}

html[dir="rtl"] #h nav li.has-mega .mega-intro {
  border-right: none;
  border-left: 1px solid rgba(0,0,0,0.06);
}

html[dir="rtl"] #h .hr {
  flex-direction: row-reverse;
  gap: 12px;
}

/* Language Switcher Styling */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border, #E4DCD3);
  border-radius: 20px;
  padding: 3px 5px;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  user-select: none;
}

#h.s .lang-switcher {
  background: rgba(247, 245, 240, 0.9);
  border-color: rgba(200, 190, 180, 0.6);
}

.lang-switcher .lang-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 14px;
  color: var(--ink, #1F1E1C);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 12px;
  line-height: 1.2;
}

.lang-switcher .lang-btn:hover {
  color: var(--copper, #B35C37);
}

.lang-switcher .lang-btn.active {
  background: var(--ink, #1F1E1C);
  color: #FFFFFF !important;
  font-weight: 600;
}

.lang-switcher .lang-sep {
  color: #C8BEB4;
  font-size: 11px;
  padding: 0 2px;
}

.lang-globe-icon {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  opacity: 0.7;
}

html[dir="rtl"] .lang-globe-icon {
  margin-right: 0;
  margin-left: 4px;
}

/* Mobile Language Switcher */
.mobile-lang-switcher {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 15px 0 20px 0;
  padding: 0 10px;
}

.mobile-lang-switcher a {
  flex: 1;
  text-align: center;
  padding: 9px 14px;
  border: 1px solid #E4DCD3;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #1F1E1C;
  text-decoration: none;
  background: #FAF8F5;
}

.mobile-lang-switcher a.active {
  background: #1F1E1C;
  color: #FFFFFF !important;
  border-color: #1F1E1C;
}

/* Mobile Drawer RTL Alignment */
html[dir="rtl"] .mobile-menu-drawer {
  left: auto;
  right: 0;
  transform: translateX(100%);
  text-align: right;
}

html[dir="rtl"] body.menu .mobile-menu-drawer {
  transform: translateX(0);
}

html[dir="rtl"] .mm-header {
  flex-direction: row-reverse;
}

html[dir="rtl"] .mm-group a.sub {
  padding-left: 0;
  padding-right: 18px;
  border-left: none;
  border-right: 2px solid #E4DCD3;
}

/* Hero & Section Adjustments in RTL */
html[dir="rtl"] .hero .acts {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

html[dir="rtl"] .facts {
  direction: rtl;
}

html[dir="rtl"] .facts > div {
  text-align: right;
  border-left: none;
  border-right: 1px solid rgba(0,0,0,0.06);
  padding: 0 24px 0 0;
}

html[dir="rtl"] .facts > div:first-child {
  border-right: none;
  padding-right: 0;
}

/* Spec Tables in RTL */
html[dir="rtl"] .spec table td:first-child {
  border-right: none;
  border-left: 1px solid rgba(255,255,255,0.1);
  padding-left: 20px;
  padding-right: 0;
}

/* RFQ Modal RTL */
html[dir="rtl"] #rfq-modal {
  text-align: right;
}

html[dir="rtl"] .rfq-modal-header {
  flex-direction: row-reverse;
}

html[dir="rtl"] .rfq-close {
  margin-left: 0;
  margin-right: auto;
}

html[dir="rtl"] .rfq-field label {
  text-align: right;
}

html[dir="rtl"] .rfq-field input,
html[dir="rtl"] .rfq-field select,
html[dir="rtl"] .rfq-field textarea {
  text-align: right;
  direction: rtl;
}

/* Footer RTL */
html[dir="rtl"] .arch-footer {
  text-align: right;
}

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

/* Floating WhatsApp Button in RTL */
html[dir="rtl"] .wa {
  right: auto;
  left: 24px;
}

/* Middle East Market Callout Banner */
.me-market-banner {
  background: linear-gradient(135deg, #1C2321 0%, #2A3432 100%);
  color: #FAF8F5;
  padding: 24px 32px;
  border-radius: 8px;
  margin: 30px auto;
  max-width: 1240px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid rgba(198, 168, 125, 0.25);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.me-market-banner-badge {
  display: inline-block;
  background: rgba(198, 168, 125, 0.2);
  color: #D4AF37;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.me-market-banner h4 {
  font-size: 20px;
  margin: 0 0 6px 0;
  color: #FFFFFF;
}

.me-market-banner p {
  font-size: 14px;
  color: #D5CEBF;
  margin: 0;
  line-height: 1.5;
}

.me-market-banner-btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  background: #B35C37;
  color: #FFFFFF !important;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease;
}

.me-market-banner-btn:hover {
  background: #C46842;
  transform: translateY(-2px);
}

@media (max-width: 860px) {
  .me-market-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }
}
