/* RTL Support for Arabic Language */

/* Basic RTL Layout */
[dir="rtl"] {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Arial Unicode MS';
}

/* Navigation RTL */
[dir="rtl"] .nav-icon {
    flex-direction: row-reverse;
}

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

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

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

[dir="rtl"] .tf-languages select {
    text-align: right;
}

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

[dir="rtl"] .hero-title,
[dir="rtl"] .hero-subtitle {
    text-align: right;
}

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

[dir="rtl"] .tf-btn .icon {
    margin-right: 0;
    margin-left: 8px;
}

/* Categories RTL */
[dir="rtl"] .categories-wrapper .swiper-wrapper {
    flex-direction: row-reverse;
}

[dir="rtl"] .category-card {
    text-align: right;
}

/* Products RTL */
[dir="rtl"] .card-product-info {
    text-align: right;
}

[dir="rtl"] .list-product-btn {
    left: 15px;
    right: auto;
}

/* Cart RTL */
[dir="rtl"] .nav-cart {
    order: -1;
}

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

/* Footer RTL */
[dir="rtl"] .footer-content {
    text-align: right;
}

/* Swiper RTL */
[dir="rtl"] .swiper-button-next {
    left: 10px;
    right: auto;
}

[dir="rtl"] .swiper-button-prev {
    right: 10px;
    left: auto;
}

/* Form RTL */
[dir="rtl"] .tf-field-input {
    text-align: right;
    padding-right: 15px;
    padding-left: 15px;
}

[dir="rtl"] .tf-field-label {
    right: 15px;
    left: auto;
}

/* Mobile Menu RTL */
[dir="rtl"] .offcanvas-start {
    right: 0;
    left: auto;
    transform: translateX(100%);
}

[dir="rtl"] .offcanvas-start.show {
    transform: translateX(0);
}

/* Toolbar RTL */
[dir="rtl"] .tf-toolbar-bottom {
    flex-direction: row-reverse;
}

/* Search RTL */
[dir="rtl"] .tf-search-sticky input {
    text-align: right;
    padding-right: 50px;
    padding-left: 15px;
}

[dir="rtl"] .tf-search-sticky button {
    left: 15px;
    right: auto;
}

/* Announcement Bar RTL */
[dir="rtl"] .announcement-bar .close-announcement-bar {
    left: 0;
    right: auto;
}

/* Language Switcher Specific */
.language-switch {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: color 0.3s ease;
}

.lang-label.active {
    color: #4CAF50;
    font-weight: 600;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:focus + .slider {
    box-shadow: 0 0 1px #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.language-switcher {
    display: inline-block;
}

.language-switcher .tf-languages select {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 14px;
    cursor: pointer;
    min-width: 80px;
}

.language-switcher .tf-languages select:focus {
    outline: none;
}

/* Arabic Font Improvements */
[dir="rtl"] {
    font-family: 'Segoe UI', 'Tahoma', 'Arial Unicode MS', sans-serif;
    line-height: 1.6;
}

[dir="rtl"] .hero-title {
    font-weight: 600;
}

[dir="rtl"] .section-title {
    font-weight: 600;
}

/* Responsive RTL */
@media (max-width: 768px) {
    [dir="rtl"] .hero-content {
        text-align: center !important;
    }
    
    [dir="rtl"] .section-header {
        text-align: center;
    }
    
    [dir="rtl"] .tf-field-input {
        text-align: right;
    }
}