/* =====================================================================
   Entotox — RTL / Arabic layout fixes
   Loaded only when is_rtl(), so the English site is untouched.

   Findings this file addresses came from a live audit of the 22 Arabic
   pages at 1440px and 375px:
     - alignment utility classes that stayed "left" after translation
     - tap targets below the 44px comfortable minimum on phones
     - long Latin strings (emails, addresses) overflowing Arabic columns
   The per-widget alignment settings themselves were mirrored in the
   Elementor data by tools/arabic-translation/fix_rtl_alignment.php.
   ===================================================================== */

/* ---------------------------------------------------------------------
   0. CRITICAL — restore the mobile header bar on Arabic pages.

   The parent theme's style-rtl.css contains an unconditional
       .header-mobilebar { display: none; }
   (no media query, declared twice). It overrides the theme's own
       @media (max-width:1024px) { .header-mobilebar { display: flex } }
   so on Arabic the entire mobile header — including the hamburger — was
   hidden at every width, leaving phone users with NO navigation at all.
   Verified at 375px: English display:flex with a visible toggle, Arabic
   display:none with a 0x0 toggle.

   This restores the intended responsive behaviour. It must load after
   style-rtl.css, which the enqueue dependency in functions.php guarantees.
   --------------------------------------------------------------------- */
@media only screen and (max-width: 1024px) {
	.rtl .header-mobilebar { display: flex !important; }
}
@media only screen and (min-width: 1025px) {
	.rtl .header-mobilebar { display: none !important; }
}

/* ---------------------------------------------------------------------
   0b. NOT CHANGED — off-canvas drawer slide direction.

   The drawer (.mobile-menu-floating) parks at left:-100% and slides in via
   `body.mobile-menu-active .mobile-menu-floating { left:0 }`. In RTL it
   would ideally enter from the right edge instead.

   This is deliberately left alone: re-anchoring it to `right` makes the
   theme's own `left:0` open rule inert, so if anything else drives that
   animation the drawer would stop opening entirely — a far worse failure
   than entering from the wrong side. The slide could not be verified in
   the automated harness (the preview pane does not re-run the transition,
   and English behaves identically there), so it needs a check in a real
   browser before flipping. The menu itself is correct: it is reachable,
   its links are Arabic, right-aligned and RTL.
   --------------------------------------------------------------------- */

/* ---------------------------------------------------------------------
   0c. Keep the Arabic prose line-height out of the site chrome.

   The RTL typography block sets `body.rtl p, body.rtl li { line-height:1.8 }`
   for readable Arabic paragraphs. But the theme sizes its header bars by
   letting list items inherit a line-height equal to the bar height (48px on
   the topbar, 90px on the navbar), so that blanket rule collapsed them:
   English topbar li = 48px, Arabic = 23.4px, leaving the whole Arabic header
   44px shorter than English.

   Restoring `inherit` on chrome lists lets the theme's bar heights win again
   while Arabic body copy keeps its 1.8 leading.
   --------------------------------------------------------------------- */
body.rtl .site-header li,
body.rtl .site-header p,
body.rtl .header-topbar li,
body.rtl .header-navbar li,
body.rtl .header-logobar li,
body.rtl .header-mobilebar li,
body.rtl .mobile-menu-floating li,
body.rtl .site-footer .widget_nav_menu li {
	line-height: inherit;
}

/* ---------------------------------------------------------------------
   0d. Dropdown submenu — active item's text sat on top of its icon.

   The theme reserves room for the little bug icon that appears on a submenu
   link with:

       header.site-header … ul.sub-menu li a:hover,
       header.site-header … ul.sub-menu li.current-menu-item a
           { padding-left: 35px }      (theme-styles.css)

   `style-rtl.css` mirrors that for `:hover` only —
       .rtl … ul.sub-menu li a:hover { padding-right: 40px; padding-left: 0 }
   — and never for `.current-menu-item`. So on the page you are actually on,
   the icon was mirrored to `right: 15px` while the 35px reserve stayed on
   the LEFT, leaving only the base 15px on the right: the Arabic label ran
   straight over its own icon.

   Mirror the reserve for every "active" state, keeping the 15px base that
   style-rtl.css sets for these links.
   --------------------------------------------------------------------- */
.rtl header.site-header ul.nav.wp-menu li > ul.sub-menu li a:hover,
.rtl header.site-header ul.nav.wp-menu li > ul.sub-menu li.current-menu-item > a,
.rtl header.site-header ul.nav.wp-menu li > ul.sub-menu li.current_page_item > a,
.rtl header.site-header ul.nav.wp-menu li > ul.sub-menu li.current-menu-ancestor > a,
.rtl header.site-header ul.nav.wp-menu li > ul.sub-menu li.current-menu-parent > a {
	/* 40px, not the LTR rule's 35px: the Arabic icon sits at right:15px
	   against the English icon's left:10px, so 35 left only a 5px gap where
	   English has 10. 40 is also the value style-rtl.css already uses for
	   its own :hover mirror, so the two states stay consistent. */
	padding-right: 40px;
	padding-left: 15px;
}

/* ---------------------------------------------------------------------
   0e. Hover underlines that swept the wrong way.

   Two link styles animate a 1px underline by switching which edge it is
   anchored to, and `style-rtl.css` carries no rule for either (verified: zero
   matches for `topbar-ul … hover` and for the copyright `widget_nav_menu`),
   so the LTR sweep direction survived into Arabic and the line grew away from
   the reading direction.

   Found by tools/arabic-translation/rtl_missing.py — these are hover-only, so
   no amount of static page inspection would have surfaced them.
   --------------------------------------------------------------------- */

/* Topbar links: anchor at the start edge, expand toward the end edge. */
.rtl .site-header .nav.topbar-ul li a:after {
	left: auto;
	right: 0;
}

.rtl .site-header .nav.topbar-ul li a:hover:after {
	right: auto;
	left: 0;
}

/* Copyright-bar links sweep the opposite way in the base design; mirror
   that relationship rather than copying the topbar. */
.rtl .copyright-widget .copyright-widgets-wrap .widget_nav_menu.menu li a:before {
	right: auto;
	left: 0;
}

.rtl .copyright-widget .copyright-widgets-wrap .widget_nav_menu.menu li a:hover:before {
	left: auto;
	right: 0;
}

/* ---------------------------------------------------------------------
   0f. Footer — more Bugro demo defaults leaking through style-rtl.css.

   `style-rtl.css` restyles the footer with the demo's own look, overriding
   both the theme options and the base stylesheet. Measured against English:

     footer widgets bg   black  ->  #00152f navy   (+ 1rem rounded corners)
     copyright bar bg    black  ->  #011d40 navy   (+ rounded corners)
     nav-link icon       15px "\f144" arrow  ->  5px "\F287" dot
     social icon         15x15, no border    ->  34x34 with a 1px border

   The colours are restored in PHP from `bugro_options` (see
   etx_rtl_header_height_css) so they track the theme settings. The rest is
   geometry and belongs here.

   The oversized social icons also had a knock-on effect: they widened the
   first footer column enough to push "Social Media" below "Communication",
   where English keeps them side by side. Restoring 15px fixes the wrap too.
   --------------------------------------------------------------------- */
.rtl .footer-widgets-wrap,
.rtl .footer-bottom-wrap {
	border-radius: 0;
}

/* Footer menu bullet: same glyph and size as English, kept on the RTL side. */
.rtl .site-footer .widget.widget_nav_menu li a:before {
	content: "\f144";
	font-size: 15px;
	top: 0;
}

/* Social icons: match the English 15px mark, no border box. */
.rtl .zozo_social_widget ul.nav.social-icons > li > a {
	width: 15px;
	height: 15px;
	line-height: 15px;
	border: 0;
}

.rtl .zozo_social_widget ul.nav.social-icons > li > a:hover {
	border: 0;
}

/* ---------------------------------------------------------------------
   0g. Findings from the full sweep of every rtl_diff result (not just the
   high-risk tier — twice the real bug was sitting in the low pile).

   Of 190 base-vs-RTL differences, 29 had a live visible element on an Arabic
   page; diffing those against English left the three below.
   --------------------------------------------------------------------- */

/* Top-level menu rhythm. style-rtl.css sets `padding: 0 15px` against the base
   sheet's `0 24px`. Both are SYMMETRIC, so there is nothing to mirror here —
   only a value to restore. (I first "mirrored" this to a one-sided
   padding-left and it made the menu narrower still: the lesson is to read
   whether the declaration is actually one-sided before treating it as
   directional.) Measured safe: the Arabic menu sits at 584px against
   English's 784px in a 1425px bar, so widening it cannot wrap. */
.rtl .header-navbar ul.nav.wp-menu > li {
	padding-left: 24px;
	padding-right: 24px;
}

/* Prev/next post navigation at the foot of a service page: style-rtl.css
   renders it lighter and tighter than the base sheet (weight 400 vs 600,
   line-height 16px vs 25px, padding 0 5px vs 0 10px). */
.rtl .custom-post-nav a > * {
	font-weight: 600;
	line-height: 25px;
	padding: 0 10px;
}

/* style-rtl.css clips widgets that the base sheet lets overflow. Nothing is
   currently cut off in Arabic, but it is a latent trap for anything that has
   to escape its box (dropdowns, tooltips, hover cards). */
.rtl .widget {
	overflow: visible;
}

/* Font Awesome solid nominally wants weight 900; style-rtl.css drops it to
   400. Harmless on its own here (the site loads the v4 "FontAwesome" family,
   which has a single weight) but restored for parity. The topbar glyph's real
   size difference came from font-size, not weight — that is fixed in PHP from
   the theme option, see etx_rtl_header_height_css. */
.rtl .fas {
	font-weight: 900;
}

/* Dropdown corners. style-rtl.css gives the submenu a 10px radius where the
   English dropdown is square — cosmetic, and the demo's look rather than the
   site's.

   Its 290px width (against English's 255px) is deliberately KEPT: measured,
   the longest Arabic label needs 201px of text against the 200px a 255px
   panel leaves after padding, so narrowing it to match English would wrap
   that item onto two lines. Divergence is not automatically a bug — but
   "looks nicer" is not a reason to keep one either; this one is measured. */
.rtl ul.nav.wp-menu > li.menu-item-has-children > .sub-menu {
	border-radius: 0;
}

/* Copyright bar width. The two sheets disagree on how the bar distributes
   its two blocks:

       theme-styles.css  .footer-bottom-wrap .col-12       space-between
                         .footer-bottom-wrap .row .col-12  space-around  <- wins
       style-rtl.css     .footer-bottom-wrap .row .col-12  space-between <- wins in RTL

   `space-around` leaves a margin either side (English insets the copyright
   142px from the edge); `space-between` pins both blocks to the extreme
   edges, so the Arabic copyright sat 3px off the right edge and the policy
   links 3px off the left, ignoring the page gutter the rest of the footer
   respects. Restore the base behaviour. Only justify-content is overridden —
   the mobile rule that stacks this column stays untouched. */
.rtl .footer-bottom-wrap .row .col-12 {
	justify-content: space-around;
}

/* Newsletter field. style-rtl.css replaces the site's square dark input with
   the demo's transparent pill:
       input   background:transparent; border:1px solid #4d4d4d; radius:25px
       button  min-width:46px; height:52px; radius:46px!important; z-index:999
   against theme-styles.css's
       input   background:#18181B; border:1px solid rgba(114,141,134,.3); radius:0
       button  min-width:45px; height:45px; top:4px; right:4px; z-index:3; radius:0
   Restore the site's design, with the submit button mirrored to the start
   edge (English pins it 4px from the right; Arabic needs 4px from the left). */
.rtl footer .mailchimp-wrapper .input-group input#zozo-mc-email {
	background-color: #18181b;
	border: 1px solid rgba(114, 141, 134, 0.3);
	border-radius: 0;
	/* style-rtl.css leaves this 2px taller than English, which shows against
	   the 45px submit button sitting inside it. */
	height: 50px;
}

.rtl footer button.input-group-addon.zozo-mc.btn.btn-default {
	min-width: 45px;
	height: 45px;
	top: 4px;
	bottom: 0;
	right: auto;
	left: 4px;
	z-index: 3;
	border-radius: 0 !important;
	margin-left: 0 !important;
}

/* ---------------------------------------------------------------------
   1. Alignment utilities
   The CEA addon emits .cea-align-left / .cea-align-right from a widget's
   own setting. Where a widget still carries the LTR default, mirror it so
   Arabic copy never sits flush against the wrong edge.
   --------------------------------------------------------------------- */
.rtl .cea-align-left { text-align: right; }
.rtl .cea-align-right { text-align: left; }

/* Elementor's generic helpers, same reasoning. */
.rtl .elementor-align-left  { text-align: right; }
.rtl .elementor-align-right { text-align: left; }

/* Copyright bar. style-rtl.css centres it on desktop but then forces
   `text-align:left` below 767px with a deep selector
   (.footer-bottom-wrap ul.nav.copyright-bar-ul p.footer-copyright), which
   left the only Arabic line on the page hanging off the wrong edge on
   phones. Match that specificity and keep it centred as on desktop. */
.rtl .copyright-widget,
.rtl .copyright-widgets-wrap {
	text-align: right;
}

@media only screen and (max-width: 767px) {
	.rtl .footer-bottom-wrap ul.nav.copyright-bar-ul p.footer-copyright {
		text-align: center;
	}
}

/* ---------------------------------------------------------------------
   2. Long unbreakable strings
   Emails, URLs and Latin address fragments sit inside Arabic columns that
   are narrower than their English counterparts; let them wrap instead of
   pushing the column wider.
   --------------------------------------------------------------------- */
.rtl .footer-email,
.rtl .elementor-icon-box-description,
.rtl .forminator-description,
.rtl .cea-icon-box-content p,
.rtl .entry-content p,
.rtl .entry-content li {
	overflow-wrap: anywhere;
	word-break: break-word;
}

/* Keep Latin runs (emails, addresses, ISO codes) reading left-to-right
   inside otherwise right-to-left prose. */
.rtl .footer-email,
.rtl a[href^="mailto:"] {
	direction: ltr;
	unicode-bidi: embed;
	display: inline-block;
}

/* ---------------------------------------------------------------------
   3. Tap targets (phones)
   Audited at 375px: the mobile menu toggle measured 22x23px and the
   "read more" buttons 30px tall — both below a comfortable target.
   NOTE: the same sizes apply on the English site; this file only widens
   them for Arabic, so the two can be brought in line deliberately.
   --------------------------------------------------------------------- */
@media (max-width: 991px) {
	.rtl .mobile-menu-toggle,
	.rtl .navbar-toggler {
		min-width: 44px;
		min-height: 44px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}
}

@media (max-width: 767px) {
	.rtl .read-more.elementor-button,
	.rtl .cea-button,
	.rtl .elementor-button {
		min-height: 40px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	/* Forminator submit: full width and comfortably tall on phones. */
	.rtl .forminator-button-submit {
		min-height: 44px;
		width: 100%;
	}
}

/* ---------------------------------------------------------------------
   4. Forms
   Mirror the field grid and keep validation messages on the correct side.
   --------------------------------------------------------------------- */
.rtl .forminator-ui .forminator-label,
.rtl .forminator-ui .forminator-error-message {
	text-align: right;
}

.rtl .forminator-ui input,
.rtl .forminator-ui textarea {
	text-align: right;
}

/* Phone and email inputs stay LTR so "+961 ..." does not reorder. */
.rtl .forminator-ui input[type="tel"],
.rtl .forminator-ui input[type="email"] {
	direction: ltr;
	text-align: right;
}

/* ---------------------------------------------------------------------
   5. Breadcrumb separator
   The delimiter is drawn with a directional glyph; mirror it so the trail
   reads right-to-left.
   --------------------------------------------------------------------- */
.rtl i.breadcrumb-delimiter {
	transform: scaleX(-1);
	display: inline-block;
}


/* =====================================================================
   Responsive audit 2026-09-30 (Arabic Lebanon)
   ===================================================================== */

/* English product names on Arabic pages kept their letters but lost their
   word order ("15 Watts, 18” tube" rendered as "Watts, 18” Tube 15").
   plaintext lets each title take its direction from its own first letter,
   so Arabic titles stay right-to-left and English ones read correctly. */
body.rtl .woocommerce-loop-product__title,
body.rtl .product_title,
body.rtl .wc-block-grid__product-title,
body.rtl .woocommerce ul.products li.product h2,
body.rtl .woocommerce ul.products li.product h3 {
	unicode-bidi: plaintext;
}

/* Contact icon boxes: the heading links to tel:/mailto: but its text is an
   Arabic label ("الهاتف"), so it must not inherit the LTR rule meant for the
   numbers themselves. */
body.rtl .elementor-icon-box-title a[href^='tel:'],
body.rtl .elementor-icon-box-title a[href^='mailto:'] {
	direction: rtl !important;
}


/* =====================================================================
   RTL review 2026-10-28 (Arabic Lebanon)
   ===================================================================== */

/* "اقرأ المزيد" service links: RTL draws the bug icon on the left, but the
   widget still reserves its 22px on the right, so the icon sat on the text. */
.rtl .service-wrapper .post-more .read-more {
	padding-right: 0 !important;
	padding-left: 22px !important;
}

/* Timeline (About): on tablet the theme only resets `left`, and in RTL the
   leftover `right` wins, pushing the inverted rows' year off-screen. */
@media only screen and (max-width: 768px) {
	.rtl .timeline > li.timeline-inverted > .timeline-sep-title {
		right: auto !important;
	}
}

/* Google reviews widget: the reviews are English, so let each line take its
   own direction ("5 months ago", not "months ago 5"). */
.rtl .wp-google-time,
.rtl .wp-google-text {
	unicode-bidi: plaintext;
	text-align: right;
}

/* Section titles centred on desktop cap their paragraph at 65% with auto
   margins. On tablet/phone the text is right-aligned, so that narrow centred
   block left a gap on the right. Let it use the full width there. */
@media (max-width: 1024px) {
	.rtl .cea-align-center .section-title-wrapper .section-content {
		max-width: 100%;
		margin-left: 0;
		margin-right: 0;
	}
}

/* Industries grid "اتصل بنا" arrow points the reading direction in Arabic. */
.rtl .etx-industries .etx-cta .etx-link svg {
	transform: scaleX(-1);
}
.rtl .etx-industries .etx-cta:hover .etx-link svg {
	transform: scaleX(-1) translateX(4px);
}

/* LB Arabic home hero uses the English photo (van on the right), so the Arabic
   text block sits on the left like the English layout, with the shade from the
   left. Text stays right-aligned. Phones stack text above the photo anyway.
   Client choice, 2026-10-29 (option B). Page 107065 only: the KSA/QA Arabic
   homes still use their own photo. */
body.rtl.page-id-107065 .etx-hero {
	--etx-dir: 90deg;
}
body.rtl.page-id-107065 .etx-hero__inner {
	flex-direction: row-reverse;
}
