/* RTL CSS for Farsi/Persian Language Support */

/* Base RTL */
html[dir="rtl"] {
    direction: rtl;
}

/* Font Family */
body, * {
    font-family: 'Vazirmatn', sans-serif !important;
}

/* Fix Bootstrap RTL */
html[dir="rtl"] .me-1 { margin-left: 0.25rem !important; margin-right: 0 !important; }
html[dir="rtl"] .me-2 { margin-left: 0.5rem !important; margin-right: 0 !important; }
html[dir="rtl"] .me-3 { margin-left: 1rem !important; margin-right: 0 !important; }
html[dir="rtl"] .me-4 { margin-left: 1.5rem !important; margin-right: 0 !important; }
html[dir="rtl"] .me-5 { margin-left: 3rem !important; margin-right: 0 !important; }

html[dir="rtl"] .ms-1 { margin-right: 0.25rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ms-2 { margin-right: 0.5rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ms-3 { margin-right: 1rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ms-4 { margin-right: 1.5rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ms-5 { margin-right: 3rem !important; margin-left: 0 !important; }

html[dir="rtl"] .pe-1 { padding-left: 0.25rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pe-2 { padding-left: 0.5rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pe-3 { padding-left: 1rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pe-4 { padding-left: 1.5rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pe-5 { padding-left: 3rem !important; padding-right: 0 !important; }

html[dir="rtl"] .ps-1 { padding-right: 0.25rem !important; padding-left: 0 !important; }
html[dir="rtl"] .ps-2 { padding-right: 0.5rem !important; padding-left: 0 !important; }
html[dir="rtl"] .ps-3 { padding-right: 1rem !important; padding-left: 0 !important; }
html[dir="rtl"] .ps-4 { padding-right: 1.5rem !important; padding-left: 0 !important; }
html[dir="rtl"] .ps-5 { padding-right: 3rem !important; padding-left: 0 !important; }

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

html[dir="rtl"] .float-start { float: right !important; }
html[dir="rtl"] .float-end { float: left !important; }

/* Fix for start/end positions */
html[dir="rtl"] .start-0 { right: 0 !important; left: auto !important; }
html[dir="rtl"] .end-0 { left: 0 !important; right: auto !important; }
html[dir="rtl"] .start-50 { right: 50% !important; left: auto !important; }
html[dir="rtl"] .end-50 { left: 50% !important; right: auto !important; }
html[dir="rtl"] .start-100 { right: 100% !important; left: auto !important; }
html[dir="rtl"] .end-100 { left: 100% !important; right: auto !important; }

/* Navigation & Menu fixes */
html[dir="rtl"] .nav-submenu {
    right: 0;
    left: auto;
}

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

html[dir="rtl"] .dropdown-menu-end {
    right: auto !important;
    left: 0 !important;
}

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

html[dir="rtl"] .mobile-menu.show {
    transform: translateX(0);
}

/* Sidebar fixes */
@media (max-width: 1199px) {
html[dir="rtl"] .dashboard-slidebar {
    border-left: 1px solid #e0e0e0;
    border-right: none;
    transform: translateX(100%);
}
html[dir="rtl"] .dashboard-slidebar.active {
    
    transform: translateX(0);
}
}
/* Form elements */
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
    text-align: right;    
}

html[dir="rtl"] input[type="number"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="email"] {
    direction: ltr;
    text-align: right;
}

/* Icons next to text */
html[dir="rtl"] .icon-text {
    flex-direction: row-reverse;
}

/* Table fixes */
html[dir="rtl"] .table th,
html[dir="rtl"] .table td {
    text-align: right;
}

/* Card fixes */
html[dir="rtl"] .card-header {
    text-align: right;
}

/* Badge position fix */
html[dir="rtl"] .badge {
    margin-right: 0;
    margin-left: 0.25rem;
}

/* Button group */
html[dir="rtl"] .btn-group > .btn:first-child {
    border-radius: 0 0.375rem 0.375rem 0;
}

html[dir="rtl"] .btn-group > .btn:last-child {
    border-radius: 0.375rem 0 0 0.375rem;
}

/* Input group */
html[dir="rtl"] .input-group > .form-control:not(:last-child) {
    border-radius: 0 0.375rem 0.375rem 0;
}

html[dir="rtl"] .input-group > .form-control:not(:first-child) {
    border-radius: 0.375rem 0 0 0.375rem;
}

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

/* Breadcrumb */
html[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    float: right;
    padding-left: 0.5rem;
    padding-right: 0;
    content: "‹";
}

/* Close button position */
html[dir="rtl"] .btn-close {
    margin-left: 0;
    margin-right: auto;
}

/* Modal */
html[dir="rtl"] .modal-header .btn-close {
    margin: -0.5rem auto -0.5rem -0.5rem;
}

/* Progress bar */
html[dir="rtl"] .progress-bar {
    direction: ltr;
}

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

html[dir="rtl"] .page-item:first-child .page-link {
    border-radius: 0 0.375rem 0.375rem 0;
}

html[dir="rtl"] .page-item:last-child .page-link {
    border-radius: 0.375rem 0 0 0.375rem;
}

/* Arrows 
html[dir="rtl"] .ph-arrow-right::before {
    content: "\e900";  
}

html[dir="rtl"] .ph-arrow-left::before {
    content: "\e901";  
}
*/
/* Custom PayOne Template RTL Fixes */
html[dir="rtl"] .tw-pe-5 {
    padding-left: 1.25rem !important;
    padding-right: 0 !important;
}

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

html[dir="rtl"] .tw-me-2,
html[dir="rtl"] .tw-me-4 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

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

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

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

html[dir="rtl"] .inset-inline-start-0 {
    right: 0 !important;
    left: auto !important;
}

html[dir="rtl"] .inset-inline-end-0 {
    left: 0 !important;
    right: auto !important;
}

/* Dashboard sidebar */
html[dir="rtl"] .header-nav-submenu__link {
    text-align: right;
}

html[dir="rtl"] .header-nav-submenu__link i {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Toggle password icon */
html[dir="rtl"] .toggle-password {
    left: 1rem !important;
    right: auto !important;
}

/* Form check */
html[dir="rtl"] .form-check {
    padding-right: 1.5em;
    padding-left: 0;
}

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

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

/* Price display */
.price-display {
    direction: ltr;
    display: inline-block;
}

/* Persian number font feature */
.persian-number {
    font-feature-settings: "ss01";
}

/* Gap RTL fix */
html[dir="rtl"] .tw-gap-2,
html[dir="rtl"] .tw-gap-3,
html[dir="rtl"] .tw-gap-4,
html[dir="rtl"] .tw-gap-6 {
    flex-direction: row;
}

/* Header item RTL */
html[dir="rtl"] .header-item-link {
    direction: rtl;
}

/* Swiper RTL */
html[dir="rtl"] .swiper {
    direction: ltr;
}

html[dir="rtl"] .swiper-slide {
    direction: rtl;
}

/* Product card */
.product-card {
    text-align: right;
}

.product-card .product-price {
    direction: ltr;
    text-align: right;
}

/* Toast notifications */
html[dir="rtl"] #toast-container {
    right: auto;
    left: 1rem;
}

/* Fix for translate-middle */
html[dir="rtl"] .translate-middle-x {
    transform: translateX(50%) !important;
}

/* Custom utility classes for RTL */
.rtl-flip {
    transform: scaleX(-1);
}

.ltr-only {
    direction: ltr;
    text-align: left;
}

.rtl-only {
    direction: rtl;
    text-align: right;
}

/* Number inputs always LTR */
input[type="number"],
input[type="tel"],
.phone-input,
.price-input {
    direction: ltr;
    text-align: right;
}

/* Currency symbol */
.currency-symbol {
    margin-left: 0.25rem;
}

/* Fix animation directions */
html[dir="rtl"] .animation-moveTopBottom__two,
html[dir="rtl"] .animation-rotation__two {
    /* Keep animations as-is */
}

/* Scroll to top */
html[dir="rtl"] .progress-wrap {
    left: 30px;
    right: auto;
}

/* Custom cursor */
html[dir="rtl"] .cursor,
html[dir="rtl"] .dot {
    /* Keep cursor position calculations */
}
.btn-sm{
    padding: 5px 11px;
}

.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){
    border: var(--bs-btn-border-width) solid var(--bs-btn-border-color);
    border-radius: var(--bs-btn-border-radius);     
    margin-right: calc(var(--bs-border-width) * -1);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.tw-px-4{
     
}