/*
 * Makerique Boutique theme for OpenCart 4
 * Copyright (c) 2026 Heliopsy. All Rights Reserved.
 * https://makerique.com
 * SPDX-License-Identifier: LicenseRef-Proprietary
 * Proprietary and confidential. Unauthorized copying, distribution, or
 * modification of this file, by any means, is strictly prohibited.
 */

/* =========================================================================
   Makerique Boutique : Right-to-Left (RTL) layout overrides
   -------------------------------------------------------------------------
   OpenCart sets dir="rtl" on the <html> element when the active language is
   right-to-left (Arabic, Hebrew, Farsi, ...). Every rule in this file is
   therefore scoped under [dir=rtl] so the default left-to-right storefront is
   never touched. This file is auto-loaded and cache-busted by the theme
   (the stylesheet directory is globbed), so no template edit is needed.

   Scope: ONLY the SIDE of directional properties is mirrored here
   (text-align, float, margin/padding left<->right, left:/right: on
   positioned elements, translateX slide directions, asymmetric radii).
   Colours, fonts, font-sizes and spacing amounts are intentionally left
   exactly as the base rules define them.

   Note: the contextual help drawer (.mr-help-*), command palette (.mr-cmdk-*)
   and their floating buttons live in the ADMIN area (injected inline by
   extension/makerique/admin/controller/event/adminhelp.php) and are not part
   of this storefront theme, so they are out of this file's reach. The command
   palette overlay is centered anyway and needs no flipping.
   ========================================================================= */

/* ---- 1. Global -------------------------------------------------------- */
/* Default text flows to the right edge. Components that explicitly center or
   left-align set that themselves at higher specificity, so they win. */
[dir=rtl] body { text-align: right; }

/* Default flow lists (ul/ol) get their padding from the UA logical property
   (padding-inline-start), which already flips under dir=rtl, so no blanket
   list override is added here (a broad ul/ol rule would wrongly re-pad the
   theme's many list-style:none, padding:0 lists). The theme's own indented
   custom lists that use physical padding-left are flipped in their sections
   below (mega-menu sublists, stock submenu). */

/* ---- 2. Header (logo / search / account / cart) ---------------------- */
/* Actions cluster is pushed to the opposite edge. */
[dir=rtl] .mr-header-actions { margin-left: 0; margin-right: auto; }

/* Search input + attached button swap which side is squared/rounded and which
   border is dropped where the two meet. */
[dir=rtl] .mr-header-search .form-control {
  border-right: 1px solid var(--mr-border-strong);
  border-left: 0;
  border-radius: 0 var(--mr-radius-pill) var(--mr-radius-pill) 0;
}
[dir=rtl] .mr-header-search .btn {
  border-left: 1px solid var(--mr-border-strong);
  border-right: 0;
  border-radius: var(--mr-radius-pill) 0 0 var(--mr-radius-pill);
}

/* Mobile off-canvas nav dropdown caret + child-list indent. */
[dir=rtl] .mr-menu-panel .dropdown-toggle::after { float: left; }
[dir=rtl] .mr-menu-panel .dropdown-menu { padding: 0 .75rem .5rem 0; }

/* ---- 3. Footer (columns / social / pay row) -------------------------- */
/* The flex rows (.mr-footer-bottom-inner, .mr-footer-social) reverse on their
   own under dir=rtl; only the explicit margins need mirroring. */
[dir=rtl] .mr-footer-wishlink { margin-left: 0; margin-right: 1rem; }
[dir=rtl] .mr-footer-pay i { margin-right: 0; margin-left: .35rem; }

/* ---- 4. Back-to-top floating button ---------------------------------- */
[dir=rtl] .mr-backtotop { right: auto; left: 1.1rem; }

/* ---- 5. Cart drawer (offcanvas-end -> enters from the LEFT) ---------- */
/* Bootstrap's .offcanvas-end is physically pinned right; mirror it so the
   cart slides in from the left edge in RTL. */
[dir=rtl] #mr-cart-drawer.offcanvas-end {
  right: auto;
  left: 0;
  transform: translateX(-100%);
}
[dir=rtl] #mr-cart-drawer.offcanvas-end.show { transform: none; }

/* ---- 6. Mobile navigation panel (offcanvas-start -> from the RIGHT) --- */
[dir=rtl] #mr-mobile-nav.offcanvas-start {
  left: auto;
  right: 0;
  transform: translateX(100%);
}
[dir=rtl] #mr-mobile-nav.offcanvas-start.show { transform: none; }

/* ---- 7. Info drawer (.mr-drawer): right-edge handles -> left edge ----- */
[dir=rtl] .mr-drawer-handles {
  right: auto;
  left: 0;
  align-items: flex-start;
}
/* Handle rounds toward the page (its free side) and squares off at the screen
   edge; mirror both corners and the hover "peek" padding. */
[dir=rtl] .mr-drawer-handle {
  border-radius: 0 var(--mr-radius-sm, 10px) var(--mr-radius-sm, 10px) 0;
  transition: background var(--mr-transition, .22s ease),
              transform var(--mr-transition, .22s ease),
              padding-left var(--mr-transition, .22s ease);
}
[dir=rtl] .mr-drawer-handle:hover,
[dir=rtl] .mr-drawer-handle:focus-visible {
  padding-right: .55rem;
  padding-left: .9rem;
}
/* Panel slides in from the left edge. */
[dir=rtl] .mr-drawer-panel {
  right: auto;
  left: 0;
  transform: translateX(-100%);
}
[dir=rtl] .mr-drawer.is-open .mr-drawer-panel { transform: translateX(0); }
/* Admin-authored table cells inside a pane. */
[dir=rtl] .mr-drawer-content th,
[dir=rtl] .mr-drawer-content td { text-align: right; }

/* ---- 8. Product page: buybox / gallery / meta ------------------------ */
[dir=rtl] .mr-gallery-zoom { right: auto; left: .7rem; }
[dir=rtl] .mr-product-meta li { margin-right: 0; margin-left: 1.1rem; }
[dir=rtl] .mr-buybox .form-check-label img { margin-right: 0; margin-left: .4rem; }
/* Product-type note accent bar moves to the trailing (right) edge. */
[dir=rtl] .mr-type-note--digital,
[dir=rtl] .mr-type-note--physical,
[dir=rtl] .mr-type-note--rts,
[dir=rtl] .mr-type-note--mto { border-left: 0; }
[dir=rtl] .mr-type-note--digital  { border-right: 3px solid var(--mr-badge-digital); }
[dir=rtl] .mr-type-note--physical { border-right: 3px solid var(--mr-badge-physical); }
[dir=rtl] .mr-type-note--rts      { border-right: 3px solid var(--mr-badge-rts); }
[dir=rtl] .mr-type-note--mto      { border-right: 3px solid var(--mr-badge-mto); }
/* Digital-goods block inline icons. */
[dir=rtl] .mr-digital-instant i,
[dir=rtl] .mr-digital-meta i { margin-right: 0; margin-left: .35rem; }
/* Related-products heading is left-aligned in LTR. */
[dir=rtl] .mr-related .mr-section-head { text-align: right; }

/* ---- 9. Product cards (.product-thumb) ------------------------------- */
/* Product-type badge stack sits top-left in LTR -> top-right in RTL. */
[dir=rtl] .product-thumb .image .mr-badge-stack {
  left: auto;
  right: .7rem;
}
/* Promo/label ribbon stack sits top-right in LTR -> top-left in RTL, and its
   items align to the (now left) edge. */
[dir=rtl] .mr-label-stack {
  right: auto;
  left: .6rem;
  align-items: flex-start;
}
/* Quick-view card button is horizontally centered; only its modal close X is
   pinned to a corner. */
[dir=rtl] .mr-quickview .mr-quickview-x { right: auto; left: .75rem; }

/* ---- 10. Listing / refine bar / breadcrumbs -------------------------- */
[dir=rtl] .mr-refine-types-label { margin-right: 0; margin-left: .1rem; }
/* Listing breadcrumb separator points the other way (rsaquo -> lsaquo). */
[dir=rtl] #product-category > .breadcrumb .breadcrumb-item + .breadcrumb-item::before,
[dir=rtl] #product-search > .breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  content: "\2039"; /* single left-pointing angle quotation mark */
}
/* Category / search page-title underline accent flips to the right edge. */
[dir=rtl] #product-category .mr-cat-header h1::after,
[dir=rtl] #product-search #content > h1::after {
  left: auto;
  right: 0;
}

/* ---- 11. Mega menu / nav drawer indents ------------------------------ */
/* Grandchild sub-list indent + guide border move to the right side. */
[dir=rtl] .mr-mega-sublist {
  padding-left: 0;
  padding-right: .75rem;
  border-left: 0;
  border-right: 1px solid var(--mr-border, rgba(0,0,0,.1));
}
[dir=rtl] .mr-menu-dropdown .mr-menu-sub {
  padding-left: 0;
  padding-right: 2rem;
}

/* ---- 12. Spin-to-win wheel card -------------------------------------- */
/* Wheel, pointer and hub are all centered; only the close button is pinned. */
[dir=rtl] .mr-spin-close { right: auto; left: .6rem; }

/* ---- 13. Cookie bar corners ------------------------------------------ */
/* Mirror the admin-chosen corner cards so the layout reads correctly in RTL.
   REVIEW: this swaps the physical corner (a "bottom-right" choice renders in
   the bottom-left, and vice versa); confirm this matches the desired behaviour
   with a real RTL merchant. Full-width bar + centered modal need no change. */
[dir=rtl] .mr-cookie--bottom-left { left: auto; right: 1rem; }
[dir=rtl] .mr-cookie--bottom-right { right: auto; left: 1rem; }

/* ---- 14. Announcement bar -------------------------------------------- */
[dir=rtl] .mr-announce-close { right: auto; left: .75rem; }
/* Marquee text scrolls the opposite way for RTL reading order. */
[dir=rtl] .mr-announce--marquee .mr-announce-track { animation-direction: reverse; }

/* ---- 15. Cart page: mobile stacked-card cells ------------------------ */
/* These physical text-aligns only exist inside this mobile breakpoint, so the
   mirror is scoped to the same media query (desktop table is unaffected). */
@media (max-width: 767.98px) {
  [dir=rtl] .mr-cart-table > tbody td { text-align: left; }
  [dir=rtl] .mr-cart-table > tbody td::before { text-align: right; }
  [dir=rtl] .mr-cart-table > tbody .mr-cart-cell-name { text-align: right; }
  [dir=rtl] .mr-cart-table > tfoot td[colspan] { text-align: right; }
}

/* ---- 16. Reviews: summary histogram + gallery ----------------------- */
[dir=rtl] .mr-review-summary__outof { margin-left: 0; margin-right: .25rem; }
[dir=rtl] .mr-review-summary__num { text-align: left; }

/* ---- 17. Sales notifications popup ---------------------------------- */
[dir=rtl] .mr-salespop--bottom-left  { left: auto; right: 1rem; }
[dir=rtl] .mr-salespop--bottom-right { right: auto; left: 1rem; }
[dir=rtl] .mr-salespop--top-left     { left: auto; right: 1rem; }
[dir=rtl] .mr-salespop--top-right    { right: auto; left: 1rem; }
