/* ============================================
   LOUNIS - MULTI-LANGUAGE / RTL STYLESHEET
   Loaded after style.css for all pages
   ============================================ */

/* ── LANGUAGE SWITCHER ── */
.lang-switcher {
  position: relative;
  display: inline-block;
}
.lang-current {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  transition: all 0.2s;
  user-select: none;
}
.lang-current:hover {
  background: rgba(255,255,255,0.2);
}
.lang-current .arrow {
  font-size: 10px;
  transition: transform 0.2s;
}
.lang-switcher:hover .arrow { transform: rotate(180deg); }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  min-width: 150px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.25s;
  z-index: 9999;
  overflow: hidden;
}
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
.lang-switcher:hover .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  color: #1e293b;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
  text-decoration: none;
}
.lang-option:last-child { border-bottom: none; }
.lang-option:hover { background: #f8fafc; }
.lang-option.active {
  color: var(--accent);
  background: rgba(230,57,70,0.05);
  font-weight: 700;
}
.lang-option .lang-flag { font-size: 18px; }
.lang-option .lang-check { margin-left: auto; color: var(--accent); }
[dir="rtl"] .lang-option .lang-check { margin-left: 0; margin-right: auto; }

/* ── RTL GLOBAL OVERRIDES ── */
[dir="rtl"] {
  font-family: 'Tajawal', 'Poppins', sans-serif;
}

/* Flip flex row directions in RTL */
[dir="rtl"] .header-main .container,
[dir="rtl"] .header-top .container,
[dir="rtl"] .logo,
[dir="rtl"] .header-actions,
[dir="rtl"] .feature-item,
[dir="rtl"] .footer-contact li,
[dir="rtl"] .product-pricing,
[dir="rtl"] .price-block,
[dir="rtl"] .qty-row,
[dir="rtl"] .add-cart-row,
[dir="rtl"] .meta-row,
[dir="rtl"] .cart-product,
[dir="rtl"] .cod-badge,
[dir="rtl"] .summary-row,
[dir="rtl"] .slide-btns,
[dir="rtl"] .social-links,
[dir="rtl"] .topbar-right,
[dir="rtl"] .action-btn,
[dir="rtl"] .bread-crumb,
[dir="rtl"] .order-detail-box > div,
[dir="rtl"] .footer-bottom .container {
  direction: rtl;
}

/* Breadcrumb separators */
[dir="rtl"] .breadcrumb {
  direction: rtl;
}
[dir="rtl"] .breadcrumb::before { content: none; }

/* Dropdown menus: flip to right side */
[dir="rtl"] .dropdown-menu {
  left: auto;
  right: 0;
}
[dir="rtl"] .dropdown-menu a:hover {
  padding-right: 24px;
  padding-left: 18px;
}

/* Slide in from right for RTL */
[dir="rtl"] .slide-content {
  animation-name: slideInRtl;
}
@keyframes slideInRtl {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Product badges: flip to right */
[dir="rtl"] .product-badges {
  left: auto;
  right: 12px;
}

/* Cart badge: flip */
[dir="rtl"] .cart-badge {
  right: auto;
  left: -6px;
}

/* Sidebar nav links: RTL text */
[dir="rtl"] .nav-link {
  direction: rtl;
}

/* Footer */
[dir="rtl"] .footer ul li a:hover {
  padding-right: 4px;
  padding-left: 0;
}

/* Toast: appear from left in RTL */
[dir="rtl"] .toast {
  right: auto;
  left: 24px;
}

/* Back-to-top: flip */
[dir="rtl"] #back-top {
  right: auto;
  left: 24px;
}

/* Search bar: flip button */
[dir="rtl"] .search-bar input {
  padding: 12px 20px 12px 50px;
}
[dir="rtl"] .search-bar button {
  right: auto;
  left: 5px;
}

/* Autocomplete: RTL */
[dir="rtl"] .autocomplete-item strong {
  margin-left: 0;
  margin-right: auto;
}

/* Form controls: RTL text alignment */
[dir="rtl"] .form-control,
[dir="rtl"] .admin-form-control,
[dir="rtl"] input[type="text"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="email"],
[dir="rtl"] textarea,
[dir="rtl"] select {
  text-align: right;
  direction: rtl;
}

/* ── ARABIC FONT ── */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');

[dir="rtl"] body {
  font-family: 'Tajawal', sans-serif;
  font-size: 16px; /* Tajawal reads better at 16px */
  line-height: 1.7;
}

[dir="rtl"] .logo-text,
[dir="rtl"] .slide-title,
[dir="rtl"] .section-title,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
  font-family: 'Tajawal', sans-serif;
}

/* ── LANGUAGE BADGE IN HEADER TOP ── */
.header-top .lang-current {
  font-size: 12px;
}

/* ── MOBILE LANG SWITCHER ── */
@media (max-width: 768px) {
  .lang-dropdown {
    right: 0;
    left: auto;
  }
  [dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
  }
}
