/* =========================================================================
   Nutrivit — Arabic (RTL) direction fixes. Loaded only on RTL pages.

   How arrows behave on Arabic pages (checked in the browser, 2026-11-14):
   - icon-font arrows (Vineta's icomoon / vince icons) are drawn mirrored by the
     browser inside RTL blocks; CTA arrows are mirrored back in style.css
     (owner's choice: they point right, as on the French pages).
   - inline SVG arrows are never mirrored: pairs that the RTL layout swaps
     (previous on the right) are mirrored here.
   - slider arrows use Swiper's ligature font ("prev" / "next"), which ended up
     pointing inward on Arabic pages. They are redrawn as chevrons that follow the
     side the button actually sits on: functions.php marks each one with
     data-nv-side="left|right"; until then the RTL default applies
     (previous on the right), except the product gallery, which is an LTR slider.
   ========================================================================= */

/* Product page: previous / next product (inline SVG chevrons) */
.product-navigation :is(.prev-product, .next-product) svg {
	transform: scaleX(-1);
}

/* Slider arrows */
:is(.swiper-button-prev, .swiper-button-next)::after {
	content: "" !important;
	display: block;
	width: 1em;
	height: 1em;
	min-width: 12px;
	min-height: 12px;
	font-family: inherit !important;
	background-color: currentColor;
	-webkit-mask: var(--nv-chevron) center / contain no-repeat;
	mask: var(--nv-chevron) center / contain no-repeat;
}
:root {
	--nv-chevron-left: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15 4.5 7.5 12l7.5 7.5' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	--nv-chevron-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 4.5 16.5 12 9 19.5' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* default before the script runs: RTL sliders keep "previous" on the right */
.swiper-button-prev::after { --nv-chevron: var(--nv-chevron-right); }
.swiper-button-next::after { --nv-chevron: var(--nv-chevron-left); }
/* the product gallery is an LTR slider (dir="ltr" in the theme) */
.flat-wrap-media-product > .swiper-button-prev::after { --nv-chevron: var(--nv-chevron-left); }
.flat-wrap-media-product > .swiper-button-next::after { --nv-chevron: var(--nv-chevron-right); }
/* measured side wins */
:is(.swiper-button-prev, .swiper-button-next)[data-nv-side="left"]::after { --nv-chevron: var(--nv-chevron-left); }
:is(.swiper-button-prev, .swiper-button-next)[data-nv-side="right"]::after { --nv-chevron: var(--nv-chevron-right); }

/* Newsletter "send" arrow (inline SVG): sits at the start of the field on Arabic pages,
   so it points left, the direction of reading */
:is(.footer-newsletter, .form-newsletter, .subscribe-content) .subscribe-button svg {
	transform: scaleX(-1);
}

/* Marquees: on Arabic pages the row overflows to the left, so it slides right (new text enters from the left) */
.tf-topbar .marquee-wrapper,
.marquee-sale .marquee-wrapper {
	animation-name: nv-marquee-rtl !important;
}
@keyframes nv-marquee-rtl {
	from { transform: translateX(0); }
	to   { transform: translateX(20%); }
}

/* Top bar edge fades: the theme's RTL CSS swaps their sides but not their gradients, so each
   edge showed a solid band on its inner side that cut words in half. The theme's inline CSS and the
   home page's Elementor CSS re-add the LTR gradient with !important, hence the long selector. */
html[dir] body .tf-topbar.topbar-bg .topbar-inner .overflow-hidden::before,
.tf-topbar .overflow-hidden::before { background-image: linear-gradient(to left, var(--nv-accent), rgba(200, 67, 106, 0)) !important; }
html[dir] body .tf-topbar.topbar-bg .topbar-inner .overflow-hidden::after,
.tf-topbar .overflow-hidden::after  { background-image: linear-gradient(to right, var(--nv-accent), rgba(200, 67, 106, 0)) !important; }

/* Side drawers (mobile menu, filter / blog sidebars): the theme loads Bootstrap's LTR build on
   Arabic pages, so "start" drawers opened from the left while their button sits on the right.
   Same rules as bootstrap.rtl: start = right edge, end = left edge. */
.offcanvas.offcanvas-start {
	left: auto;
	right: 0;
	border-right: 0;
	border-left: var(--bs-offcanvas-border-width, 1px) solid var(--bs-offcanvas-border-color, rgba(0, 0, 0, .1));
	transform: translateX(100%);
}
.offcanvas.offcanvas-end:not(.popup-style-1) {
	right: auto;
	left: 0;
	border-left: 0;
	border-right: var(--bs-offcanvas-border-width, 1px) solid var(--bs-offcanvas-border-color, rgba(0, 0, 0, .1));
	transform: translateX(-100%);
}
.offcanvas.offcanvas-start.showing, .offcanvas.offcanvas-start.show:not(.hiding),
.offcanvas.offcanvas-end:not(.popup-style-1).showing, .offcanvas.offcanvas-end:not(.popup-style-1).show:not(.hiding) {
	transform: none;
}
