/* =====================================================================
   La Patissiere — right-to-left overrides. Loaded ONLY on /ar/ pages.
   =====================================================================

   WHY A SEPARATE FILE AND NOT LOGICAL PROPERTIES EVERYWHERE
   Converting the whole site to margin-inline-start / inset-inline would be
   the textbook answer and it is the right long-term one. It also means
   touching several hundred declarations across five stylesheets and two
   hand-authored pages, days before launch, with the English site as
   collateral if anything is missed. This file mirrors only what actually
   needs mirroring, loads on Arabic pages alone, and cannot affect English
   or French by construction. The conversion can follow later without any
   of it being wasted.

   🔴 dir="rtl" ON <html> ALREADY DOES MOST OF THE WORK. Text direction,
   text-align defaults, flex and grid flow, list markers and scroll
   direction all invert on their own. What does NOT invert is anything
   pinned with a physical offset -- left:, right:, padding-left, border-left
   -- and that is what is listed below. Adding rules that dir already
   handles is how an RTL sheet grows into something nobody dares touch.
   ===================================================================== */

/* ---------- Arabic typefaces -----------------------------------------
   Playfair Display has no Arabic. Amiri is a refined Naskh with the same
   classical, slightly editorial feel, which is what the display face is
   doing on the English pages -- a heritage sweets manufacturer, not a
   tech brand. IBM Plex Sans Arabic is the literal Arabic companion to the
   body face already in use, so the two scripts share a designer's idea of
   weight and rhythm rather than merely sitting next to each other. */
@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600&display=swap');

[dir="rtl"] body{
  font-family:'IBM Plex Sans Arabic','IBM Plex Sans',system-ui,sans-serif;
  /* Arabic sits taller and needs more leading than Latin at the same size;
     1.55 that reads comfortably in English is tight in Naskh. */
  line-height:1.75;
}
[dir="rtl"] h1,[dir="rtl"] h2,[dir="rtl"] h3,
[dir="rtl"] .h2,[dir="rtl"] .phead h1{
  font-family:'Amiri','Playfair Display',Georgia,serif;
  line-height:1.4;letter-spacing:0;   /* negative tracking damages Arabic joins */
}
/* mono is used for labels and eyebrows; Latin mono has no Arabic, and
   letter-spacing on Arabic breaks the connected script outright */
[dir="rtl"] .klabel,[dir="rtl"] .phead .eyebrow,[dir="rtl"] .xl-d summary,
[dir="rtl"] .sf-h,[dir="rtl"] .wr-c,[dir="rtl"] .lp-wa .lp-lbl,
[dir="rtl"] .lp-wa-hd p,[dir="rtl"] .lp-wa-hrs,[dir="rtl"] .lp-wa-pre span{
  font-family:'IBM Plex Sans Arabic',system-ui,sans-serif;
  letter-spacing:0;
}

/* ---------- the two floating controls --------------------------------
   Above 600px these are a vertical stack in the bottom corner; below, they
   take opposite corners. Both arrangements mirror. */
[dir="rtl"] .lp-wa{right:auto;left:22px}
[dir="rtl"] .lp-wa-panel{right:auto;left:22px}
[dir="rtl"] .totop{right:auto;left:27px}

/* the unread badge rides the glyph's outer corner, which swaps sides */
[dir="rtl"] .lp-wa-badge{right:auto;left:-10px}
/* the label sits to the other side of the glyph */
[dir="rtl"] .lp-wa .lp-lbl{margin-left:0;margin-right:11px}
[dir="rtl"] .lp-wa.lp-mini .lp-lbl{margin-right:0}
/* the chat bubble's squared corner marks where the message comes from */
[dir="rtl"] .lp-wa-msg{border-radius:10px 10px 10px 2px}
[dir="rtl"] .lp-wa-pre{border-left:0;border-right:2px solid var(--gold,#B4A070)}
/* margin-left carries the -8px that cancels the 44px target's growth (see
   contact.js), so mirroring it must keep the -8px, not zero it. */
[dir="rtl"] .lp-wa-hd .lp-wa-close{margin-left:-8px;margin-right:auto}

@media (max-width:600px){
  [dir="rtl"] .lp-wa{left:14px;right:auto}
  [dir="rtl"] .lp-wa-panel{left:14px;right:14px}
  /* opposite corners, mirrored: WhatsApp takes the left, this takes the right */
  [dir="rtl"] .totop{left:auto;right:14px}
}

/* ---------- footer ---------------------------------------------------
   The reserve that keeps the bottom row clear of the floating stack has to
   move to the other side with it, or the row runs straight under the
   launcher -- the same collision that has already hit the Lenawa mark and
   the word Muscat, just mirrored. */
[dir="rtl"] .sf-bot{
  padding-right:0;
  padding-left:calc(var(--lp-wa-res, 245px) + 34px);
}
@media (max-width:760px){
  [dir="rtl"] .sf-bot{padding-left:0}
}

/* ---------- interior page header -------------------------------------
   The quiet arc echoes the homepage signature sweeping off the right edge.
   In Arabic the page reads the other way, so the sweep does too. */
[dir="rtl"] .phead::before{right:auto;left:-40%}

/* ---------- product strips and range cards ---------------------------
   .xl-s scrolls horizontally; dir already reverses the scroll origin, so
   nothing is needed there. The shelf-life bars are a different matter:
   they are drawn from one edge as a proportion, and that edge flips. */
[dir="rtl"] .xl-bar,[dir="rtl"] .xl-fill{transform-origin:right center}

/* ---------- the ORDER ONLINE control ---------------------------------
   The UAE chip trails the label in English; it should trail it in Arabic
   too, which means swapping which side it sits on. */
[dir="rtl"] .shopcta em{margin-right:0}

/* ---------- 🔴 THE HONEYPOT, AND WHY THIS ONE MATTERED MOST ----------
   The spam honeypots (.hp on the shared form, .t-hp on the Ads landing
   page) are parked at left:-9999px rather than display:none, deliberately:
   some bots skip hidden inputs but fill anything present in the rendered
   DOM. In a left-to-right page the browser ignores overflow past the left
   edge, so it costs nothing.

   Right-to-left mirrors that axis. The same declaration then pushed 9,999
   pixels of real, scrollable page off the side: every Arabic page measured
   11,279px wide against a 1,280px viewport, with a horizontal scrollbar on
   a site whose universal standard is that there is never one. The page
   looked blank in a screenshot because the content had been shoved out of
   frame entirely.

   Nothing about the anti-spam behaviour changes -- the input is still
   rendered, still in the DOM, still fillable by a bot. It is parked past
   the other edge, which in this direction is the one that costs nothing. */
[dir="rtl"] .hp,[dir="rtl"] .t-hp{left:auto;right:-9999px}

/* ---------- things that must NOT mirror ------------------------------
   🔴 Latin-script content keeps its own direction inside an RTL page.
   An email address, a phone number in international format, a URL or a
   brand wordmark reversed is not localisation, it is corruption -- and it
   is the single most common defect on hastily translated Arabic sites. */
[dir="rtl"] .sf-by,[dir="rtl"] a[href^="mailto:"],[dir="rtl"] a[href^="tel:"]{
  direction:ltr;unicode-bidi:isolate;
}
[dir="rtl"] .mark,[dir="rtl"] .lsw{direction:ltr}

/* ---- hero wash: a gradient ANGLE does not mirror with direction --------
   🔴 This is the one that nearly shipped an empty hero.

   .fade-left and .veil are cream washes at 100deg — left to right — whose
   job is to dissolve the product photograph behind the copy. In English
   the copy is on the left, so the opaque end of the wash belongs on the
   left. dir="rtl" mirrors the layout: the copy moves right, the product
   moves left. It does NOT mirror a gradient angle, because 100deg is a
   physical direction, not a logical one. So on every Arabic page the
   opaque end of both washes sat directly on top of the product, and the
   homepage hero rendered as an empty cream panel.

   Nothing caught it, and it is worth writing down why. The image was not
   missing: it loaded, decoded at 900x600, measured 461x307 at a correct
   on-screen position, reported opacity 1 and threw no error. The
   automated sweep passed because an image covered by a veil is not a
   broken image. document.elementsFromPoint reported nothing above it
   either — both washes are pointer-events:none, and that call skips them
   by design. It was only visible by LOOKING at the page.

   360 - 100 = 260deg is the identical wash, mirrored.

   Scoped above 1000px on purpose: below that the layout stacks, the
   product sits under the copy rather than beside it, .fade-left becomes a
   vertical 180deg wash (which needs no mirroring) and .veil is removed
   altogether. An unscoped rule here would outrank both and reintroduce a
   horizontal wash on mobile. */
@media (min-width:1001px){
  [dir="rtl"] .fade-left{
    background:linear-gradient(260deg,var(--paper) 26%,
      rgba(239,237,233,.82) 40%,rgba(239,237,233,0) 60%);
  }
  [dir="rtl"] .veil{
    background:linear-gradient(260deg,
      var(--paper) 34%,
      rgba(239,237,233,.92) 44%,
      rgba(239,237,233,.55) 54%,
      rgba(239,237,233,0) 66%);
  }
}
