/**
 * Orchard Florist – RTL Overrides
 * Applied when html[dir="rtl"] is set (Arabic, Hebrew, etc.)
 */

[dir="rtl"] {
  /* General */
  text-align: right;
}

/* ─── Header & Nav ─────────────────────────────────────────────────── */
[dir="rtl"] .site-header .container {
  flex-direction: row-reverse;
}

[dir="rtl"] .header-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .main-nav {
  flex-direction: row-reverse;
}

[dir="rtl"] .lang-dropdown {
  margin-right: auto;
  margin-left: 0;
}

/* ─── Sidebar ───────────────────────────────────────────────────────── */
[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  transform: translateX(100%);
  border-right: none;
  border-left: 1px solid rgba(255,255,255,.1);
}

[dir="rtl"] .sidebar.open {
  transform: translateX(0);
}

[dir="rtl"] .main-wrap {
  margin-left: 0;
  margin-right: 256px;
}

[dir="rtl"] .sidebar-link {
  flex-direction: row-reverse;
  padding-right: 1.25rem;
  padding-left: 1rem;
  border-left: none;
  border-right: 3px solid transparent;
}

[dir="rtl"] .sidebar-link.active,
[dir="rtl"] .sidebar-link:hover {
  border-right-color: var(--clr-blush);
  border-left-color: transparent;
}

[dir="rtl"] .sidebar-footer {
  flex-direction: row-reverse;
}

/* ─── Customer Sidebar ──────────────────────────────────────────────── */
[dir="rtl"] .customer-sidebar {
  border-right: none;
  border-left: 1px solid var(--clr-border);
}

[dir="rtl"] .customer-nav-link {
  border-left: none;
  border-right: 3px solid transparent;
  flex-direction: row-reverse;
}

[dir="rtl"] .customer-nav-link:hover,
[dir="rtl"] .customer-nav-link.active {
  border-right-color: var(--clr-blush-dark);
  border-left-color: transparent;
}

/* ─── Forms ─────────────────────────────────────────────────────────── */
[dir="rtl"] .form-control {
  text-align: right;
}

[dir="rtl"] .input-group .input-icon {
  left: auto;
  right: .875rem;
}

[dir="rtl"] .input-group input {
  padding-left: .875rem;
  padding-right: 2.5rem;
}

[dir="rtl"] .form-check {
  flex-direction: row-reverse;
}

/* ─── Alerts ────────────────────────────────────────────────────────── */
[dir="rtl"] .alert {
  text-align: right;
}

[dir="rtl"] .alert-icon {
  margin-right: 0;
  margin-left: .75rem;
}

/* ─── Buttons & Cards ───────────────────────────────────────────────── */
[dir="rtl"] .btn i,
[dir="rtl"] .btn svg {
  margin-right: 0;
  margin-left: .4em;
}

[dir="rtl"] .product-card-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .wishlist-btn {
  right: auto;
  left: .75rem;
}

/* ─── Product Detail ────────────────────────────────────────────────── */
[dir="rtl"] .product-detail-grid {
  direction: rtl;
}

/* ─── Cart ──────────────────────────────────────────────────────────── */
[dir="rtl"] .cart-header,
[dir="rtl"] .cart-row {
  direction: rtl;
}

/* ─── Breadcrumb ────────────────────────────────────────────────────── */
[dir="rtl"] .breadcrumb {
  direction: rtl;
}

[dir="rtl"] .breadcrumb .sep {
  transform: scaleX(-1);
}

/* ─── Tables ────────────────────────────────────────────────────────── */
[dir="rtl"] .data-table th,
[dir="rtl"] .data-table td {
  text-align: right;
}

[dir="rtl"] .data-table th:first-child,
[dir="rtl"] .data-table td:first-child {
  border-radius: 0 8px 8px 0;
}

[dir="rtl"] .data-table th:last-child,
[dir="rtl"] .data-table td:last-child {
  border-radius: 8px 0 0 8px;
}

/* ─── Stat Cards ────────────────────────────────────────────────────── */
[dir="rtl"] .stat-card {
  flex-direction: row-reverse;
}

[dir="rtl"] .stat-info {
  text-align: right;
}

/* ─── Kanban ────────────────────────────────────────────────────────── */
[dir="rtl"] .kanban-board {
  direction: rtl;
}

[dir="rtl"] .kanban-task {
  text-align: right;
}

/* ─── Footer ────────────────────────────────────────────────────────── */
[dir="rtl"] .footer-grid {
  direction: rtl;
}

[dir="rtl"] .footer-bottom {
  flex-direction: row-reverse;
}

[dir="rtl"] .footer-social {
  flex-direction: row-reverse;
}

/* ─── Pagination ────────────────────────────────────────────────────── */
[dir="rtl"] .pagination {
  flex-direction: row-reverse;
}

/* ─── WhatsApp Float ────────────────────────────────────────────────── */
[dir="rtl"] .whatsapp-float {
  right: auto;
  left: 1.5rem;
}

/* ─── Topbar ────────────────────────────────────────────────────────── */
[dir="rtl"] .topbar {
  flex-direction: row-reverse;
}

[dir="rtl"] .topbar-actions {
  flex-direction: row-reverse;
}

/* ─── Panel ─────────────────────────────────────────────────────────── */
[dir="rtl"] .panel-header {
  flex-direction: row-reverse;
}

/* ─── Summary Row ───────────────────────────────────────────────────── */
[dir="rtl"] .summary-row {
  flex-direction: row-reverse;
}

/* ─── Hero ──────────────────────────────────────────────────────────── */
[dir="rtl"] .hero-content {
  text-align: right;
}

[dir="rtl"] .hero-buttons {
  flex-direction: row-reverse;
}

/* ─── Section titles ────────────────────────────────────────────────── */
[dir="rtl"] .section-subtitle::after {
  right: 50%;
  transform: translateX(50%);
}

@media (max-width: 768px) {
  [dir="rtl"] .main-wrap {
    margin-right: 0;
  }

  [dir="rtl"] .sidebar {
    transform: translateX(100%);
  }

  [dir="rtl"] .sidebar.open {
    transform: translateX(0);
  }
}
