/* =====================================================================
   electro_storefront — Arabic/RTL layer (phase 2)

   The whole storefront layer is written with CSS logical properties,
   so `dir="rtl"` (set by cps_web.html for lang=ar) already mirrors
   layouts natively. This file only carries the few physical fixes:
   the Arabic font stack, mirrored direction glyphs and inputs.
   ===================================================================== */

html[dir="rtl"] body.cps-eshop.sf-root,
html[lang="ar"] body.cps-eshop.sf-root {
    direction: rtl;
    font-family: var(--cps-font-arabic, var(--sf-font-body));
}

/* forms read right-to-left (emails/urls stay LTR) */
html[dir="rtl"] .sf-root input:not([type="email"]):not([type="url"]):not([type="tel"]),
html[dir="rtl"] .sf-root textarea,
html[dir="rtl"] .sf-root select {
    text-align: start;
    direction: rtl;
}

html[dir="rtl"] .sf-root input[type="search"] {
    text-align: start;
}

/* numbers and codes stay LTR even inside RTL text */
html[dir="rtl"] .sf-root .sf-cart-item__code,
html[dir="rtl"] .sf-root .sf-cart-item__total,
html[dir="rtl"] .sf-root .sf-pager__btn,
html[dir="rtl"] .sf-root .sf-card__rating-count,
html[dir="rtl"] .sf-root .sf-price {
    direction: ltr;
    unicode-bidi: embed;
}

html[dir="rtl"] .sf-root .sf-pager__btn {
    direction: ltr;
}

/* mirrored direction glyphs (→ / › / chevrons) */
html[dir="rtl"] .sf-root .sf-section-head__link span,
html[dir="rtl"] .sf-root .sf-cat-family__arrow,
html[dir="rtl"] .sf-root .sf-cat-family__child span,
html[dir="rtl"] .sf-root .sf-category-chip span,
html[dir="rtl"] .sf-root .sf-breadcrumbs li + li::before,
html[dir="rtl"] .sf-root .sf-cat-tree__arrow,
html[dir="rtl"] .sf-root .sf-cat-parent__copy span {
    display: inline-block;
    transform: scaleX(-1);
}

/* the search category select is narrow — anchor its arrow correctly */
html[dir="rtl"] .sf-root .sf-search__select {
    background-position: left 10px center;
    padding-inline-start: 26px;
    padding-inline-end: 8px;
}

/* hero copy gradient flips (also mirrored in home.css via [dir="rtl"]) */
html[dir="rtl"] .sf-root .sf-hero__copy {
    background: linear-gradient(270deg, rgba(255, 255, 255, .96) 0%, rgba(255, 255, 255, .86) 60%, rgba(255, 255, 255, 0) 100%);
}

/* Arabic typography rhythm: slightly taller lines for diacritics */
html[lang="ar"] .sf-root .sf-card__title,
html[lang="ar"] .sf-root .sf-prose {
    line-height: 1.7;
}
