/*
Theme Name: WhiteStudio RTL
Theme URI: https://whitestudio.team
Author: WhiteStudio Team
Author URI: https://whitestudio.team
Description: RTL (Right-to-Left) styles for WhiteStudio theme. Optimized for Arabic, Persian, Hebrew and other RTL languages.
Version: 1.0.6
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: whitestudio

WhiteStudio WordPress Theme RTL Support, Copyright 2024 WhiteStudio Team
WhiteStudio RTL is distributed under the terms of the GNU GPL
*/

/* =============================================================================
   RTL DIRECTION AND BASE STYLING - Only when RTL is active
   ============================================================================= */

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

/* Font families optimized for RTL languages */
[dir="rtl"] body,
[dir="rtl"] button,
[dir="rtl"] input,
[dir="rtl"] select,
[dir="rtl"] optgroup,
[dir="rtl"] textarea,
body.rtl,
body.rtl button,
body.rtl input,
body.rtl select,
body.rtl optgroup,
body.rtl textarea,
html[dir="rtl"] body,
html[dir="rtl"] button,
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] optgroup,
html[dir="rtl"] textarea {
    font-family: "Vazirmatn", "Noto Sans Arabic", "Tahoma", "Arial", "Segoe UI", sans-serif !important;
}

/* =============================================================================
   DIRECTIONAL PROPERTIES CONVERSION - Left becomes Right and vice versa
   ============================================================================= */

/* Smart-scroll navigation bar */
[dir="rtl"] .smart-scroll,
body.rtl .smart-scroll,
html[dir="rtl"] .smart-scroll {
    right: 0;
    left: 0;
}

/* Navigation Links */
[dir="rtl"] .nav-link,
body.rtl .nav-link,
html[dir="rtl"] .nav-link {
    padding-right: 1rem !important;
    padding-left: 1rem !important;
}

/* Header background positioning */
[dir="rtl"] .header-bg,
body.rtl .header-bg,
html[dir="rtl"] .header-bg {
    left: -300px;
    right: auto;
}

/* Button margin adjustments */
[dir="rtl"] .header .btn-lg,
body.rtl .header .btn-lg,
html[dir="rtl"] .header .btn-lg {
    margin: 0 0 10px 10px;
}

/* Button padding */
[dir="rtl"] .btn,
body.rtl .btn,
html[dir="rtl"] .btn {
    padding-right: 1.5rem;
    padding-left: 1.5rem;
}

/* Section title positioning */
[dir="rtl"] .section-title h2::before,
body.rtl .section-title h2::before,
html[dir="rtl"] .section-title h2::before {
    right: calc(50% - 60px);
    left: auto;
}

[dir="rtl"] .section-title h2::after,
body.rtl .section-title h2::after,
html[dir="rtl"] .section-title h2::after {
    right: calc(50% - 100px);
    left: auto;
}

/* Callout borders */
[dir="rtl"] .bd-callout,
body.rtl .bd-callout,
html[dir="rtl"] .bd-callout {
    border-right: 0.25rem solid #dfdff2;
    border-left: none;
}

[dir="rtl"] .bd-callout-pink,
body.rtl .bd-callout-pink,
html[dir="rtl"] .bd-callout-pink {
    border-right-color: #ff4b93 !important;
    border-left: none;
}

/* Price list hover effects */
[dir="rtl"] #price li:hover,
body.rtl #price li:hover,
html[dir="rtl"] #price li:hover {
    padding-right: 10px;
    padding-left: 0;
}

/* Card text icons */
[dir="rtl"] #price .card-text i,
body.rtl #price .card-text i,
html[dir="rtl"] #price .card-text i {
    margin-left: 8px;
    margin-right: 0;
}

/* Price card positioning */
[dir="rtl"] #price .card::before,
body.rtl #price .card::before,
html[dir="rtl"] #price .card::before {
    right: 0;
    left: 0;
}

/* Pro support card positioning */
[dir="rtl"] #price .pro-support h3::after,
body.rtl #price .pro-support h3::after,
html[dir="rtl"] #price .pro-support h3::after {
    left: 20px;
    right: auto;
}



/* Guarantee text */
[dir="rtl"] .pricing-details .guarantee,
body.rtl .pricing-details .guarantee,
html[dir="rtl"] .pricing-details .guarantee {
    padding-right: 25px;
    padding-left: 0;
}

[dir="rtl"] .pricing-details .guarantee::before,
body.rtl .pricing-details .guarantee::before,
html[dir="rtl"] .pricing-details .guarantee::before {
    right: 0;
    left: auto;
}

/* Register section */
[dir="rtl"] .register h3,
[dir="rtl"] .register h4,
body.rtl .register h3,
body.rtl .register h4,
html[dir="rtl"] .register h3,
html[dir="rtl"] .register h4 {
    margin: 10px 10px 0 0 !important;
}

[dir="rtl"] .register p,
body.rtl .register p,
html[dir="rtl"] .register p {
    padding: 0 80px 10px 0;
}

[dir="rtl"] .register .card .card-title,
body.rtl .register .card .card-title,
html[dir="rtl"] .register .card .card-title {
    text-align: right;
}

[dir="rtl"] .register .icon,
body.rtl .register .icon,
html[dir="rtl"] .register .icon {
    float: right;
}

/* Footer */
[dir="rtl"] .footer .logo,
body.rtl .footer .logo,
html[dir="rtl"] .footer .logo {
    margin: -5px 0 0 10px !important;
}

[dir="rtl"] .footer .nav-link,
body.rtl .footer .nav-link,
html[dir="rtl"] .footer .nav-link {
    padding-left: 1rem !important;
    padding-right: 0 !important;
}

[dir="rtl"] .footer .btn-light,
body.rtl .footer .btn-light,
html[dir="rtl"] .footer .btn-light {
    padding-left: 10px;
    padding-right: 10px;
}

/* Mobile responsive adjustments */
@media (max-width: 992px) {
    [dir="rtl"] .nav-link,
    body.rtl .nav-link,
    html[dir="rtl"] .nav-link {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* =============================================================================
   BOOTSTRAP RTL OVERRIDES
   ============================================================================= */

/* Bootstrap margin utilities reversed for RTL */
[dir="rtl"] .me-1,
body.rtl .me-1,
html[dir="rtl"] .me-1 { margin-right: 0.25rem !important; margin-left: 0 !important; }

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

[dir="rtl"] .me-3,
body.rtl .me-3,
html[dir="rtl"] .me-3 { margin-right: 1rem !important; margin-left: 0 !important; }

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

[dir="rtl"] .me-5,
body.rtl .me-5,
html[dir="rtl"] .me-5 { margin-right: 3rem !important; margin-left: 0 !important; }

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

[dir="rtl"] .ms-1,
body.rtl .ms-1,
html[dir="rtl"] .ms-1 { margin-left: 0.25rem !important; margin-right: 0 !important; }

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

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

[dir="rtl"] .ms-4,
body.rtl .ms-4,
html[dir="rtl"] .ms-4 { margin-left: 1.5rem !important; margin-right: 0 !important; }

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

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

/* Bootstrap padding utilities reversed for RTL */
[dir="rtl"] .pe-1,
body.rtl .pe-1,
html[dir="rtl"] .pe-1 { padding-right: 0.25rem !important; padding-left: 0 !important; }

[dir="rtl"] .pe-2,
body.rtl .pe-2,
html[dir="rtl"] .pe-2 { padding-right: 0.5rem !important; padding-left: 0 !important; }

[dir="rtl"] .pe-3,
body.rtl .pe-3,
html[dir="rtl"] .pe-3 { padding-right: 1rem !important; padding-left: 0 !important; }

[dir="rtl"] .pe-4,
body.rtl .pe-4,
html[dir="rtl"] .pe-4 { padding-right: 1.5rem !important; padding-left: 0 !important; }

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

[dir="rtl"] .ps-1,
body.rtl .ps-1,
html[dir="rtl"] .ps-1 { padding-left: 0.25rem !important; padding-right: 0 !important; }

[dir="rtl"] .ps-2,
body.rtl .ps-2,
html[dir="rtl"] .ps-2 { padding-left: 0.5rem !important; padding-right: 0 !important; }

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

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

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

/* Bootstrap positioning utilities */
[dir="rtl"] .start-0,
body.rtl .start-0,
html[dir="rtl"] .start-0 { right: 0 !important; left: auto !important; }

[dir="rtl"] .start-50,
body.rtl .start-50,
html[dir="rtl"] .start-50 { right: 50% !important; left: auto !important; }

[dir="rtl"] .start-100,
body.rtl .start-100,
html[dir="rtl"] .start-100 { right: 100% !important; left: auto !important; }

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

[dir="rtl"] .end-50,
body.rtl .end-50,
html[dir="rtl"] .end-50 { left: 50% !important; right: auto !important; }

[dir="rtl"] .end-100,
body.rtl .end-100,
html[dir="rtl"] .end-100 { left: 100% !important; right: auto !important; }

/* Text alignment */
[dir="rtl"] .text-start,
body.rtl .text-start,
html[dir="rtl"] .text-start { text-align: right !important; }

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

/* Float adjustments */
[dir="rtl"] .float-start,
body.rtl .float-start,
html[dir="rtl"] .float-start { float: right !important; }

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

/* =============================================================================
   NAVIGATION AND DROPDOWN MENUS
   ============================================================================= */

/* Navbar brand positioning */
[dir="rtl"] .navbar-brand,
body.rtl .navbar-brand,
html[dir="rtl"] .navbar-brand {
    margin-left: auto;
    margin-right: 0;
}

/* Dropdown menus */
[dir="rtl"] .dropdown-menu,
body.rtl .dropdown-menu,
html[dir="rtl"] .dropdown-menu {
    right: 0;
    left: auto;
    text-align: right;
}

[dir="rtl"] .dropdown-item,
body.rtl .dropdown-item,
html[dir="rtl"] .dropdown-item {
    text-align: right;
    padding: 0.375rem 1.5rem 0.375rem 1rem;
}

/* Menu icons */
[dir="rtl"] .navbar-nav .nav-link i,
body.rtl .navbar-nav .nav-link i,
html[dir="rtl"] .navbar-nav .nav-link i {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* =============================================================================
   CAROUSEL AND CONTROLS
   ============================================================================= */

/* Breadcrumbs */
[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before,
body.rtl .breadcrumb-item + .breadcrumb-item::before,
html[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    content: "\\";
    transform: scaleX(-1);
}

/* Carousel controls */
[dir="rtl"] .carousel-control-prev,
body.rtl .carousel-control-prev,
html[dir="rtl"] .carousel-control-prev {
    right: 0;
    left: auto;
}

[dir="rtl"] .carousel-control-next,
body.rtl .carousel-control-next,
html[dir="rtl"] .carousel-control-next {
    left: 0;
    right: auto;
}

[dir="rtl"] .carousel-control-prev-icon,
body.rtl .carousel-control-prev-icon,
html[dir="rtl"] .carousel-control-prev-icon {
    transform: rotate(180deg);
}

[dir="rtl"] .carousel-control-next-icon,
body.rtl .carousel-control-next-icon,
html[dir="rtl"] .carousel-control-next-icon {
    transform: rotate(180deg);
}

/* =============================================================================
   BORDER RADIUS ADJUSTMENTS
   ============================================================================= */

[dir="rtl"] .rounded-start,
body.rtl .rounded-start,
html[dir="rtl"] .rounded-start {
    border-top-right-radius: var(--bs-border-radius) !important;
    border-bottom-right-radius: var(--bs-border-radius) !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

[dir="rtl"] .rounded-end,
body.rtl .rounded-end,
html[dir="rtl"] .rounded-end {
    border-top-left-radius: var(--bs-border-radius) !important;
    border-bottom-left-radius: var(--bs-border-radius) !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

[dir="rtl"] .dropdown-item,
body.rtl .dropdown-item,
html[dir="rtl"] .dropdown-item {
    text-align: right;
    padding: 0.375rem 1rem 0.375rem 1.5rem;
}

/* Menu icons - RTL only */
[dir="rtl"] .navbar-nav .nav-link i,
body.rtl .navbar-nav .nav-link i,
html[dir="rtl"] .navbar-nav .nav-link i {
    margin-left: 0.5rem;
    margin-right: 0;
}
/* Breadcrumbs RTL */
.breadcrumb-item + .breadcrumb-item::before {
    content: "\\";
    transform: scaleX(-1);
}

/* Carousel controls RTL */
.carousel-control-prev {
    right: 0;
    left: auto;
}

.carousel-control-next {
    left: 0;
    right: auto;
}

.carousel-control-prev-icon {
    transform: rotate(180deg);
}

.carousel-control-next-icon {
    transform: rotate(180deg);
}
/* =============================================================================
   LAYOUT AND SPACING RTL ADJUSTMENTS
   ============================================================================= */

/* Complete Bootstrap margin/padding RTL fixes */
.me-1 { margin-left: 0.25rem !important; margin-right: 0 !important; }
.me-2 { margin-left: 0.5rem !important; margin-right: 0 !important; }
.me-3 { margin-left: 1rem !important; margin-right: 0 !important; }
.me-4 { margin-left: 1.5rem !important; margin-right: 0 !important; }
.me-5 { margin-left: 3rem !important; margin-right: 0 !important; }
.me-auto { margin-left: auto !important; margin-right: 0 !important; }

.ms-1 { margin-right: 0.25rem !important; margin-left: 0 !important; }
.ms-2 { margin-right: 0.5rem !important; margin-left: 0 !important; }
.ms-3 { margin-right: 1rem !important; margin-left: 0 !important; }
.ms-4 { margin-right: 1.5rem !important; margin-left: 0 !important; }
.ms-5 { margin-right: 3rem !important; margin-left: 0 !important; }
.ms-auto { margin-right: auto !important; margin-left: 0 !important; }

/* Padding RTL fixes */
.pe-1 { padding-left: 0.25rem !important; padding-right: 0 !important; }
.pe-2 { padding-left: 0.5rem !important; padding-right: 0 !important; }
.pe-3 { padding-left: 1rem !important; padding-right: 0 !important; }
.pe-4 { padding-left: 1.5rem !important; padding-right: 0 !important; }
.pe-5 { padding-left: 3rem !important; padding-right: 0 !important; }

.ps-1 { padding-right: 0.25rem !important; padding-left: 0 !important; }
.ps-2 { padding-right: 0.5rem !important; padding-left: 0 !important; }
.ps-3 { padding-right: 1rem !important; padding-left: 0 !important; }
.ps-4 { padding-right: 1.5rem !important; padding-left: 0 !important; }
.ps-5 { padding-right: 3rem !important; padding-left: 0 !important; }

/* Border radius RTL adjustments */
.rounded-start {
    border-top-right-radius: var(--bs-border-radius) !important;
    border-bottom-right-radius: var(--bs-border-radius) !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
.rounded-end {
    border-top-left-radius: var(--bs-border-radius) !important;
    border-bottom-left-radius: var(--bs-border-radius) !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Position RTL fixes */
.start-0 { right: 0 !important; left: auto !important; }
.start-50 { right: 50% !important; left: auto !important; }
.start-100 { right: 100% !important; left: auto !important; }
.end-0 { left: 0 !important; right: auto !important; }
.end-50 { left: 50% !important; right: auto !important; }
.end-100 { left: 100% !important; right: auto !important; }

/* Text alignment */
.text-start { text-align: right !important; }
.text-end { text-align: left !important; }

/* Float adjustments */
.float-start { float: right !important; }
.float-end { float: left !important; }

/* =============================================================================
   FLEXBOX AND GRID RTL ADJUSTMENTS
   ============================================================================= */

/* Flexbox direction adjustments */
.flex-row-reverse { flex-direction: row !important; }
.flex-row { flex-direction: row-reverse !important; }

/* Justify content RTL */
.justify-content-start { justify-content: flex-end !important; }
.justify-content-end { justify-content: flex-start !important; }

/* Align items RTL - stays same but text direction matters */
.text-start { text-align: right !important; }
.text-end { text-align: left !important; }

/* Bootstrap columns RTL - automatic in most cases but ensuring proper behavior */
.offset-1 { margin-right: 8.33333% !important; margin-left: 0 !important; }
.offset-2 { margin-right: 16.66667% !important; margin-left: 0 !important; }
.offset-3 { margin-right: 25% !important; margin-left: 0 !important; }
.offset-4 { margin-right: 33.33333% !important; margin-left: 0 !important; }
.offset-5 { margin-right: 41.66667% !important; margin-left: 0 !important; }
.offset-6 { margin-right: 50% !important; margin-left: 0 !important; }

/* =============================================================================
   NAVIGATION AND MENU ENHANCED RTL
   ============================================================================= */

/* Enhanced navbar RTL */
.navbar {
    direction: rtl;
}

/* Navbar-specific RTL only for RTL languages */
[dir="rtl"] .navbar,
body.rtl .navbar,
html[dir="rtl"] .navbar {
    direction: rtl;
}

/* =============================================================================
   HEADER AND HERO SECTION RTL
   ============================================================================= */

.header-bg {
    left: -300px;
    right: auto;
}

.header h1, .header h2, .header h3 {
    text-align: right;
}

/* Buttons in header */
.header .btn-lg {
    margin: 0 0 10px 10px;
}

/* =============================================================================
   CARDS AND WIDGETS ENHANCED RTL STYLING
   ============================================================================= */

/* Card headers RTL */
.card-header {
    text-align: right;
}

.card-title {
    text-align: right;
}

.card-text {
    text-align: right;
}

/* Alert RTL */
.alert {
    text-align: right;
}

.alert-dismissible .btn-close {
    left: 0;
    right: auto;
}

/* Badge positioning */
.badge {
    margin-left: 0.25rem;
    margin-right: 0;
}

/* Modal RTL */
.modal-header {
    text-align: right;
}

.modal-header .btn-close {
    margin: -0.5rem 0 -0.5rem auto;
}

.modal-title {
    text-align: right;
}

.modal-body {
    text-align: right;
}

.modal-footer {
    text-align: left; /* buttons typically align left in RTL */
}

/* Review cards RTL */
.review-card-header {
    flex-direction: row-reverse;
}

.review-card-rating {
    margin-left: auto;
    margin-right: 0;
}

.verified-badge {
    margin-right: auto;
    margin-left: 0;
}

.author-avatar {
    margin-left: 0.75rem;
    margin-right: 0;
}

.review-full-link {
    text-align: right;
}

.review-full-link i:last-child {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* =============================================================================
   ENHANCED FORMS RTL STYLING
   ============================================================================= */

/* Form controls */
.form-control, .form-select {
    text-align: right;
    direction: rtl;
}

/* Form labels */
.form-label {
    text-align: right;
}

/* Input groups RTL */
.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-right: 10px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-text {
    border-left: 0;
    border-right: 1px solid #dee2e6;
}

/* Input group prepend/append RTL */
.input-group > .form-control:first-child,
.input-group > .form-select:first-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > .form-control:last-child,
.input-group > .form-select:last-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Floating labels RTL */
.form-floating > .form-control,
.form-floating > .form-select {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.form-floating > label {
    right: 0;
    left: auto;
    padding-right: 0.75rem;
    padding-left: 0;
    transform-origin: 100% 0;
}

/* Form validation RTL */
.valid-feedback {
    text-align: right;
}

.invalid-feedback {
    text-align: right;
}

/* Checkboxes and radios */
.form-check {
    padding-right: 1.5em;
    padding-left: 0;
    text-align: right;
}

.form-check-input {
    margin-right: -1.5em;
    margin-left: 0;
}

.form-check-label {
    padding-right: 0.5rem;
    padding-left: 0;
}

/* =============================================================================
   TABLE AND LIST ENHANCED RTL
   ============================================================================= */

/* Table RTL styling */
.table {
    text-align: right;
}

.table th {
    text-align: right;
    border-left: none;
    border-right: 1px solid #dee2e6;
}

.table td {
    text-align: right;
    border-left: none;
    border-right: 1px solid #dee2e6;
}

/* Table responsive RTL */
.table-responsive {
    direction: rtl;
}

/* List group RTL */
.list-group-item {
    text-align: right;
}

.list-group-item-action {
    text-align: right;
}

/* Nav pills/tabs RTL */
.nav-pills .nav-link {
    text-align: right;
}

.nav-tabs .nav-link {
    text-align: right;
}

/* Dropdown in nav */
.nav-item.dropdown .dropdown-menu {
    right: 0;
    left: auto;
}

/* =============================================================================
   ENHANCED PRICING TABLES RTL
   ============================================================================= */

/* Pricing cards */
#price .pro-support h3::after {
    left: 20px;
    right: auto;
}

#price li:hover {
    padding-right: 10px;
    padding-left: 0;
}

#price .card-text i {
    margin-left: 8px;
    margin-right: 0;
}

/* =============================================================================
   FOOTER RTL STYLING - Only for RTL languages
   ============================================================================= */

[dir="rtl"] .footer .nav-link,
body.rtl .footer .nav-link,
html[dir="rtl"] .footer .nav-link {
    padding-left: 1rem !important;
    padding-right: 0 !important;
}

[dir="rtl"] .footer .logo,
body.rtl .footer .logo,
html[dir="rtl"] .footer .logo {
    margin: -5px 0 0 10px !important;
}

[dir="rtl"] .footer .btn-light,
body.rtl .footer .btn-light,
html[dir="rtl"] .footer .btn-light {
    padding-left: 10px;
    padding-right: 10px;
}

/* =============================================================================
   ICONS AND SPECIAL ELEMENTS
   ============================================================================= */

/* Icon adjustments - flip horizontally for RTL */
.bi-arrow-right::before {
    content: "\f124"; /* arrow-left icon */
}

.bi-arrow-left::before {
    content: "\f13d"; /* arrow-right icon */
}

/* =============================================================================
   RESPONSIVE RTL ADJUSTMENTS - Only for RTL
   ============================================================================= */

@media (max-width: 992px) {
    [dir="rtl"] .navbar-toggler,
    body.rtl .navbar-toggler,
    html[dir="rtl"] .navbar-toggler {
        margin-left: auto;
        margin-right: 0;
    }

    [dir="rtl"] .navbar-collapse,
    body.rtl .navbar-collapse,
    html[dir="rtl"] .navbar-collapse {
        text-align: right;
    }

    [dir="rtl"] .header-bg,
    body.rtl .header-bg,
    html[dir="rtl"] .header-bg {
        left: 0;
        right: auto;
    }
}

@media (max-width: 768px) {
    [dir="rtl"] #price .pro-support h3::after,
    body.rtl #price .pro-support h3::after,
    html[dir="rtl"] #price .pro-support h3::after {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 576px) {
    [dir="rtl"] .header-bg,
    body.rtl .header-bg,
    html[dir="rtl"] .header-bg {
        left: 0;
        right: auto;
    }
}

/* =============================================================================
   PLUGIN SPECIFIC RTL STYLES
   ============================================================================= */

/* Plugin icons */
.plugin .icon {
    margin-left: 20px;
    margin-right: 0;
}

/* Register section */
.register .icon {
    float: right;
}

.register p {
    padding: 0 80px 10px 0;
}

.register h3, .register h4 {
    margin: 10px 10px 0 0 !important;
}

/* Team section */
.team .pic img {
    margin-top: -75px;
}

.team .social .btn {
    margin: 0 0 0 5px;
}

/* =============================================================================
   TOOLTIP AND POPOVER RTL
   ============================================================================= */

/* Tooltip RTL */
.tooltip {
    direction: rtl;
}

.tooltip-inner {
    text-align: right;
}

/* Popover RTL */
.popover {
    direction: rtl;
}

.popover-header {
    text-align: right;
}

.popover-body {
    text-align: right;
}

/* Toast RTL */
.toast {
    text-align: right;
}

.toast-header {
    text-align: right;
}

.toast-body {
    text-align: right;
}

/* =============================================================================
   ENHANCED WORDPRESS BLOCK EDITOR RTL SUPPORT
   ============================================================================= */

/* Gutenberg blocks RTL */
.wp-block-button .wp-block-button__link {
    text-align: center;
}

.wp-block-quote {
    border-right: 0.25rem solid #652eba;
    border-left: none;
    padding-right: 1rem;
    padding-left: 0;
}

.wp-block-pullquote {
    text-align: right;
}

/* List blocks */
.wp-block-list {
    padding-right: 1.5rem;
    padding-left: 0;
}

/* Gallery blocks */
.wp-block-gallery {
    text-align: right;
}

/* Column blocks RTL */
.wp-block-columns {
    direction: rtl;
}

.wp-block-column {
    text-align: right;
}

/* Group blocks */
.wp-block-group {
    text-align: right;
}

/* Media & Text block */
.wp-block-media-text {
    direction: rtl;
}

.wp-block-media-text__content {
    text-align: right;
}

/* Cover block */
.wp-block-cover {
    text-align: right;
}

/* Heading blocks */
.wp-block-heading {
    text-align: right;
}

/* Paragraph blocks */
.wp-block-paragraph {
    text-align: right;
}

/* Separator block */
.wp-block-separator {
    text-align: center;
}

/* Spacer - no changes needed */

/* Embed blocks */
.wp-block-embed {
    text-align: center;
}

/* Table block */
.wp-block-table {
    text-align: right;
}

.wp-block-table table {
    text-align: right;
}

/* Latest posts block */
.wp-block-latest-posts {
    text-align: right;
}

.wp-block-latest-posts__post-title {
    text-align: right;
}

/* Search block */
.wp-block-search {
    text-align: right;
}

.wp-block-search__input {
    text-align: right;
}

/* Categories block */
.wp-block-categories {
    text-align: right;
}

/* Archives block */
.wp-block-archives {
    text-align: right;
}

/* =============================================================================
   ANIMATIONS AND TRANSITIONS RTL
   ============================================================================= */

/* Slide animations RTL */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Fade slide RTL */
@keyframes fadeSlideRight {
    from {
        transform: translateX(30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeSlideLeft {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Button hover effects RTL */
.btn:hover {
    transform: translateY(-1px);
}

/* Card hover effects RTL */
.card:hover {
    transform: translateY(-3px);
    transition: all 0.3s ease;
}

/* =============================================================================
   ENHANCED COMMENT SECTION RTL
   ============================================================================= */

.comment-list {
    padding-right: 0;
    padding-left: 0;
}

.comment .children {
    padding-right: 2rem;
    padding-left: 0;
}

.comment-author {
    text-align: right;
}

.comment-metadata {
    text-align: right;
}

.reply {
    text-align: right;
}

/* =============================================================================
   SEARCH AND PAGINATION RTL - Only for RTL
   ============================================================================= */

/* Search form */
[dir="rtl"] .search-form,
body.rtl .search-form,
html[dir="rtl"] .search-form {
    direction: rtl;
}

[dir="rtl"] .search-field,
body.rtl .search-field,
html[dir="rtl"] .search-field {
    text-align: right;
    padding-right: 1rem;
    padding-left: 2.5rem;
}

[dir="rtl"] .search-submit,
body.rtl .search-submit,
html[dir="rtl"] .search-submit {
    right: auto;
    left: 0.5rem;
}

/* Pagination */
[dir="rtl"] .nav-links,
body.rtl .nav-links,
html[dir="rtl"] .nav-links {
    text-align: center;
}

[dir="rtl"] .nav-previous,
body.rtl .nav-previous,
html[dir="rtl"] .nav-previous {
    float: right;
}

[dir="rtl"] .nav-next,
body.rtl .nav-next,
html[dir="rtl"] .nav-next {
    float: left;
}

/* =============================================================================
   ENHANCED UTILITIES AND HELPER CLASSES
   ============================================================================= */

/* RTL specific utilities */
.rtl-text-right { text-align: right !important; }
.rtl-text-left { text-align: left !important; }
.rtl-float-right { float: right !important; }
.rtl-float-left { float: left !important; }
.rtl-margin-right { margin-right: 1rem !important; }
.rtl-margin-left { margin-left: 1rem !important; }
.rtl-padding-right { padding-right: 1rem !important; }
.rtl-padding-left { padding-left: 1rem !important; }

/* Direction utilities */
.dir-rtl { direction: rtl !important; }
.dir-ltr { direction: ltr !important; }

/* Text transform for RTL languages */
.text-uppercase-rtl { text-transform: none !important; } /* Disable for Arabic/Persian */
.text-lowercase-rtl { text-transform: none !important; } /* Disable for Arabic/Persian */

/* Word spacing for better readability */
.word-spacing-normal { word-spacing: normal !important; }
.word-spacing-wide { word-spacing: 0.1em !important; }

/* Letter spacing adjustments */
.letter-spacing-tight { letter-spacing: -0.02em !important; }
.letter-spacing-normal { letter-spacing: normal !important; }
.letter-spacing-wide { letter-spacing: 0.02em !important; }

/* Clear floats */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* =============================================================================
   CUSTOM RTL IMPROVEMENTS - Only for RTL languages
   ============================================================================= */

/* Better line height for RTL languages */
[dir="rtl"] body,
body.rtl,
html[dir="rtl"] body {
    line-height: 1.8;
}

/* Improved spacing for RTL text */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6,
body.rtl h1, body.rtl h2, body.rtl h3, body.rtl h4, body.rtl h5, body.rtl h6,
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6 {
    letter-spacing: -0.02em;
}

/* Better button spacing */
[dir="rtl"] .btn,
body.rtl .btn,
html[dir="rtl"] .btn {
    letter-spacing: 0.02em;
}

/* Improved form spacing */
[dir="rtl"] .form-control,
body.rtl .form-control,
html[dir="rtl"] .form-control {
    letter-spacing: 0.01em;
}

/* Better table alignment */
[dir="rtl"] table,
body.rtl table,
html[dir="rtl"] table {
    text-align: right;
}

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

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

/* =============================================================================
   ACCESSIBILITY IMPROVEMENTS FOR RTL
   ============================================================================= */

/* Focus indicators for RTL */
a:focus,
button:focus,
.btn:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #652eba;
    outline-offset: 2px;
}

/* Screen reader improvements */
.sr-only-rtl {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* =============================================================================
   END OF RTL STYLESHEET
   ============================================================================= */
