/* ===========================
   banowash.com — RTL Overrides
   =========================== */

/* Direction & Text */
html, body { direction: rtl; }
[dir="ltr"] { direction: ltr; text-align: left; }

/* Flex direction for RTL */
.flex { display: flex; }
.flex-row-reverse-rtl { flex-direction: row-reverse; }

/* Tailwind RTL spacing overrides */
/* margin/padding start → right for RTL */
.mr-auto { margin-right: auto; margin-left: unset !important; }
.ml-auto { margin-left: auto; margin-right: unset !important; }

/* Text alignment */
.text-right { text-align: right; }
.text-left  { text-align: left; }
.text-center { text-align: center; }

/* Border radius RTL flips for specific elements */
.rounded-r-none { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.rounded-l-none { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* Input placeholder RTL */
input::placeholder, textarea::placeholder { text-align: right; }
input[dir="ltr"]::placeholder { text-align: left; }

/* Admin sidebar position: right in RTL */
#admin-sidebar { right: 0; left: auto; }
#admin-main { margin-right: 16rem; margin-left: 0; }

@media (max-width: 1023px) {
  #admin-sidebar {
    transform: translateX(100%);
    transition: transform .3s ease;
  }
  #admin-sidebar.open { transform: translateX(0); }
  #admin-main { margin-right: 0; }
}

/* Toggle switch RTL */
.peer:checked ~ div::after {
  transform: translateX(-100%);
  right: auto;
  left: 2px;
}

/* Pagination */
.pagination { display: flex; gap: 4px; justify-content: center; }

/* Dropdown menus */
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  z-index: 50;
}

/* Star rating RTL */
.star-rating { direction: ltr; display: inline-flex; }

/* Back button arrow RTL */
.back-arrow { transform: rotate(180deg); }

/* Admin table cells */
th, td { text-align: right; }

/* Number inputs */
input[type="number"] { direction: ltr; text-align: left; }

/* Font numbers RTL */
.farsi-num { font-feature-settings: "ss01"; }

/* Sidebar nav active state */
.sidebar-link {
  position: relative;
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-primary);
  border-radius: 0 3px 3px 0;
}

/* RTL scrollbar */
* { scrollbar-width: thin; scrollbar-color: #d1d5db #f9fafb; }

/* OTP input */
.otp-input { direction: ltr; letter-spacing: .5rem; text-align: center; }

/* Tags/chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
}

/* Mobile menu overlay */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 49;
  display: none;
}
.mobile-menu-overlay.open { display: block; }

/* Product gallery thumbnail active */
.gallery-thumb.active {
  border: 2px solid var(--color-primary);
}

/* Category filter sidebar */
.filter-group {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}
.filter-group:last-child { border-bottom: none; }

/* Custom checkbox */
input[type="checkbox"].rounded {
  accent-color: var(--color-primary);
  width: 14px;
  height: 14px;
  cursor: pointer;
}
input[type="radio"] {
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* Peer checked for toggle */
.peer:checked ~ .peer-checked\:bg-primary {
  background-color: var(--color-primary);
}
.peer:checked ~ .peer-checked\:after\:translate-x-full::after {
  transform: translateX(100%);
}

/* Has checked selector for radio cards */
.has-\[\:checked\]\:border-primary:has(:checked) { border-color: var(--color-primary); }
.has-\[\:checked\]\:bg-primary\/5:has(:checked) { background-color: rgba(var(--color-primary-rgb),.05); }
