/*
Theme Name: Mednix
Description: RTL Stylesheet for Mednix - Comprehensive Overrides
Version: 1.2
Text Domain: mednix
*/

/* Import Cairo Font */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;500;600;700;800;900&display=swap');

/* =========================================
   1. Global Direction & Typography
   ========================================= */
html, body {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', sans-serif !important;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, p, a, span, li, input, textarea, button, select {
    font-family: 'Cairo', sans-serif !important;
    letter-spacing: normal !important; /* Fix letter spacing for Arabic */
}


/* Header Number Fix */
.header-number {
    flex-direction: row-reverse; /* Text on Right, Icon on Left */
    text-align: right;
}

/* Fix text direction for English content in RTL (e.g. "Emergency Call:") */
.header-number span, 
.header-number a {
    direction: ltr; 
    unicode-bidi: embed;
}

.header-number svg {
    transform: scaleX(-1); /* Flip phone icon */
    margin-left: 15px !important; /* Space between Icon (right) and Text (left) */
    margin-right: 0 !important; /* Reset LTR margin */
}
.header-number div {
    text-align: right;
}

/* Helper Utilities Flip */
.text-start { text-align: right !important; }
.text-end { text-align: left !important; }
.float-start, .float-left { float: right !important; }
.float-end, .float-right { float: left !important; }
.ms-auto { margin-right: auto !important; margin-left: 0 !important; }
.me-auto { margin-left: auto !important; margin-right: 0 !important; }
.ms-0 { margin-right: 0 !important; }
.me-0 { margin-left: 0 !important; }
.ps-0 { padding-right: 0 !important; }
.pe-0 { padding-left: 0 !important; }

/* =========================================
   2. Header & Navigation
   ========================================= */
.navbar-brand.logo {
    margin-right: 0;
    margin-left: 70px;
}

.main-nav ul.sub-menu {
    left: auto;
    right: 0;
    text-align: right;
}

.main-nav ul.sub-menu li ul {
    left: auto !important;
    right: 100% !important;
}

.sub-menu-toggle {
    right: auto;
    left: 0;
}

.main-nav .sub-menu .sub-menu-toggle {
    right: auto;
    left: 10px;
}

.main-nav .sub-menu li a:after {
    left: auto;
    right: 0;
}

/* Header Top Info */
.header-top-info li i {
    margin-right: 0;
    margin-left: 8px;
}
.header-top-info li {
    margin-right: 0;
    margin-left: 20px;
    border-right: none;
    border-left: 1px solid rgba(255,255,255,0.2);
    padding-right: 0;
    padding-left: 20px;
}
.header-top-info li:last-child {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
}

/* Mobile Nav Flip */
@media (max-width: 1200px) {
    .main-nav {
        right: auto;
        left: -400px;
        transform: translateX(-400px);
    }
    .main-nav.menu-active {
        left: 0;
        transform: translateX(0);
    }
    .closepanel {
        right: auto;
        left: 30px;
    }
    .ht-mobile-menu-bg {
        right: auto;
        left: 0;
        transform: translateX(-101%);
    }
    .menu-active .ht-mobile-menu-bg {
        transform: translateX(0%);
    }
}

/* Search Helper */
.search-form label {
    padding-right: 0;
    padding-left: 50px; /* Space for button on left */
}

.search-form button[type="submit"] {
    right: auto;
    left: 0;
    border-radius: 8px 0 0 8px;
}
.search-form input.form-control {
    padding-right: 20px;
    padding-left: 50px;
}

/* =========================================
   3. Theme Styles (Hero, About, etc)
   ========================================= */
ul {
    margin-left: 0;
    margin-right: 0;
    padding-right: 0; 
}

.list-icon li {
    padding-left: 0;
    padding-right: 25px; /* Space for icon */
    position: relative;
}
.list-icon li i {
    margin-right: 0;
    margin-left: 10px;
    position: absolute;
    right: 0;
    top: 5px;
}

.banner-content h6 span {
    margin-right: 0;
    margin-left: 10px;
}
.banner-content p {
    text-align: right;
}

/* Swiper Buttons */
.swiper.banner-slider .swiper-button-next {
    right: auto;
    left: 10px;
    transform: scaleX(-1);
}

.swiper.banner-slider .swiper-button-prev {
    right: auto;
    left: 62px !important;
    transform: scaleX(-1);
}
.swiper-button-prev::after, .swiper-button-next::after {
    transform: scaleX(-1); 
}

/* About Section */
.about-one-left-image {
    margin-left: 0;
    margin-right: 20px;
}
.about-one-left-image .about-one-image-group img {
    margin-left: 0;
    margin-right: -15px;
}
.about-one-image-group img:nth-child(1) {
    margin-right: 0;
}
.about-roted-text {
    margin-left: 0;
    margin-right: -30px;
    left: auto;
    right: -30px; /* Adjust positioning */
}

/* Contact Box & Opening Hours */
.contact-box .contact-info li {
    padding-left: 0;
    padding-right: 60px;
}
.contact-box .contact-info li i {
    left: auto;
    right: 0;
}
.opening-hours li span:first-child {
    float: right;
}
.opening-hours li span:last-child {
    float: left;
}


/* Utilities */
.alignleft {
    margin: 5px 0 20px 20px !important;
    float: right;
}
.alignright {
    margin: 5px 20px 20px 0 !important;
    float: left;
}

/* Blockquotes */
blockquote, .wp-block-quote.is-style-large {
    padding: 40px 40px 40px 140px !important;
    border-left: none;
    border-right: 2px solid var(--themeht-primary-color);
}
blockquote:after {
    right: auto;
    left: 40px; 
    transform: scaleX(-1); 
}

/* Sidebar & Widgets */
.themeht-sidebar {
    padding-left: 0;
    padding-right: 50px;
}

/* =========================================
   4. Shortcodes & Components
   ========================================= */
/* Section Title */
.theme-title h6 {
    padding: 4.3px 25px 4.3px 12px;
}
.theme-title h6:before {
    left: auto;
    right: 12px;
}

/* Buttons (Fixed) */
.themeht-btn {
    padding-left: 20px; /* Swap padding */
    padding-right: 4px;
    flex-direction: row-reverse; /* Restore row-reverse to keep [Text] [Icon] order */
}
.themeht-btn .btn-icon:before {
    right: auto;
    left: 0;
}

/* Fix Animation Direction for RTL (Move Left instead of Right) and Flip Icon */
.themeht-btn .btn-icon i:first-child {
    transform: translateX(-12px) scaleX(-1);
}
.themeht-btn .btn-icon i:last-child {
    transform: translateX(100px) scaleX(-1);
}
.themeht-btn:hover .btn-icon i:first-child {
    transform: translateX(-100px) scaleX(-1);
}
.themeht-btn:hover .btn-icon i:last-child {
    transform: translateX(11px) scaleX(-1);
}


/* Counter */
.counter .counter-icon {
    margin-right: 0;
    margin-left: 20px;
}

/* Team */
.team-share-icon {
    right: auto;
    left: 50px;
}
.team-share-icon::before {
    right: auto;
    left: 100%;
    border-left: 1px solid var(--themeht-white-color);
    border-right: 0;
    border-radius: 0 0 0 30px;
}
.team-share-icon::after {
    left: auto;
    right: 100%;
    border-right: 1px solid var(--themeht-white-color);
    border-left: 0;
    border-radius: 0 0 30px 0;
}
.team-member .team-social-icon {
    right: auto;
    left: 58px;
}
.team-social-icon ul li {
    margin-bottom: 5px;
}

/* Services */
.service-item.style-1 .service-desc {
    padding: 34px 40px 0 40px;
}
.service-item.style-1 .service-icon {
    left: auto;
    right: 35px;
}

.service-item.style-2 .service-icon {
    left: auto;
    right: 0;
}

.service-item.style-3 .service-icon-wrap {
    flex-direction: row; /* Un-reverse */
}
.service-item.style-3 .service-icon {
    margin-right: 0;
    margin-left: 20px;
}
.service-item.style-3 .service-img {
    margin-right: 0;
    margin-left: 30px;
}

.service-item.style-4 .service-icon {
    left: auto;
    right: 30px;
}

.service-item.style-5 .service-icon {
    right: auto;
    left: 35px;
}

.service-item.style-7 {
    padding-right: 10%; 
}
.service-item.style-7 .service-icon {
    transform: translate3d(100%, 0px, 0px) !important;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px; 
}
.service-item.style-7:hover, .active .service-item.style-7 {
    padding-left: 10%; 
    padding-right: 15%;
}

/* Links & Read More */
.btn-text i {
    margin-left: 0;
    padding-left: 0;
    margin-right: 5px;
    transform: scaleX(-1); /* Flip arrows */
}

/* Form Styles */
.form-control {
    text-align: right;
}
.form-group label {
    text-align: right;
    display: block;
}
/* Select dropdown arrow flip */
.form-select {
    background-position: left 0.75rem center;
    padding-right: 0.75rem;
    padding-left: 2.25rem;
}

/* Footer & Widget Search */
.wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button {
    right: auto;
    left: 0;
}
.wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:before {
    right: auto;
    left: 0;
    border-radius: 8px 0 0 8px;
}

/* Footer Subscibe */
.subscribe-form button {
    right: auto;
    left: 10px;
}

/* Breadcrumb */
.breadcrumb:before {
    right: auto;
    left: -28px;
    transform: rotate(-185deg); 
}
.breadcrumb::after {
    left: auto;
    right: -20px;
    transform: rotate(-90deg); 
}
.breadcrumb i {
    margin-right: 0 !important;
    margin-left: 10px !important;
    transform: scaleX(-1);
}

/* Elementor Headings Fix */
.elementor-heading-title, 
.elementor-widget-heading .elementor-heading-title {
    font-family: 'Cairo', sans-serif !important;
}

/* Grid & Layout Fixes */

.row {
    direction: rtl;
}
.d-flex {
    flex-direction: row; 
}
