/**
 * Samra - right-to-left overrides (Arabic, Hebrew, Persian...).
 *
 * Loaded only when is_rtl() is true (see inc/multilingual/rtl.php), after every
 * other theme stylesheet. Margins, paddings, borders and text alignment already
 * use logical properties in the theme stylesheets, so they mirror on their own.
 * This file only handles what logical properties cannot express:
 *   - absolutely positioned decorations and dropdown sides,
 *   - horizontal transforms (slide-in effects, sub-menu offsets),
 *   - directional icons (arrows, chevrons) - mirrored deliberately,
 *   - marquee / carousel tracks, whose animation must keep running left-to-right.
 * Logos, product photos, numbers, phone numbers and non-directional icons are
 * intentionally NOT mirrored.
 */

/* ---------------------------------------------------------------- Global */
body {
    text-align: start;
}

/* E-mail, phone and URL fields are typed left-to-right, aligned to the right. */
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="url"],
[dir="rtl"] a[href^="tel:"],
[dir="rtl"] a[href^="mailto:"] {
    direction: ltr;
    unicode-bidi: isolate;
}
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="url"] {
    text-align: right;
}

/* Free text typed in the settings (address, copyright...) may be in a
   left-to-right language: its direction is taken from its own first letter, so
   "12 Rue Didouche, Alger" or "© 2026 Company." keep their word order. Arabic
   translations of the same fields are detected as right-to-left. */
[dir="rtl"] .samra-contact-item span,
[dir="rtl"] .footer-contact .contact-item span,
[dir="rtl"] .site-info p {
    unicode-bidi: plaintext;
}

/* Directional icons point the other way (arrows, chevrons, angles). */
[dir="rtl"] .fa-arrow-right,
[dir="rtl"] .fa-arrow-left,
[dir="rtl"] .fa-chevron-right,
[dir="rtl"] .fa-chevron-left,
[dir="rtl"] .fa-angle-right,
[dir="rtl"] .fa-angle-left,
[dir="rtl"] .fa-long-arrow-alt-right,
[dir="rtl"] .fa-long-arrow-alt-left,
[dir="rtl"] .fa-paper-plane {
    transform: scaleX(-1);
}

/* ---------------------------------------------------------------- Header */
[dir="rtl"] .skip-link {
    left: auto;
    right: 1rem;
}

[dir="rtl"] .nav-menu > li > a::after {
    left: auto;
    right: 0;
}

/* Level-1 dropdowns open under their item, aligned to the right edge. */
[dir="rtl"] .nav-menu .sub-menu,
[dir="rtl"] .nav-menu .children {
    left: auto;
    right: 0;
}

/* Level-2 dropdowns open to the left. */
[dir="rtl"] .nav-menu .sub-menu .sub-menu,
[dir="rtl"] .nav-menu .children .children {
    left: auto;
    right: 100%;
    transform: translateX(10px) scale(0.95);
}
[dir="rtl"] .nav-menu .sub-menu li:hover > .sub-menu,
[dir="rtl"] .nav-menu .children li:hover > .children {
    transform: translateX(0) scale(1);
}

/* Items near the end of the menu open their level-2 dropdown inwards (to the right). */
[dir="rtl"] .nav-menu > li:nth-last-child(1) .sub-menu .sub-menu,
[dir="rtl"] .nav-menu > li:nth-last-child(2) .sub-menu .sub-menu,
[dir="rtl"] .nav-menu > li:nth-last-child(3) .sub-menu .sub-menu,
[dir="rtl"] .nav-menu > li:nth-last-child(1) .children .children,
[dir="rtl"] .nav-menu > li:nth-last-child(2) .children .children,
[dir="rtl"] .nav-menu > li:nth-last-child(3) .children .children {
    right: auto;
    left: 100%;
    transform: translateX(-10px) scale(0.95);
}

/* Sub-menu indicators point left. */
[dir="rtl"] .nav-menu .sub-menu .menu-item-has-children > a::after {
    transform: rotate(90deg);
}

/* Mobile sub-menu toggle sits on the left. */
[dir="rtl"] .mobile-submenu-toggle {
    right: auto;
    left: 1rem;
}
[dir="rtl"] .mobile-submenu-toggle::before {
    content: '◂';
}
[dir="rtl"] .mobile-submenu-toggle.active::before {
    transform: rotate(-90deg);
}

/* ---------------------------------------------------------------- Footer */
[dir="rtl"] .footer-column-title::after,
[dir="rtl"] .footer-menu a::before {
    left: auto;
    right: 0;
}

/* ---------------------------------------------------------------- Blog */
[dir="rtl"] .samra-blog-search button {
    right: auto;
    left: 15px;
}
[dir="rtl"] .samra-featured-badge {
    left: auto;
    right: 15px;
}
[dir="rtl"] .samra-breadcrumb,
[dir="rtl"] .samra-post-navigation {
    direction: rtl;
}

/* ---------------------------------------------------------------- Sliders */
[dir="rtl"] .prev-arrow,
[dir="rtl"] .apex-btn-prev {
    left: auto;
    right: 30px;
}
[dir="rtl"] .next-arrow,
[dir="rtl"] .apex-btn-next {
    right: auto;
    left: 30px;
}
[dir="rtl"] .apex-btn-prev {
    right: 16px;
}
[dir="rtl"] .apex-btn-next {
    left: 16px;
}
[dir="rtl"] .slider-arrow {
    transform: translateY(-50%) scaleX(-1);
}
[dir="rtl"] .slider-arrow:hover {
    transform: translateY(-50%) scaleX(-1) scale(1.1);
}
@media (max-width: 1024px) {
    [dir="rtl"] .prev-arrow { right: 20px; }
    [dir="rtl"] .next-arrow { left: 20px; }
}
@media (max-width: 768px) {
    [dir="rtl"] .prev-arrow { right: 15px; }
    [dir="rtl"] .next-arrow { left: 15px; }
}
@media (max-width: 480px) {
    [dir="rtl"] .prev-arrow { right: 10px; }
    [dir="rtl"] .next-arrow { left: 10px; }
}

/* Slide-in texts enter from the reading side. */
[dir="rtl"] .slide-header,
[dir="rtl"] .slide-subheader {
    transform: translateX(100px);
}
[dir="rtl"] .samra-slide.active .slide-header,
[dir="rtl"] .samra-slide.active .slide-subheader {
    transform: translateX(0);
}
[dir="rtl"] .samra-slider[data-animation="slide"] .samra-slide {
    transform: translateX(-100%);
}
[dir="rtl"] .samra-slider[data-animation="slide"] .samra-slide.active {
    transform: translateX(0);
}
[dir="rtl"] .samra-slider[data-animation="slide"] .samra-slide.prev {
    transform: translateX(100%);
}

/* Marquees and carousels keep their left-to-right track (the animation is
   computed for it); the text inside each item stays right-to-left. */
[dir="rtl"] .samra-logo-slider,
[dir="rtl"] .samra-reviews-slider,
[dir="rtl"] .industrial-banner .marquee-container {
    direction: ltr;
}
[dir="rtl"] .samra-review-card,
[dir="rtl"] .industrial-banner .text {
    direction: rtl;
}

/* ---------------------------------------------------------------- Products */
[dir="rtl"] .product-card__status {
    right: auto;
    left: 0.75rem;
}
[dir="rtl"] .apex-specs-table th,
[dir="rtl"] .apex-specs-table td {
    text-align: right;
}
[dir="rtl"] .category-breadcrumb-header {
    direction: rtl;
}

/* ---------------------------------------------------------------- Sections */
[dir="rtl"] .features-list li::before {
    left: auto;
    right: 0;
}
[dir="rtl"] .service-card::after {
    left: auto;
    right: 1.5rem;
}
[dir="rtl"] .samra-section-media:hover img {
    transform: translate(10px, -10px);
}
