/*
Theme Name: CargoZen Child
Description: Advanced RTL Overrides - Merged & Final Phase
*/

/* --- General & Typography Fixes --- */
body, p, span, a, h1, h2, h3, h4, h5, h6, 
.cg-sec-title, .headline, .pera-content, .cg-wc3-content, .cg-blog-1-content p, .cg-service-1-content p {
    text-align: right !important;
    direction: rtl !important;
}

.custom-center .split-line, .custom-center .cg-sec-title {
    text-align: center !important;
}
/* --- FIX FOR TEXT ANIMATION (WORD-BY-WORD) --- */

/* 1. راست‌چین کردن کانتینرهای اصلی */
.headline, .split-line, .split-word, .cg-hero3-text {
    text-align: right !important;
    direction: rtl !important;
}

/* 2. خنثی‌سازی انیمیشن روی "حروف" برای جلوگیری از جدا شدن فارسی */
.split-line div, 
.split-word div {
    display: inline !important; /* چسباندن قطعی حروف */
    direction: rtl !important;
    unicode-bidi: normal !important;
    
    /* از کار انداختن انیمیشن افزونه فقط روی حروف */
    opacity: 1 !important; 
    transform: none !important; 
    translate: none !important;
    rotate: none !important;
    scale: none !important;
    visibility: visible !important;
}

/* 3. اعمال انیمیشن جدید روی "کلمات" */
.split-word {
    display: inline-block !important; /* کلمات باید بلاک باشند تا حرکت کنند */
    opacity: 0; 
    animation: fadeInWordRTL 0.6s ease-out forwards !important;
    margin-left: 5px; /* فاصله استاندارد بین کلمات */
}

/* 4. ایجاد تاخیر زمانی متوالی (Stagger) برای کلمات تا افکت تایپ ایجاد شود */
.split-word:nth-child(1) { animation-delay: 0.1s !important; }
.split-word:nth-child(2) { animation-delay: 0.2s !important; }
.split-word:nth-child(3) { animation-delay: 0.3s !important; }
.split-word:nth-child(4) { animation-delay: 0.4s !important; }
.split-word:nth-child(5) { animation-delay: 0.5s !important; }
.split-word:nth-child(6) { animation-delay: 0.6s !important; }
.split-word:nth-child(7) { animation-delay: 0.7s !important; }
.split-word:nth-child(8) { animation-delay: 0.8s !important; }
.split-word:nth-child(9) { animation-delay: 0.9s !important; }
.split-word:nth-child(10) { animation-delay: 1.0s !important; }
.split-word:nth-child(11) { animation-delay: 1.1s !important; }
.split-word:nth-child(12) { animation-delay: 1.2s !important; }
.split-word:nth-child(13) { animation-delay: 1.3s !important; }
.split-word:nth-child(14) { animation-delay: 1.4s !important; }
.split-word:nth-child(15) { animation-delay: 1.5s !important; }

/* 5. فریم‌های انیمیشن ظاهر شدن کلمات */
@keyframes fadeInWordRTL {
    0% { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* --- Header & Main Menu RTL Fixes --- */
.cg-header-1-nav-area .cg-header-1-nav > ul > li {
    float: right;
}
.cg-header-1-nav-area .cg-header-1-nav > ul > li:first-child {
    margin-right: 0;
    margin-left: 45px;
}
.cg-header-1-nav-area .cg-header-1-nav > ul > li:last-child {
    margin-left: 0;
}

/* --- Top Level Main Menu Fixes (Arrow and Red Dot) --- */
.cg-header-1-nav > ul > li.menu-item-has-children,
.main-navigation > ul > li.menu-item-has-children,
.cg-header-section .dropdown {
    position: relative !important;
}

.cg-header-1-nav > ul > li.menu-item-has-children > a,
.main-navigation > ul > li.menu-item-has-children > a,
.cg-header-section .dropdown > a {
    padding-right: 0 !important;
    padding-left: 18px !important; 
}

.cg-header-section .dropdown::after,
.cg-header-1-nav > ul > li.menu-item-has-children::after,
.main-navigation > ul > li.menu-item-has-children::after,
.cg-header-1-nav > ul > li.menu-item-has-children > a::after,
.main-navigation > ul > li.menu-item-has-children > a::after,
.cg-header-1-nav > ul > li.menu-item-has-children > a i,
.main-navigation > ul > li.menu-item-has-children > a i {
    position: absolute !important;
    left: 0 !important; 
    right: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important; 
    margin: 0 !important;
    float: none !important;
}

.cg-header-1-nav > ul > li > a::before,
.main-navigation > ul > li > a::before {
    left: auto !important;
    right: -15px !important;
}

/* --- Submenu Position, Text Align, Hover Shift & Red Dot --- */
.cg-header-1-nav ul li ul li a,
.main-navigation ul li ul li a,
.submenu li a, 
.sub-menu li a,
.dropdown-menu li a,
.cg-header-section .dropdown-menu a {
    display: block !important;
    text-align: right !important;
    direction: rtl !important;
    padding: 12px 20px 12px 15px !important;
    transition: all 0.3s ease-in-out !important;
}

.cg-header-1-nav ul li ul li a:hover,
.main-navigation ul li ul li a:hover,
.submenu li a:hover, 
.sub-menu li a:hover,
.dropdown-menu li a:hover,
.cg-header-section .dropdown-menu a:hover {
    padding-right: 35px !important; 
}

.cg-header-1-nav ul li ul li a::before,
.cg-header-1-nav ul li ul li a::after,
.main-navigation ul li ul li a::before,
.main-navigation ul li ul li a::after,
.submenu li a::before, 
.submenu li a::after,
.sub-menu li a::before,
.sub-menu li a::after,
.cg-header-section .dropdown-menu a::before,
.cg-header-section .dropdown-menu a::after {
    left: auto !important;
    right: 15px !important; 
    top: 50% !important; 
    transform: translateY(-50%) !important; 
    margin: 0 !important;
    margin-top: -2px !important;
}

.cg-header-1-nav ul li ul,
.main-navigation ul li ul,
.submenu, 
.sub-menu,
.dropdown-menu {
    left: auto !important;
    right: 0 !important;
    text-align: right !important;
}

.cg-header-1-nav ul li ul li ul,
.main-navigation ul li ul li ul,
.submenu .submenu, 
.sub-menu .sub-menu,
.dropdown-menu .dropdown-menu {
    left: auto !important;
    right: 100% !important;
    margin-right: 0 !important;
}

/* --- Section Specific Absolute Fixes (Truck, Icons, etc.) --- */
.cg-wc3-card .cg-wc3-trc {
    right: auto !important;
    left: 0 !important;
}

.cg-wc3-card ul li i,
.cg-wc-2-content-list ul li .list-icon {
    margin-right: 0 !important;
    margin-left: 15px !important;
    float: right !important;
}
.cg-wc-2-content-list ul li .list-content {
    text-align: right;
}

.cg-team-1-social {
    right: auto !important;
    left: 20px !important;
}

/* --- Hero Section --- */
.cg-hero-1-content .cg-btn-1 {
    margin-right: 0;
    margin-left: 20px;
}
.cg-hero-1-wrapper .cg-hero-1-content {
    padding-left: 0;
    padding-right: 150px;
}

/* --- Why Choose Us Section 2 --- */
.cg-wc-2-img-wrapper {
    margin-right: 0;
    margin-left: -100px;
}

/* --- Counter Section --- */
.cg-counter-2-item-inner {
    padding-left: 0;
    padding-right: 30px;
}
.cg-counter-2-item-icon {
    right: -25px;
    left: auto;
}

/* --- Service Section --- */
.cg-service-1-item {
    padding-left: 20px;
    padding-right: 0;
}
.cg-service-1-item .cg-service-1-icon {
    margin-right: 0;
    margin-left: 20px;
}

/* --- Process Section --- */
.cg-process-1-item .cg-process-1-icon {
    margin-right: 0;
    margin-left: 25px;
}
.cg-process-1-item:nth-child(even) {
    margin-left: 0;
    margin-right: 60px;
}

/* --- Testimonial Slider --- */
.cg-testimonial-1-wrapper .slick-slide {
    direction: rtl;
    text-align: right;
}
.cg-testimonial-1-author-info .cg-testimonial-1-author-name {
     padding-left: 0;
     padding-right: 20px;
}
.cg-testimonial-1-author-info .cg-testimonial-1-author-img {
    margin-right: 0;
    margin-left: 20px;
}

/* --- Blog Section --- */
.cg-blog-1-item .cg-blog-1-content {
    text-align: right;
}
.cg-blog-1-meta ul li:not(:last-child) {
    margin-right: 0;
    margin-left: 25px;
}
.cg-blog-1-meta ul li i {
    margin-right: 0;
    margin-left: 8px;
}

/* --- Footer Adjustments --- */
.cg-footer-widget .cg-footer-title {
    text-align: right !important;
}
.cg-footer-widget ul li {
    padding-left: 0 !important;
    padding-right: 15px !important;
}
.cg-footer-widget ul li::before {
    left: auto !important;
    right: 0 !important;
}
.cg-footer-widget.widget_nav_menu ul li a {
    text-align: right;
}
.cg-copyright-text {
    text-align: right;
}
.cg-footer-social {
    text-align: left;
}

/* --- LTR Forced Elements (Icons, etc.) --- */
.ltr-forced, .fa, .fas, .fab {
    direction: ltr !important;
}

/* --- Fix button icon RTL --- */
.cg-btn-1 a span {
    display: inline-flex !important;
    flex-direction: row-reverse !important; /* آیکن سمت راست متن */
    align-items: center !important;
}

.cg-btn-1 a span i {
    margin-right: 0 !important;
    margin-left: 10px !important; /* فاصله بین آیکن و متن */
}

/* Hover RTL direction */
.cg-btn-1 a::before {
    right: 0 !important;
    left: auto !important;
}

.cg-btn-1 a:hover::before {
    width: 100% !important;
    right: 0 !important;
    left: auto !important;
}
/* Accordion icon RTL fix */
.accordion-button {
    text-align: right !important;
    direction: rtl !important;
    padding: 20px 60px 22px 0px !important;
}

.accordion-button::after {
    margin-left: 0 !important;
    margin-right: auto !important;
    right: 0 !important;
    left: auto !important;
}

/* انتقال بخش نقشه و هواپیما به سمت چپ در حالت راست‌چین */
.cg-pricing-sec .cg-price-plane {
    left: 15%;
    right: auto;
}

.cg-price-map {
    left: 0;
    right: auto;
}

.cg-price-plane img {
    transform: scaleX(-1) !important;
}

/* وسط‌چین کردن اعداد داخل دایره‌های صفحه‌بندی */
.cg-gs-pagi .swiper-pagination-bullet {
    display: flex !important;
    justify-content: center !important; /* وسط‌چین افقی عدد */
    align-items: center !important; /* وسط‌چین عمودی عدد */
    text-align: center !important;
    line-height: 1 !important; 
}

/* اصلاح جهت شناوری برای متن‌های متحرک در نسخه فارسی */
.js-marquee-wrapper .js-marquee {
    float: right !important;
}

.cg-service3-item {
    padding-right: 52px;
    padding-left: 0;
}
.cg-blog1-item .item-meta {
    right: 22px;
    left: 0;
}
.cg-blog1-item .item-meta p {
    text-align: center !important;
}
.log-team-contact-form input, .log-team-contact-form textarea {
    padding-right: 20px;
    padding-left: 0px;    
}

.cg-header-section:is(.header_style_one) .cg-header-top .action-social a {
    margin: 0 20px 0 0;
}
.cg-header-section:is(.header_style_one) .cg-header-top .top-cta .item-icon {
    margin: 0 0 0 8px;
}
.ed-blog-details-text figure.wp-block-image {
    text-align: center;
}