/* Arabic Editorial Clean yacht PDP. Injected only on V4 single-yacht pages. */

html[lang="ar"][dir="rtl"] {
  direction: rtl;
}

html[lang="ar"] .header-wrapper,
html[lang="ar"] #site-header,
html[lang="ar"] .custom-footer-container,
html[lang="ar"] footer {
  direction: rtl;
}

/* Mirror the English V4 grid: booking card to the start (left in RTL),
   headings and copy to the right. Mega-menu stays out of document flow. */
html[lang="ar"] #dc-root,
html[lang="ar"] #dc-root > .sc-host,
html[lang="ar"] #mala-ec-main {
  direction: rtl !important;
  unicode-bidi: isolate;
  text-align: right;
}

html[lang="ar"] #dc-root h1,
html[lang="ar"] #dc-root h2,
html[lang="ar"] #dc-root p,
html[lang="ar"] #dc-root li,
html[lang="ar"] #dc-root label,
html[lang="ar"] #dc-root [data-dc-tpl="566"],
html[lang="ar"] #dc-root [data-dc-tpl="566"] *,
html[lang="ar"] #dc-root [data-dc-tpl="567"],
html[lang="ar"] #dc-root [data-dc-tpl="567"] *,
html[lang="ar"] #dc-root [data-dc-tpl="572"],
html[lang="ar"] #dc-root [data-dc-tpl="572"] *,
html[lang="ar"] #dc-root [data-dc-tpl="577"],
html[lang="ar"] #dc-root [data-dc-tpl="577"] * {
  text-align: right;
}

/* English template inlines text-align:left on duration cards. */
html[lang="ar"] #dc-root [style*="text-align: left"]:not(input):not(textarea),
html[lang="ar"] #dc-root [style*="text-align:left"]:not(input):not(textarea) {
  text-align: right !important;
}

/* Sticky booking card: AR header is ~127px; English top:96px hides the card. */
html[lang="ar"] #dc-root [data-dc-tpl="662"] {
  top: 128px !important;
}

/* Extras / Enquire modal — never key padding on data-dc-tpl IDs; those shift
   and 718/719 currently land on the duration − / + buttons. */
html[lang="ar"] #dc-root [data-dc-tpl="718"]:not(button) {
  z-index: 10100 !important;
  padding-top: 120px !important;
  align-items: flex-start !important;
  box-sizing: border-box;
}
html[lang="ar"] #dc-root [data-dc-tpl="718"]:not(button) [data-dc-tpl="719"]:not(button) {
  max-height: calc(100vh - 140px) !important;
}

/* Duration stepper must stay a 28px square; do not inherit modal padding. */
html[lang="ar"] #dc-root button[aria-label="تقليل المدة"],
html[lang="ar"] #dc-root button[aria-label="زيادة المدة"] {
  padding: 0 !important;
  width: 28px !important;
  height: 28px !important;
  min-height: 0 !important;
  max-height: 28px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

/* RTL: close X on the left so it does not cover the heading. */
html[lang="ar"] #dc-root button[aria-label="إغلاق"],
html[lang="ar"] #dc-root button[aria-label="Close"] {
  left: 18px !important;
  right: auto !important;
}

html[lang="ar"] #dc-root input[type="date"],
html[lang="ar"] #dc-root input[type="time"] {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

html[lang="ar"] #mala-ec-header,
html[lang="ar"] [data-dc-tpl="156"],
html[lang="ar"] [data-dc-tpl="427"] {
  display: none !important;
}

html[lang="ar"] #mala-ec-main {
  display: block !important;
}

html[lang="ar"] #dc-root,
html[lang="ar"] #dc-root > .sc-host {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

html[lang="ar"] .header-wrapper {
  isolation: isolate;
  position: sticky;
  top: 0;
  z-index: 10000;
  width: 100%;
}

html[lang="ar"] .header-wrapper .mega-menu-popup {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 10050 !important;
  display: none !important;
  background: transparent;
}

html[lang="ar"] .header-wrapper .mega-menu-popup.is-visible {
  display: block !important;
}

html[lang="ar"] .header-wrapper .nav-links li.dropdown {
  position: relative;
}

html[lang="ar"] .header-wrapper .nav-links li.dropdown .dropdown-content {
  display: none !important;
  position: absolute !important;
  top: 100%;
  z-index: 10001;
}

html[lang="ar"] .header-wrapper .nav-links li.dropdown:hover .dropdown-content,
html[lang="ar"] .header-wrapper .nav-links li.dropdown .dropdown-content:hover {
  display: block !important;
}

html[lang="ar"] [aria-label="Replace"],
html[lang="ar"] [aria-label="Edit"],
html[lang="ar"] button[aria-label="Replace"],
html[lang="ar"] button[aria-label="Edit"] {
  display: none !important;
}

html[lang="ar"] .header-wrapper,
html[lang="ar"] .header-wrapper a,
html[lang="ar"] .header-wrapper p,
html[lang="ar"] .header-wrapper li,
html[lang="ar"] footer,
html[lang="ar"] footer a,
html[lang="ar"] footer p,
html[lang="ar"] footer li,
html[lang="ar"] #dc-root p,
html[lang="ar"] #dc-root li,
html[lang="ar"] #dc-root a,
html[lang="ar"] #dc-root label,
html[lang="ar"] #dc-root button,
html[lang="ar"] #dc-root input,
html[lang="ar"] #dc-root textarea {
  font-family: "IBM Plex Sans Arabic", "Noto Naskh Arabic", Cairo, "Cabinet Grotesk", "Segoe UI", sans-serif;
}

html[lang="ar"] #dc-root h1,
html[lang="ar"] #dc-root h2,
html[lang="ar"] #dc-root .mala-ec-generated-h1 {
  font-family: Vonca, "IBM Plex Sans Arabic", "Noto Naskh Arabic", Cairo, serif;
}

/* Date/time: Arabic text on the right, icons on the left so they do not overlap. */
html[lang="ar"] #dc-root [data-dc-tpl="692"],
html[lang="ar"] #dc-root [data-dc-tpl="695"] {
  direction: rtl !important;
  text-align: right !important;
  unicode-bidi: isolate;
}
html[lang="ar"] #dc-root [data-dc-tpl="692"] [data-dc-tpl="693"],
html[lang="ar"] #dc-root [data-dc-tpl="692"] [data-dc-tpl="694"],
html[lang="ar"] #dc-root [data-dc-tpl="695"] [data-dc-tpl="696"],
html[lang="ar"] #dc-root [data-dc-tpl="695"] [data-dc-tpl="697"] {
  text-align: right !important;
  padding-right: 10px !important;
  padding-left: 44px !important;
}
html[lang="ar"] #dc-root [data-mala-ec-cal-icon],
html[lang="ar"] #dc-root [data-mala-ec-clock-icon] {
  left: 8px !important;
  right: auto !important;
}


/* Phase 3.2: white EN-parity PDP header offsets (scoped). */
html.mala-pdp-site-header[lang="ar"] .header-wrapper,
html.mala-pdp-site-header[lang="ar"] #site-header.custom-header {
  background: #fff !important;
}
