/* ============================================================
   SAFQA — RTL Arabic Full Support Layer  v13
   Uses logical properties where possible, targeted fixes elsewhere
   ============================================================ */

/* ── 1. BASE DOCUMENT ─────────────────────────────────────── */
html[dir="rtl"] {
    direction: rtl;
    font-family: var(--safqa-font-arabic, 'Noto Sans Arabic', 'Tahoma', sans-serif) !important;
}
html[dir="rtl"] body { direction: rtl !important; }

/* ── 2. TYPOGRAPHY ─────────────────────────────────────────── */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 { direction: rtl; text-align: right; }

/* ── 3. TOP PANEL ──────────────────────────────────────────── */
html[dir="rtl"] .tygh-top-panel,
html[dir="rtl"] .ut2-top-panel { direction: rtl; text-align: right; }

/* ── 4. HEADER ──────────────────────────────────────────────── */
html[dir="rtl"] .tygh-header,
html[dir="rtl"] .ut2-h { direction: rtl; }

/* Search input — text on right, button on left */
html[dir="rtl"] .ty-search-block__input,
html[dir="rtl"] .ut2-h__search input,
html[dir="rtl"] .ty-search-field input {
    direction: rtl !important;
    text-align: right !important;
    padding-right: 16px !important;
    padding-left: 52px !important;
    border-radius: 999px 0 0 999px !important;
}
html[dir="rtl"] .ty-search-magnifier,
html[dir="rtl"] .ut2-h__search button,
html[dir="rtl"] .ty-search-field__submit {
    border-radius: 999px 0 0 999px !important;
}

/* ── 5. NAVIGATION MENU ────────────────────────────────────── */
html[dir="rtl"] .ut2-h__menu,
html[dir="rtl"] .ty-menu__items,
html[dir="rtl"] .ut2-menu__items { direction: rtl; }
html[dir="rtl"] .ut2-menu__link,
html[dir="rtl"] .ty-menu__item-link { direction: rtl; text-align: right; }

/* Submenu open left in RTL */
html[dir="rtl"] .ut2-menu__submenu__wrapper,
html[dir="rtl"] .ty-menu__submenu {
    direction: rtl;
    text-align: right;
    right: 0 !important;
    left: auto !important;
}

/* Flip chevrons */
html[dir="rtl"] .ty-menu .ty-icon-down-open,
html[dir="rtl"] .ty-menu .ty-icon-right-open,
html[dir="rtl"] .ut2-menu .ty-icon-down-open,
html[dir="rtl"] .ut2-menu .ty-icon-right-open { transform: scaleX(-1) !important; }

/* ── 6. MEGA MENU / FLYOUT ──────────────────────────────────── */
html[dir="rtl"] .ut2-megamenu,
html[dir="rtl"] .ut2-fmw,
html[dir="rtl"] .ut2-fm { direction: rtl; text-align: right; right: 0 !important; left: auto !important; }
html[dir="rtl"] .ut2-lfl,
html[dir="rtl"] .ut2-lfl__head,
html[dir="rtl"] .ut2-lsl { direction: rtl; text-align: right; }

/* ── 7. BANNERS ─────────────────────────────────────────────── */
html[dir="rtl"] .ut2-banner,
html[dir="rtl"] .ty-mainbox-simple-container { direction: rtl; }
html[dir="rtl"] .ut2-a__title,
html[dir="rtl"] .ut2-a__descr,
html[dir="rtl"] .ut2-a__description { direction: rtl; text-align: right; }
html[dir="rtl"] .ut2-banner .ut2-a__content.align-left { justify-content: flex-end !important; align-items: flex-end !important; }
html[dir="rtl"] .ut2-banner .ut2-a__content.align-right { justify-content: flex-start !important; align-items: flex-start !important; }

/* ── 8. PRODUCT CARDS ───────────────────────────────────────── */
html[dir="rtl"] .ut2-gl__item { direction: rtl; }
html[dir="rtl"] .ut2-gl__content,
html[dir="rtl"] .ut2-gl__name,
html[dir="rtl"] .ut2-gl__price,
html[dir="rtl"] .ut2-gl__vendor { text-align: right !important; direction: rtl !important; }

/* ── 9. BREADCRUMBS ─────────────────────────────────────────── */
html[dir="rtl"] .ty-breadcrumbs { direction: rtl; text-align: right; }
html[dir="rtl"] .ty-breadcrumbs__slash { display: inline-block; transform: scaleX(-1); margin: 0 8px; }
html[dir="rtl"] .ty-breadcrumbs .ty-icon-right-dir,
html[dir="rtl"] .ty-breadcrumbs .ty-icon-left-dir { transform: scaleX(-1) !important; }

/* ── 10. SIDEBAR / FILTERS ──────────────────────────────────── */
html[dir="rtl"] .ty-sidebox,
html[dir="rtl"] .ut2-sidebox { direction: rtl; text-align: right; }
html[dir="rtl"] .ty-sidebox__title,
html[dir="rtl"] .ut2-sidebox__title { text-align: right !important; }

/* ── 11. PAGINATION ─────────────────────────────────────────── */
html[dir="rtl"] .ty-pagination { direction: rtl; flex-direction: row-reverse; }
html[dir="rtl"] .ty-pagination .ty-icon-right-dir,
html[dir="rtl"] .ty-pagination .ty-icon-left-dir { transform: scaleX(-1) !important; }

/* ── 12. FORMS ──────────────────────────────────────────────── */
html[dir="rtl"] input[type="text"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="password"],
html[dir="rtl"] input[type="number"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] select,
html[dir="rtl"] textarea { direction: rtl; text-align: right; }
html[dir="rtl"] label { direction: rtl; }

/* ── 13. BUTTONS ────────────────────────────────────────────── */
html[dir="rtl"] .ty-btn,
html[dir="rtl"] .ut2-btn,
html[dir="rtl"] button { direction: rtl; }

/* ── 14. PRODUCT PAGE ───────────────────────────────────────── */
html[dir="rtl"] .ut2-pb { direction: rtl; }
html[dir="rtl"] .ut2-pb__title-wrap h1 { text-align: right !important; direction: rtl !important; }
html[dir="rtl"] .ut2-pb__main-content-box { text-align: right !important; direction: rtl !important; }
html[dir="rtl"] .ut2-pb__price,
html[dir="rtl"] .ut2-pb__rating { direction: rtl !important; text-align: right !important; }
html[dir="rtl"] .ut2-pb__options,
html[dir="rtl"] .ut2-pb__advanced-options { direction: rtl !important; text-align: right !important; }
html[dir="rtl"] .ut2-pb__options label,
html[dir="rtl"] .ut2-pb__advanced-options label { text-align: right !important; display: block !important; }
html[dir="rtl"] .ut2-pb__short-descr,
html[dir="rtl"] .ut2-pb__short-features,
html[dir="rtl"] .ut2-pb__note { direction: rtl !important; text-align: right !important; }
html[dir="rtl"] .ut2-pb__right-wrapper { direction: rtl !important; text-align: right !important; }
html[dir="rtl"] .ut2-pb__top-ss { flex-direction: row-reverse !important; direction: rtl !important; }
html[dir="rtl"] .ut2-qty__wrap { flex-direction: row-reverse !important; direction: rtl !important; }
html[dir="rtl"] .ut2-pb .ty-product-block__amount { direction: rtl !important; text-align: right !important; }

/* Vendor box on product page */
html[dir="rtl"] .ut2-pb .ut2-vendor-block { direction: rtl !important; text-align: right !important; }
html[dir="rtl"] .ut2-pb__tabs-wrapper { direction: rtl !important; }

/* ── 15. DROPDOWN MENUS ─────────────────────────────────────── */
html[dir="rtl"] .ty-dropdown-box__content {
    direction: rtl; text-align: right;
    right: 0 !important; left: auto !important;
}

/* ── 16. NOTIFICATION TOASTS ────────────────────────────────── */
html[dir="rtl"] .ty-notification,
html[dir="rtl"] [class*="cm-notification"] {
    direction: rtl !important; text-align: right !important;
    border-left: none !important;
    border-right: 4px solid var(--safqa-brand, #009598) !important;
}

/* ── 17. FOOTER ──────────────────────────────────────────────── */
html[dir="rtl"] .ty-footer-grid,
html[dir="rtl"] .ut2-footer { direction: rtl; text-align: right; }

/* ── 18. CATEGORY TITLES ────────────────────────────────────── */
html[dir="rtl"] .ty-category-banner__title,
html[dir="rtl"] .ty-subcategories__item-name { direction: rtl; text-align: right; }

/* ── 19. SAFQA CUSTOM COMPONENTS ────────────────────────────── */
html[dir="rtl"] .safqa-trust-bar__inner { flex-direction: row-reverse; }
html[dir="rtl"] .safqa-trust-item { flex-direction: row-reverse; }
html[dir="rtl"] .safqa-section-heading { flex-direction: row-reverse; }
html[dir="rtl"] .safqa-dark-toggle { left: auto !important; right: var(--safqa-space-6, 24px) !important; }
html[dir="rtl"] .safqa-bottom-nav { direction: rtl; }

/* ── 20. LIVE SEARCH ─────────────────────────────────────────── */
html[dir="rtl"] .ty-live-search__results,
html[dir="rtl"] [class*="live-search"],
html[dir="rtl"] .ty-live-search__name { direction: rtl; text-align: right; }

/* ── 21. REVIEWS ────────────────────────────────────────────── */
html[dir="rtl"] .ut2-discussion,
html[dir="rtl"] .ty-product-review-post { direction: rtl; text-align: right; }
html[dir="rtl"] .ty-product-review-post__text { text-align: right !important; }

/* ── 22. BDI ────────────────────────────────────────────────── */
html[dir="rtl"] bdi { direction: rtl; unicode-bidi: isolate; }

/* ── 23. PROTECT ICON FONTS — always LTR ───────────────────── */
html[dir="rtl"] .ty-icon,
html[dir="rtl"] [class*="ty-icon-"],
html[dir="rtl"] .ut2-icon,
html[dir="rtl"] [class*="ut2-icon-"],
html[dir="rtl"] [class*="ut2-mwi-icon"],
html[dir="rtl"] .fa,
html[dir="rtl"] [class*="fa-"],
html[dir="rtl"] .safqa-bottom-nav__icon,
html[dir="rtl"] .safqa-dark-toggle {
    font-family: 'tygh-icons','FontAwesome','glyphs',sans-serif !important;
    direction: ltr !important;
    display: inline-block !important;
    unicode-bidi: isolate !important;
}

/* ── 24. BUYBOX STOCK CHECK ─────────────────────────────────── */
html[dir="rtl"] .buybox-stock { flex-direction: row-reverse; }

/* ── 25. PRODUCT DETAIL CENTER COLUMN RTL ───────────────────── */
html[dir="rtl"] .sqz-pb__col-details {
    direction: rtl !important;
    text-align: right !important;
}
html[dir="rtl"] .sqz-pb__title {
    text-align: right !important;
}
html[dir="rtl"] .sqz-pb__brand {
    text-align: right !important;
}
html[dir="rtl"] .sqz-pb__rating {
    justify-content: flex-end !important;
}
html[dir="rtl"] .sqz-pb__center-price {
    text-align: right !important;
}
html[dir="rtl"] .sqz-pb__list-price {
    text-align: right !important;
}
html[dir="rtl"] .sqz-pb__social-proof {
    text-align: right !important;
}
html[dir="rtl"] .sqz-pb__features {
    text-align: right !important;
}
html[dir="rtl"] .sqz-pb__short-descr {
    text-align: right !important;
}
/* Buybox RTL */
html[dir="rtl"] .sqz-pb__buybox-card {
    direction: rtl !important;
    text-align: right !important;
}
html[dir="rtl"] .sqz-pb__seller-table .sqz-pb__seller-label {
    text-align: right !important;
}
html[dir="rtl"] .sqz-pb__seller-table .sqz-pb__seller-value {
    text-align: left !important;
}

/* Seller table — RTL direction so label is on right, value on left */
html[dir="rtl"] .sqz-pb__seller-table {
    direction: rtl !important;
}
html[dir="rtl"] .sqz-pb__seller-table td {
    text-align: right !important;
}
html[dir="rtl"] .sqz-pb__seller-table .sqz-pb__seller-value {
    text-align: left !important;
    padding-inline-start: 12px !important;
}

/* Trust row — RTL order */
html[dir="rtl"] .sqz-pb__trust-row {
    direction: rtl !important;
    justify-content: flex-start !important;
}
html[dir="rtl"] .sqz-pb__trust-item {
    text-align: center !important;
}
/* About this item section — RTL */
html[dir="rtl"] .sqz-amazon-details--inline .sqz-amazon-details__subheading {
    flex-direction: row-reverse !important;
    text-align: right !important;
}

/* Amazon extras accordion — RTL */
html[dir="rtl"] .sqz-amazon-details__subheading {
    flex-direction: row-reverse !important;
    text-align: right !important;
}
html[dir="rtl"] .sqz-amazon-details__description {
    text-align: right !important;
    direction: rtl !important;
}
html[dir="rtl"] .sqz-amazon-details__specs {
    direction: rtl !important;
}
html[dir="rtl"] .sqz-amazon-details__spec-label {
    text-align: right !important;
}
html[dir="rtl"] .sqz-amazon-details__bullets {
    direction: rtl !important;
    text-align: right !important;
}
html[dir="rtl"] .sqz-amazon-details__report-link {
    flex-direction: row-reverse !important;
}

/* FORCE: Write a review button small */
html[dir="rtl"] a.ty-product-review-write-product-review-button,
html[dir="rtl"] .ty-product-review-write-product-review-button {
    font-size: 13px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #007185 !important;
    display: inline !important;
    min-height: 0 !important;
    height: auto !important;
    width: auto !important;
    font-weight: 400 !important;
    border-radius: 0 !important;
}

/* Fix collapse animation */
html[dir="rtl"] .sqz-amazon-details__body {
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.3s ease !important;
}
html[dir="rtl"] .sqz-amazon-details__body--open {
    max-height: 3000px !important;
    overflow: visible !important;
}
