/*!
 * Zenmoon RTL (Right-to-Left) Overrides for Arabic
 *
 * Loaded by functions.php when current language is Arabic ('ar').
 * Mirrors layout: padding/margin/border-radius/float/transform/text-align.
 *
 * @package Zenmoon
 */

html[lang="ar"] body,
html[dir="rtl"] body {
	direction: rtl;
	unicode-bidi: embed;
}

/* Layout primitives */
html[lang="ar"] .wrap,
html[dir="rtl"] .wrap {
	padding-left: 0;
	padding-right: clamp(20px, 4vw, 56px);
}

html[lang="ar"] .nav-links,
html[dir="rtl"] .nav-links {
	flex-direction: row-reverse;
}

html[lang="ar"] .footer-grid,
html[dir="rtl"] .footer-grid {
	direction: rtl;
}

/* Floating nav: brand on the right, links on the left */
html[lang="ar"] .floating-nav,
html[dir="rtl"] .floating-nav {
	flex-direction: row-reverse;
}

html[lang="ar"] .brand,
html[dir="rtl"] .brand {
	margin-left: auto;
	margin-right: 0;
}

/* Mobile menu opens from the right */
html[lang="ar"] .mobile-nav-panel,
html[dir="rtl"] .mobile-nav-panel {
	right: 0;
	left: auto;
}

/* Switcher chevron */
html[lang="ar"] .lang-menu-select,
html[dir="rtl"] .lang-menu-select {
	background-position: left 0.5rem center;
	padding-left: 1.75rem;
	padding-right: 0.75rem;
}

/* Hero text alignment stays left-to-right even in RTL (headlines read naturally) */
html[lang="ar"] .hero-copy,
html[dir="rtl"] .hero-copy {
	text-align: right;
}

/* Mirror only the photographic layer; text, controls, and semantic flow stay RTL. */
html[lang="ar"] .hero-lifestyle-scene,
html[dir="rtl"] .hero-lifestyle-scene {
	transform: scaleX(-1);
	transform-origin: center center;
	object-position: 36% center;
}
html[lang="ar"] .hero-lifestyle-scene{transform:scaleX(-1)}

/* Mirror every photographic image hero, while keeping copy and controls readable. */
html[lang="ar"] .site-page-hero .hero-media{transform:scaleX(-1)!important;transform-origin:center center}
html[lang="ar"] .content-hero .hero-media{transform:scaleX(-1)!important;transform-origin:center center}
html[lang="ar"] .catalog-hero .hero-media{transform:scaleX(-1)!important;transform-origin:center center}
html[dir="rtl"] .site-page-hero .hero-media{transform:scaleX(-1)!important;transform-origin:center center}
html[dir="rtl"] .catalog-hero .hero-media{transform:scaleX(-1)!important;transform-origin:center center}

/* Put Arabic hero copy and the homepage light control on the visual right. */
html[lang="ar"] .site-page-hero-content,html[dir="rtl"] .site-page-hero-content{text-align:right}
html[lang="ar"] .site-page-hero::before,html[dir="rtl"] .site-page-hero::before{background:linear-gradient(270deg,rgba(24,18,14,.56) 0%,rgba(24,18,14,.34) 38%,rgba(24,18,14,.1) 72%,rgba(24,18,14,.02) 100%)}
html[lang="ar"] .catalog-hero::before,html[dir="rtl"] .catalog-hero::before{background:linear-gradient(270deg,rgba(15,13,12,.58) 0%,rgba(15,13,12,.36) 38%,rgba(15,13,12,.12) 72%,rgba(15,13,12,.02) 100%)}
html[lang="ar"] .hero-v4 .hero-light-control,html[dir="rtl"] .hero-v4 .hero-light-control{left:auto;right:calc((100% - var(--content))/2)}
html[lang="ar"] .hero-light-switch,html[dir="rtl"] .hero-light-switch{text-align:right}

/* Shared Arabic buttons keep their icon at the reading-direction end. */
html[lang="ar"] .page-button,html[dir="rtl"] .page-button{flex-direction:row-reverse;padding:11px 22px 11px 14px}
html[lang="ar"] .pill-button,html[dir="rtl"] .pill-button{flex-direction:row-reverse;padding:7px 20px 7px 7px}
html[lang="ar"] .nav-cta,html[dir="rtl"] .nav-cta{flex-direction:row-reverse;padding:7px 20px 7px 7px}
html[lang="ar"] .button,html[dir="rtl"] .button{flex-direction:row-reverse}
html[lang="ar"] .whatsapp,html[dir="rtl"] .whatsapp{right:auto;left:22px;flex-direction:row-reverse;padding:9px 16px 9px 10px}

@media (max-width: 768px) {
	html[lang="ar"] .hero-lifestyle-scene,
	html[dir="rtl"] .hero-lifestyle-scene {
		object-position: 33.75% center;
	}
}

/* Numeric / monetary values stay LTR even in Arabic context */
html[lang="ar"] .num,
html[dir="rtl"] .num {
	direction: ltr;
	unicode-bidi: isolate;
}

/* Card grids: maintain visual order */
html[lang="ar"] .card-grid,
html[dir="rtl"] .card-grid {
	direction: rtl;
}

/* Form inputs keep LTR for emails, phones, URLs */
html[lang="ar"] input[type="email"],
html[lang="ar"] input[type="url"],
html[lang="ar"] input[type="tel"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="tel"] {
	direction: ltr;
	text-align: right;
}

/* WhatsApp floating button — flip to bottom-left */
html[lang="ar"] .wa-float,
html[dir="rtl"] .wa-float {
	right: auto;
	left: 16px;
}

/* Reduce box-shadow direction biases (most themes use neutral shadows, safe) */
html[lang="ar"] *,
html[dir="rtl"] * {
	box-shadow: none;
}
