/*
 * Language direction for the main store (loaded by fashion_template.php).
 * <html> gets lang="ar" dir="rtl" (default) or lang="en" dir="ltr".
 * style.css was written right-to-left only, so English mode undoes that here.
 */

/* ---------- Arabic: font ---------- */
/* Jost has no Arabic letters, so Arabic text falls back to Tajawal; Latin text keeps Jost. */
html[lang="ar"] body,
html[lang="ar"] body *:not(i):not(.fa):not(.fas):not(.far):not(.fab):not(.fa-solid):not(.fa-regular):not(.fa-brands) {
    font-family: 'Jost', 'Tajawal', sans-serif !important;
}
/* Letter spacing breaks the joined Arabic letters */
html[lang="ar"] body * { letter-spacing: normal !important; }

/* Sliders marked dir="ltr" stay LTR inside the RTL page
   (slick.css floats slides right under ANY [dir=rtl] ancestor, which shifts the image off-screen) */
[dir="rtl"] [dir="ltr"] .slick-slide { float: left; }

/* ---------- English: left-to-right ---------- */
html[dir="ltr"] body { direction: ltr; }
@media (max-width: 992px) {
    /* menu button is on the left in English, so the drawer opens from the left */
    html[dir="ltr"] .main-nav {
        direction: ltr; text-align: left;
        right: auto; left: -100%;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    html[dir="ltr"] .main-nav.active { left: 0; right: auto; }
}
html[dir="ltr"] .search-result-item { direction: ltr; text-align: left; }

/* ---------- Language switch button ---------- */
.header-btn.lang-btn { gap: 6px; font-weight: 700; text-decoration: none; }
.header-btn.lang-btn span { font-size: 14px; }

/* ---------- Toast notifications in Arabic: colored edge on the right, slide in from the left ---------- */
html[dir="rtl"] .custom-toast {
    border-left-width: 0;
    border-right: 5px solid #4CAF50;
    animation-name: toastSlideInRtl;
}
@keyframes toastSlideInRtl {
    from { transform: translateX(-100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ---------- Cart drawer in Arabic: the cart button is on the left, so the drawer opens from the left ---------- */
html[dir="rtl"] .cart-sidebar {
    right: auto; left: -450px;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (max-width: 480px) {
    html[dir="rtl"] .cart-sidebar { left: -100%; }
}
html[dir="rtl"] .cart-sidebar.active { left: 0; right: auto; }

/* ---------- Header room on medium screens (the language button needs space; English words are wider) ---------- */
@media (min-width: 993px) and (max-width: 1450px) {
    .header-btn.lang-btn { padding-left: 10px; padding-right: 10px; }
    .header-btn.lang-btn i { display: none; }
    html[dir="ltr"] .header-btn .btn-text { display: none; }
    html[dir="ltr"] .header-right { gap: 8px; }
}
@media (min-width: 993px) and (max-width: 1200px) {
    html[dir="ltr"] .main-nav ul { gap: 8px; }
    html[dir="ltr"] .main-nav ul li a { font-size: 12px; }
    html[dir="ltr"] .header-right .search-box input { width: 90px; }
}
@media (min-width: 993px) and (max-width: 1100px) {
    html[dir="ltr"] .header-right .search-box input { width: 60px; }
    html[dir="ltr"] .main-nav ul { gap: 6px; }
}
