/**
 * Hospitality Layer - hspi18n front-office stylesheet.
 * Symmetric file (never *_rtl.css, DESIGN §1.4): every rule is scoped to html[dir="rtl"].
 * The theme's rtl.css sets `* { direction: rtl !important }`; the LTR-island rules below are more
 * specific and therefore win among !important declarations (I18N-03 corrected fix).
 *
 * @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
 */

/* ------------------------------------------------------------------ LTR islands (I18N-03) */

/* atomic LTR tokens and everything inside them */
html[dir="rtl"] [dir="ltr"],
html[dir="rtl"] [dir="ltr"] *,
html[dir="rtl"] .hsp-ltr,
html[dir="rtl"] .hsp-ltr *,
html[dir="rtl"] bdi:dir(ltr),
html[dir="rtl"] [dir="auto"]:dir(ltr) { direction: ltr !important; }

html[dir="rtl"] [dir="ltr"],
html[dir="rtl"] .hsp-ltr,
html[dir="rtl"] bdi,
html[dir="rtl"] [dir="auto"] { unicode-bidi: isolate !important; }

/* existing core output that cannot be edited (zero core edits) */
html[dir="rtl"] a[href^="tel:"],
html[dir="rtl"] a[href^="mailto:"] { direction: ltr !important; unicode-bidi: isolate !important; }

/* core inputs: most phone fields are type=text, so match by name/validator */
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[data-validate="isEmail"],
html[dir="rtl"] input[data-validate="isPhoneNumber"],
html[dir="rtl"] input[name="phone"],
html[dir="rtl"] input[name="phone_mobile"],
html[dir="rtl"] input.hsp-ltr { direction: ltr !important; text-align: right; }

/* ------------------------------------------------------------------ date-range picker (RTL) */

html[dir="rtl"] .date-picker-wrapper { text-align: right; }
html[dir="rtl"] .date-picker-wrapper .month-name { text-transform: none; }
html[dir="rtl"] .date-picker-wrapper .month-wrapper table .week-name th { text-transform: none; }
html[dir="rtl"] .date-picker-wrapper .footer,
html[dir="rtl"] .date-picker-wrapper .drp_top-bar { text-align: right; }

/* jQuery UI datepicker (FO): the ar regional sets isRTL; keep arrows pointing the reading way */
html[dir="rtl"] .ui-datepicker .ui-datepicker-prev { right: 2px; left: auto; }
html[dir="rtl"] .ui-datepicker .ui-datepicker-next { left: 2px; right: auto; }

/* ------------------------------------------------------------------ directional icons */

/* rtl.css already swaps icon-angle-*, icon-angle-double-* and icon-chevron-* glyphs (the picker
   arrows use icon-angle-left/right and are therefore correct); mirror the remaining arrows only */
html[dir="rtl"] .icon-arrow-left:before,
html[dir="rtl"] .icon-arrow-right:before,
html[dir="rtl"] .icon-long-arrow-left:before,
html[dir="rtl"] .icon-long-arrow-right:before,
html[dir="rtl"] .icon-caret-left:before,
html[dir="rtl"] .icon-caret-right:before {
    display: inline-block;
    transform: scaleX(-1);
}

/* ------------------------------------------------------------------ header / nav */

html[dir="rtl"] .header-top-item,
html[dir="rtl"] #header .nav-main-item-right { text-align: right; }
html[dir="rtl"] #header_logo { float: right; }
html[dir="rtl"] #languages-block-top ul.dropdown-menu,
html[dir="rtl"] #currencies-block-top ul.dropdown-menu,
html[dir="rtl"] #header_user_info ul.dropdown-menu { right: auto; left: 0; text-align: right; }

/* ------------------------------------------------------------------ search panel & occupancy */

html[dir="rtl"] #search_hotel_block_form .form-group,
html[dir="rtl"] #search_hotel_block_form label { text-align: right; }
html[dir="rtl"] #search_hotel_block_form .dropdown-menu,
html[dir="rtl"] .booking_occupancy_wrapper,
html[dir="rtl"] #search_occupancy_wrapper { text-align: right; }
html[dir="rtl"] .occupancy_info_block .occupancy_count_block .input-group,
html[dir="rtl"] .occupancy_quantity_container { direction: ltr !important; }
html[dir="rtl"] .occupancy_quantity_container input { text-align: center; }
html[dir="rtl"] .remove-room-link,
html[dir="rtl"] .occupancy_info_block .remove-room-link { float: left !important; }

/* ------------------------------------------------------------------ room list / room page */

html[dir="rtl"] .room_cont .room_info_cont,
html[dir="rtl"] .room_cont .rm_type_amenities,
html[dir="rtl"] #product .booking-form,
html[dir="rtl"] .booking_room_fields { text-align: right; }
html[dir="rtl"] .room_cont .rm_price_cont,
html[dir="rtl"] .price_cont .product_price { direction: rtl; }
html[dir="rtl"] .rm_amenities_cont .rm_amenity_img { margin-left: 5px; margin-right: 0; }

/* ------------------------------------------------------------------ cart / checkout / account */

html[dir="rtl"] #cart_summary th,
html[dir="rtl"] #cart_summary td,
html[dir="rtl"] .table-bordered th,
html[dir="rtl"] .table-bordered td { text-align: right; }
html[dir="rtl"] #cart_summary .cart_total,
html[dir="rtl"] #cart_summary .price,
html[dir="rtl"] .cart_total_price td.price { text-align: left; }
html[dir="rtl"] .order_steps li,
html[dir="rtl"] ul.step li { float: right; }
html[dir="rtl"] .cart_navigation .button-exclusive,
html[dir="rtl"] .cart_navigation .button-medium { float: right; }
html[dir="rtl"] .cart_navigation .standard-checkout,
html[dir="rtl"] .cart_navigation .button-medium.pull-right { float: left !important; }
html[dir="rtl"] .myaccount-link-list li a,
html[dir="rtl"] .addresses .address li { text-align: right; }
html[dir="rtl"] .form-group .form_info,
html[dir="rtl"] .required.form-group label sup { margin-right: 2px; margin-left: 0; }

/* order references / invoice numbers rendered by core as plain text next to Arabic labels */
html[dir="rtl"] .order_reference,
html[dir="rtl"] .history_link a,
html[dir="rtl"] .order-reference { unicode-bidi: isolate; }

/* ------------------------------------------------------------------ footer */

html[dir="rtl"] #footer .footer-block,
html[dir="rtl"] #footer .footer-list li,
html[dir="rtl"] .footer-explore-section { text-align: right; }
html[dir="rtl"] #footer #languages-block-top,
html[dir="rtl"] #footer #currencies-block-top { float: none; display: inline-block; }

/* ------------------------------------------------------------------ hospitality modules */

html[dir="rtl"] .hsp-i18n-num { direction: ltr !important; unicode-bidi: isolate !important; display: inline-block; }
