/**
 * Main site RTL — load after layout-modern.css (Arabic / dir="rtl").
 * Fonts load from layout-modern.css (@import). Complements new_main/css/app.css.
 */

html[dir="rtl"].apprimaxlms-html {
    /* Arabic-first UI font; Latin stack from same Google bundle */
    --apprimaxlms-font-rtl: "Noto Sans Arabic", Tajawal, "Open Sans", sans-serif;
}

html[dir="rtl"].apprimaxlms-html body.apprimaxlms-site {
    font-family: var(--apprimaxlms-font-rtl);
    /* Mirror page background blooms for RTL reading flow */
    background-image:
        radial-gradient(ellipse 100% 70% at 0% 0%, rgba(var(--aml-primary-rgb), 0.08) 0%, transparent 52%),
        radial-gradient(ellipse 90% 55% at 100% 100%, rgba(var(--aml-indigo-rgb), 0.07) 0%, transparent 52%),
        radial-gradient(ellipse 45% 35% at 100% 40%, rgba(var(--aml-sky-rgb), 0.05) 0%, transparent 48%);
}

/* —— Header: layout-modern chevrons & padding (overrides LTR-specific rules) —— */
html[dir="rtl"] body.apprimaxlms-site .edu-header .header-mainnav .mainmenu-nav .mainmenu > li.has-droupdown > a {
    padding-right: 1.15rem !important;
    padding-left: 1.85rem !important;
}

html[dir="rtl"] body.apprimaxlms-site .edu-header .header-mainnav .mainmenu-nav .mainmenu > li.has-droupdown > a::after {
    right: auto !important;
    left: 0.6rem !important;
}

@media only screen and (min-width: 992px) and (max-width: 1199px) {
    html[dir="rtl"] body.apprimaxlms-site .edu-header .header-mainnav .mainmenu-nav .mainmenu > li.has-droupdown > a::after {
        right: auto !important;
        left: 0.45rem !important;
    }
}

html[dir="rtl"] body.apprimaxlms-site .edu-header .header-mainnav .mainmenu-nav .mainmenu li.has-droupdown .submenu li.has-droupdown > a::after {
    right: auto !important;
    left: 0.75rem !important;
    transform: translateY(-50%) rotate(90deg) !important;
}

html[dir="rtl"] body.apprimaxlms-site .header-action li.icon a .count {
    right: auto;
    left: -0.15rem;
}

html[dir="rtl"] body.apprimaxlms-site .shopping-cart-link .cart-count-badge {
    right: auto;
    left: -0.2rem;
}

/* Nested desktop flyouts: open to the “start” side in RTL */
html[dir="rtl"] .mainmenu-nav .mainmenu li.has-droupdown .submenu li.has-droupdown .submenu {
    left: auto !important;
    right: 100% !important;
}

html[dir="rtl"] .mainmenu-nav .mainmenu li.has-droupdown .submenu li.has-droupdown:hover .submenu {
    left: auto !important;
    right: 100% !important;
    top: 0;
}

/* Mobile drawer: layout-modern used left edge + negative X shadow */
html[dir="rtl"] body.apprimaxlms-site .popup-mobile-menu .inner {
    border-left: none;
    border-right: 1px solid var(--aml-edge);
    box-shadow: 16px 0 48px rgba(15, 23, 42, 0.14);
}

/* Footer: subscription input + button radii */
html[dir="rtl"] body.apprimaxlms-site .edu-footer .footer-subscription-form .form-control {
    border-radius: 0 12px 12px 0 !important;
}

html[dir="rtl"] body.apprimaxlms-site .edu-footer .footer-subscription-form .edu-btn {
    border-radius: 12px 0 0 12px !important;
}

html[dir="rtl"] body.apprimaxlms-site .edu-footer .footer-link a:hover {
    transform: translateX(-4px);
}

/* Breadcrumb chevrons point “forward” in reading direction */
html[dir="rtl"] .edu-breadcrumb .separator i,
html[dir="rtl"] .edu-breadcrumb-area .separator i {
    display: inline-block;
    transform: scaleX(-1);
}

/* Button / link arrows (icomoon) — optional flip where icon implies “next” */
html[dir="rtl"] .edu-btn .icon-4,
html[dir="rtl"] a.edu-btn .icon-4 {
    display: inline-block;
    transform: scaleX(-1);
}

/* Layout inline cart badge (default.blade.php) */
html[dir="rtl"] .cart-count-badge {
    right: auto !important;
    left: 3px;
}

/* Rich text from CMS (lists often use margin-inline-start in page-level CSS) */
html[dir="rtl"] .ck-content {
    direction: rtl;
    text-align: right;
}

/* reCAPTCHA block in auth modals */
html[dir="rtl"] .g-recaptcha {
    direction: ltr;
    text-align: center;
}

/*
 * WhatsApp FAB: in LTR it sits on the left (away from back-to-top on the right).
 * In RTL, app.css moves back-to-top to the left — shift WhatsApp to the right to avoid overlap.
 */
html[dir="rtl"] body.apprimaxlms-site a#whatsapp {
    left: auto !important;
    right: max(1rem, env(safe-area-inset-right, 0px)) !important;
}

/* Category dropdown uses leading icon + padding */
html[dir="rtl"] .edu-header .header-category .mainmenu li.has-droupdown > a i {
    padding-right: 0;
    padding-left: 10px;
}
