/* ===========================================
   RTL Styles for Arabic Version - Athwab
   Comprehensive RTL Support
=========================================== */

/* ===== Base RTL Setup ===== */
html[dir="rtl"],
html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
}

/* ===== Arabic Font Family ===== */
html[dir="rtl"] body,
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] p,
html[dir="rtl"] a,
html[dir="rtl"] span,
html[dir="rtl"] li,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] button,
html[dir="rtl"] .theme-btn,
html[dir="rtl"] .nav-link {
  font-family: "Cairo", "Poppins", sans-serif;
}

/* ===== Headings RTL ===== */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 {
  text-align: right;
}

/* ===== Header Bottom Section ===== */
html[dir="rtl"] .header-bottom-section {
  direction: rtl !important;
}

html[dir="rtl"] .header-bottom-section * {
  direction: rtl;
}

html[dir="rtl"] .header-bottom-wrapper {
  flex-direction: row-reverse !important;
  direction: rtl !important;
}

html[dir="rtl"] .header-bottom-wrapper p {
  text-align: center;
  direction: rtl;
}

html[dir="rtl"] .contact-list {
  flex-direction: row-reverse !important;
  direction: rtl !important;
}

html[dir="rtl"] .contact-list li {
  margin-left: 0;
  margin-right: 0;
  margin-inline-start: 0;
  margin-inline-end: 20px;
  direction: rtl;
}

html[dir="rtl"] .contact-list li:first-child {
  margin-inline-end: 0;
}

html[dir="rtl"] .contact-list li:last-child {
  margin-inline-end: 20px;
}

html[dir="rtl"] .contact-list li i {
  margin-left: 8px;
  margin-right: 0;
}

html[dir="rtl"] .contact-list li a {
  direction: ltr !important;
  unicode-bidi: embed;
}

html[dir="rtl"] .flag-wrap {
  flex-direction: row-reverse !important;
  direction: rtl !important;
}

/* ===== Language Toggle ===== */
html[dir="rtl"] .lang-toggle {
  flex-direction: row-reverse !important;
  direction: rtl !important;
}

html[dir="rtl"] .currency-switch {
  direction: rtl !important;
}

/* ===== Prices and Currency - Always LTR ===== */
html[dir="rtl"] .product-content h6,
html[dir="rtl"] .price-list h3,
html[dir="rtl"] .shopping-items span,
html[dir="rtl"] h6 del,
html[dir="rtl"] .product-content h6 del {
  direction: ltr !important;
  unicode-bidi: embed;
}

/* ===== Main Header ===== */
html[dir="rtl"] .header-main {
  flex-direction: row-reverse;
}

/* ===== Navigation Menu - Keep Normal Order ===== */
html[dir="rtl"] .main-menu ul {
  flex-direction: row !important;
}

html[dir="rtl"] .main-menu ul li {
  margin-left: 0;
  margin-right: 0;
  margin-inline-start: 0;
  margin-inline-end: 35px;
}

html[dir="rtl"] .main-menu ul li:last-child {
  margin-inline-end: 0;
}

html[dir="rtl"] .main-menu ul li a i {
  margin-left: 0;
  margin-right: 5px;
}

/* Dropdown Menu */
html[dir="rtl"] .main-menu ul li .sub-menu {
  left: auto;
  right: 0;
  text-align: right;
}

html[dir="rtl"] .main-menu ul li .sub-menu li a {
  text-align: right;
}

/* ===== Header Right ===== */
html[dir="rtl"] .header-right {
  flex-direction: row-reverse;
}

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

html[dir="rtl"] .header-icon li {
  margin-left: 0;
  margin-right: 15px;
}

html[dir="rtl"] .header-icon li:first-child {
  margin-right: 0;
}

/* ===== Buttons ===== */
html[dir="rtl"] .theme-btn i {
  margin-left: 0;
  margin-right: 8px;
}

html[dir="rtl"] .theme-btn::before {
  left: auto;
  right: 0;
}

html[dir="rtl"] .link-btn-2 i {
  margin-left: 0;
  margin-right: 5px;
}

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

html[dir="rtl"] .hero-content h1 {
  text-align: right;
}

html[dir="rtl"] .hero-content p {
  text-align: right;
}

html[dir="rtl"] .hero-button {
  text-align: right;
}

/* Hero Arrows - Flip for RTL */
html[dir="rtl"] .arrow-button {
  flex-direction: row-reverse;
}

/* ===== Feature Section ===== */
html[dir="rtl"] .feature-wrapper {
  flex-direction: row-reverse;
}

html[dir="rtl"] .feature-item .icon {
  margin-left: 15px;
  margin-right: 0;
}

html[dir="rtl"] .feature-item .content {
  text-align: right;
}

html[dir="rtl"] .feature-item .content h6 {
  text-align: right;
}

html[dir="rtl"] .feature-item .content p {
  text-align: right;
}

/* Feature Section Responsive */
@media (max-width: 1199px) {
  html[dir="rtl"] .feature-wrapper {
    flex-wrap: wrap;
    gap: 20px;
  }

  html[dir="rtl"] .feature-item {
    flex: 1 1 calc(50% - 10px);
    min-width: 280px;
  }
}

@media (max-width: 767px) {
  html[dir="rtl"] .feature-item {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  html[dir="rtl"] .feature-item .icon {
    margin-left: 10px;
  }
}

html[dir="rtl"] .array-prev i,
html[dir="rtl"] .array-next i {
  transform: scaleX(-1);
}

/* ===== Feature Section ===== */
html[dir="rtl"] .feature-wrapper {
  flex-direction: row-reverse;
}

html[dir="rtl"] .feature-item .icon {
  margin-left: 15px;
  margin-right: 0;
}

html[dir="rtl"] .feature-item .content {
  text-align: right;
}

/* ===== Section Titles ===== */
html[dir="rtl"] .section-title {
  text-align: right !important;
}

html[dir="rtl"] .section-title.text-center {
  text-align: center;
}

html[dir="rtl"] .section-title .sub-title {
  text-align: inherit;
}

/* ===== Product Wrapper/Tabs ===== */
html[dir="rtl"] .product-wrapper .nav {
  justify-content: flex-start;
}

html[dir="rtl"] .product-wrapper .nav .nav-item {
  margin-left: 0;
  margin-right: 0;
}

/* ===== Product Cards ===== */
html[dir="rtl"] .product-store-item {
  text-align: right;
}

html[dir="rtl"] .product-content {
  text-align: right;
}

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

html[dir="rtl"] .product-content h5 {
  text-align: right;
}

html[dir="rtl"] .product-content h6 {
  text-align: right;
}

/* Sale Box - Move to left */
html[dir="rtl"] .sale-box {
  right: auto;
  left: 15px;
}

/* Product Size - Move to left */
html[dir="rtl"] .product-size {
  right: auto;
  left: 15px;
}

/* Social Icons on Products */
html[dir="rtl"] .product-image .social-icon {
  right: auto;
  left: 15px;
}

/* Color Swatches */
html[dir="rtl"] .list-color-product {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

/* ===== Cart Box ===== */
html[dir="rtl"] .cart-box {
  left: auto;
  right: 0;
  text-align: right;
}

html[dir="rtl"] .cart-box ul li {
  flex-direction: row-reverse;
}

html[dir="rtl"] .cart-product {
  text-align: right;
  margin-right: 15px;
  margin-left: 0;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

html[dir="rtl"] .cart-product a {
  white-space: normal;
  word-wrap: break-word;
  max-width: 150px;
  line-height: 1.4;
}

html[dir="rtl"] .shopping-items {
  flex-direction: row-reverse;
}

/* ===== Shop Background Section ===== */
html[dir="rtl"] .shop-bg-section .bg-image .content {
  text-align: right;
  left: auto;
  right: 30px;
}

/* ===== Testimonial Section ===== */
html[dir="rtl"] .testimonial-content {
  text-align: right;
}

html[dir="rtl"] .testimonial-content p {
  text-align: right;
}

html[dir="rtl"] .info-item {
  flex-direction: row-reverse;
}

html[dir="rtl"] .info-item .text {
  margin-right: 15px;
  margin-left: 0;
  text-align: right;
}

html[dir="rtl"] .info-item .client-image {
  margin-left: 15px;
  margin-right: 0;
}

/* Testimonial Arrows */
html[dir="rtl"] .array-buttons {
  flex-direction: row-reverse;
}

/* ===== Instagram Banner ===== */
html[dir="rtl"] .instagram-banner {
  direction: ltr;
}

/* ===== Footer Section ===== */
html[dir="rtl"] .footer-section {
  text-align: right;
}

html[dir="rtl"] .single-footer-widget {
  text-align: right;
}

html[dir="rtl"] .footer-content {
  text-align: right;
}

html[dir="rtl"] .footer-content p {
  text-align: right;
}

html[dir="rtl"] .widget-head {
  text-align: right;
}

html[dir="rtl"] .list-items {
  text-align: right;
  padding-right: 0;
}

html[dir="rtl"] .list-items li {
  text-align: right;
  list-style-position: inside;
}

html[dir="rtl"] .list-items li a {
  text-align: right;
}

html[dir="rtl"] .list-items li::before {
  margin-right: 0;
  margin-left: 8px;
}

/* Footer Social Icons */
html[dir="rtl"] .social-icon {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

html[dir="rtl"] .social-icon a {
  margin-left: 10px;
  margin-right: 0;
}

html[dir="rtl"] .social-icon a:first-child {
  margin-left: 0;
}

/* Footer Contact List */
html[dir="rtl"] .footer-content .contact-list {
  flex-direction: column;
}

html[dir="rtl"] .footer-content .contact-list li {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

html[dir="rtl"] .footer-content .contact-list li i {
  margin-left: 10px;
  margin-right: 0;
}

/* Footer Bottom */
html[dir="rtl"] .footer-bottom .footer-wrapper {
  flex-direction: row-reverse;
}

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

/* ===== Offcanvas / Mobile Menu ===== */
html[dir="rtl"] .offcanvas__info {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 2px solid var(--theme);
  transform: translateX(-100%);
}

html[dir="rtl"] .offcanvas__info.info-open {
  transform: translateX(0);
}

html[dir="rtl"] .offcanvas__content {
  text-align: right;
}

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

html[dir="rtl"] .offcanvas__contact ul li {
  flex-direction: row-reverse;
}

html[dir="rtl"] .offcanvas__contact-icon {
  margin-left: 15px;
  margin-right: 0;
}

html[dir="rtl"] .offcanvas__contact-text {
  text-align: right;
}

/* ===== Sidebar (Login) ===== */
html[dir="rtl"] .side_bar {
  right: auto;
  left: 0;
  transform: translateX(-100%);
}

html[dir="rtl"] .side_bar.side_bar_show {
  transform: translateX(0);
}

html[dir="rtl"] .login-sidebar {
  text-align: right;
}

html[dir="rtl"] .form-clt {
  text-align: right;
}

html[dir="rtl"] .form-clt input {
  text-align: right;
}

html[dir="rtl"] .form-clt .icon {
  left: 15px;
  right: auto;
}

html[dir="rtl"] .form-check {
  flex-direction: row-reverse;
  padding-left: 0;
  padding-right: 0;
}

html[dir="rtl"] .form-check-input {
  margin-left: 10px;
  margin-right: 0;
  float: right;
}

html[dir="rtl"] .from-cheak-items {
  flex-direction: row-reverse;
}

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

html[dir="rtl"] .user-icon-box {
  text-align: right;
}

/* ===== Search Wrap ===== */
html[dir="rtl"] .search-field-holder input {
  text-align: right;
}

/* ===== Nice Select (Dropdowns) ===== */
html[dir="rtl"] .nice-select {
  text-align: right;
  padding-left: 30px;
  padding-right: 12px;
}

html[dir="rtl"] .nice-select::after {
  right: auto;
  left: 12px;
}

html[dir="rtl"] .nice-select .list {
  right: 0;
  left: auto;
  text-align: right;
}

html[dir="rtl"] .nice-select .option {
  text-align: right;
}

/* ===== Back to Top Button ===== */
html[dir="rtl"] .back-to-top {
  right: auto;
  left: 30px;
}

/* ===== Breadcrumb ===== */
html[dir="rtl"] .breadcrumb-list {
  flex-direction: row-reverse;
}

html[dir="rtl"] .breadcrumb-list li::after {
  content: "/";
  margin-left: 0;
  margin-right: 10px;
}

html[dir="rtl"] .breadcrumb-list li::before {
  display: none;
}

html[dir="rtl"] .breadcrumb-items {
  flex-direction: row-reverse;
}

html[dir="rtl"] .breadcrumb-items i,
html[dir="rtl"] .breadcrumb-items .fa-chevron-right {
  transform: rotate(180deg);
}

/* ===== Shop Grid ===== */
html[dir="rtl"] .shop-grid-wrapper {
  direction: rtl;
}

/* ===== Price List ===== */
html[dir="rtl"] .price-list {
  text-align: right;
}

/* ===== Product Details ===== */
html[dir="rtl"] .details-info {
  text-align: right;
}

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

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

/* Cart Quantity */
html[dir="rtl"] .cart-quantity {
  flex-direction: row-reverse;
}

/* ===== Preloader ===== */
html[dir="rtl"] .txt-loading {
  direction: rtl;
}

/* ===== Sticky Header ===== */
html[dir="rtl"] .sticky .header-main {
  flex-direction: row-reverse;
}

/* ===== Menu Cart ===== */
html[dir="rtl"] .menu-cart .cart-box {
  left: 0;
  right: auto;
}

/* ===== Hamburger Menu ===== */
html[dir="rtl"] .header__hamburger {
  margin-right: auto;
  margin-left: 0;
}

/* ===== Bootstrap RTL Fixes ===== */
html[dir="rtl"] .text-end {
  text-align: left !important;
}

html[dir="rtl"] .text-start {
  text-align: right !important;
}

html[dir="rtl"] .ms-auto {
  margin-right: auto !important;
  margin-left: 0 !important;
}

html[dir="rtl"] .me-auto {
  margin-left: auto !important;
  margin-right: 0 !important;
}

html[dir="rtl"] .ps-0 {
  padding-right: 0 !important;
  padding-left: initial !important;
}

html[dir="rtl"] .pe-0 {
  padding-left: 0 !important;
  padding-right: initial !important;
}

html[dir="rtl"] .ps-lg-5 {
  padding-right: 3rem !important;
  padding-left: 0 !important;
}

/* ===== Flex Direction Fixes ===== */
html[dir="rtl"] .justify-content-end {
  justify-content: flex-start !important;
}

html[dir="rtl"] .justify-content-start {
  justify-content: flex-end !important;
}

/* ===== Gap and Spacing ===== */
html[dir="rtl"] .gap-2 {
  gap: 0.5rem;
}

html[dir="rtl"] .gap-3 {
  gap: 1rem;
}

/* ===== Icons Flip ===== */
html[dir="rtl"] .fa-arrow-right::before {
  content: "\f060";
}

html[dir="rtl"] .fa-arrow-left::before {
  content: "\f061";
}

html[dir="rtl"] .fa-chevron-right::before {
  content: "\f053";
}

html[dir="rtl"] .fa-chevron-left::before {
  content: "\f054";
}

/* ===== Mobile Menu RTL ===== */
html[dir="rtl"] .mobile-menu {
  text-align: right;
}

html[dir="rtl"] .mean-container .mean-nav ul li a {
  text-align: right;
  padding-right: 0;
  padding-left: 20px;
}

html[dir="rtl"] .mean-container .mean-nav ul li a i {
  float: left;
}

html[dir="rtl"] .mean-container a.meanmenu-reveal {
  left: auto;
  right: 0;
}

/* ===== Animation Fixes ===== */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

/* ===== Responsive RTL Adjustments ===== */

/* Large Screens */
@media (min-width: 1200px) {
  html[dir="rtl"] .main-menu ul li {
    margin-inline-start: 35px;
  }
}

/* Tablet */
@media (max-width: 991px) {
  html[dir="rtl"] .mobile-menu {
    text-align: right;
  }

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

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

  html[dir="rtl"] .offcanvas__info {
    width: 300px;
  }

  html[dir="rtl"] .mean-container .mean-nav ul li a {
    text-align: center;
  }
}

/* Mobile */
@media (max-width: 767px) {
  html[dir="rtl"] .header-bottom-wrapper {
    flex-direction: column;
    text-align: center;
  }

  html[dir="rtl"] .contact-list {
    justify-content: center;
    flex-wrap: wrap;
  }

  html[dir="rtl"] .contact-list li {
    margin: 5px 10px;
  }

  html[dir="rtl"] .flag-wrap {
    justify-content: center;
  }

  html[dir="rtl"] .hero-content {
    text-align: center;
  }

  html[dir="rtl"] .hero-content h1 {
    text-align: center;
  }

  html[dir="rtl"] .hero-button {
    text-align: center;
  }

  html[dir="rtl"] .section-title {
    text-align: center !important;
  }

  html[dir="rtl"] .feature-item {
    text-align: center;
    flex-direction: column;
  }

  html[dir="rtl"] .feature-item .icon {
    margin: 0 auto 15px;
  }

  html[dir="rtl"] .feature-item .content {
    text-align: center;
  }

  html[dir="rtl"] .footer-widget-wrapper .row {
    text-align: center;
  }

  html[dir="rtl"] .single-footer-widget {
    text-align: center;
  }

  html[dir="rtl"] .social-icon {
    justify-content: center;
  }

  html[dir="rtl"] .footer-bottom .footer-wrapper {
    flex-direction: column;
    text-align: center;
  }
}

/* Small Mobile */
@media (max-width: 575px) {
  html[dir="rtl"] .product-wrapper .nav {
    flex-direction: column;
    text-align: center;
  }

  html[dir="rtl"] .product-wrapper .nav .nav-item {
    margin: 5px 0;
  }

  html[dir="rtl"] .back-to-top {
    left: 15px;
  }
}

/* ===== Input and Form Fields ===== */
html[dir="rtl"] input[type="text"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="password"],
html[dir="rtl"] input[type="search"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="number"],
html[dir="rtl"] textarea,
html[dir="rtl"] select {
  text-align: right;
  direction: rtl;
}

html[dir="rtl"] input::placeholder,
html[dir="rtl"] textarea::placeholder {
  text-align: right;
}

/* ===== Star Ratings ===== */
html[dir="rtl"] .star {
  flex-direction: row-reverse;
}

/* ===== Del Price (Strikethrough) ===== */
html[dir="rtl"] h6 del {
  margin-right: 8px;
  margin-left: 0;
}

/* ===== Cart Button ===== */
html[dir="rtl"] .cart-btn .theme-btn i {
  margin-left: 8px;
  margin-right: 0;
}

/* ===== Close Button X ===== */
html[dir="rtl"] .x-mark-icon {
  left: auto;
  right: 15px;
}

html[dir="rtl"] #closeButton {
  left: auto;
  right: 15px;
}
