/* New Custom Topbar - Clean Implementation */
.custom-topbar {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: #111111;
    z-index: 10000;
    display: flex;
    align-items: center;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.custom-topbar .tb-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.tb-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding-right: 30px;
}

.tb-social-icons {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-right: 20px;
}

.tb-social-icons a {
    color: #EAA636;
    font-size: 16px;
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.tb-social-icons a:hover {
    color: #d4941f;
}

/* TikTok Icon SVG */
.tb-social-icons .tiktok-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.tb-social-icons .tiktok-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: block;
}

.tb-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 0 30px;
    height: 100%;
    position: relative;
    min-width: 0;
}

.tb-ticker {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.tb-ticker-content {
    display: inline-flex;
    white-space: nowrap;
    animation: tb-scroll 35s linear infinite;
    color: #ffffff;
    font-size: 13px;
    font-weight: 400;
    height: 100%;
    align-items: center;
}

.tb-ticker-item {
    display: inline-block;
    padding: 0 60px;
    color: #ffffff;
    white-space: nowrap;
    line-height: 40px;
}

@keyframes tb-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.tb-ticker:hover .tb-ticker-content {
    animation-play-state: paused;
}

.tb-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.tb-lang-dropdown {
    position: relative;
    z-index: 99999;
}

.tb-lang-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 13px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    transition: background 0.3s;
}

.tb-lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tb-lang-btn i {
    font-size: 14px;
}

.tb-lang-menu {
    position: fixed !important;
    background: #ffffff !important;
    width: 140px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    display: none !important;
    z-index: 99999 !important;
    margin-top: 0 !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

.tb-lang-menu.show {
    display: block !important;
    z-index: 99999 !important;
}

.tb-lang-dropdown.show-menu .tb-lang-menu {
    display: block !important;
    z-index: 99999 !important;
}

.tb-lang-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: #333333;
    text-decoration: none;
    transition: background 0.3s;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
}

.tb-lang-option:last-child {
    border-bottom: none;
}

.tb-lang-option:hover {
    background: #f8f8f8;
}

.tb-lang-option.active {
    background: #f0f0f0;
    font-weight: 600;
}

.tb-lang-flag {
    width: 20px;
    height: 15px;
    margin-right: 8px;
    object-fit: cover;
    border-radius: 2px;
    display: inline-block;
}

.tb-lang-btn-flag {
    width: 16px;
    height: 12px;
    margin-right: 5px;
    object-fit: cover;
    border-radius: 2px;
    display: inline-block;
}

.tb-links {
    display: flex;
    gap: 0;
    align-items: center;
}

.tb-link {
    color: #ffffff;
    font-size: 13px;
    padding: 8px 15px;
    text-decoration: none;
    transition: background 0.3s;
    height: 40px;
    display: flex;
    align-items: center;
}

.tb-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tb-phone {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.tb-phone-link {
    color: #ffffff;
    font-size: 13px;
    padding: 8px 12px;
    text-decoration: none;
    transition: background 0.3s;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tb-phone-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tb-phone-link i {
    font-size: 14px;
}

/* Director Image and Info Styling */
.de-images {
    display: flex;
    flex-direction: column;
}

.director-image {
    border-radius: 12px 12px 0 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    width: 100%;
    display: block;
}

.director-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.director-info {
    text-align: center;
    margin-top: 0;
    padding: 20px;
    background: #111111;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    width: 100%;
}

.director-name {
    font-weight: 700;
    color: #ffffff;
    font-size: 18px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.director-title {
    color: #EAA636;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.director-specializations {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px 20px !important;
}

.director-specializations li {
    cursor: pointer;
    transition: color 0.3s ease;
}

.director-specializations li:hover {
    color: #EAA636 !important;
}

.director-specializations li a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.director-specializations li:hover a {
    color: #EAA636 !important;
}

/* Adjust body padding for sticky topbar */
body {
    padding-top: 0;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Ensure buttons with # links work properly */
a[href^="#"] {
    cursor: pointer;
}

/* News Detail Page - Black Header */
body.news-detail-page header {
    background: #000000 !important;
    background-color: #000000 !important;
}

body.news-detail-page header .container {
    background: transparent !important;
    background-color: transparent !important;
}

body.news-detail-page header .row {
    background: transparent !important;
    background-color: transparent !important;
}

body.news-detail-page header .col-md-12 {
    background: transparent !important;
    background-color: transparent !important;
}

body.news-detail-page header .de-flex {
    background: transparent !important;
    background-color: transparent !important;
}

body.news-detail-page header .de-flex-col {
    background: transparent !important;
    background-color: transparent !important;
}

/* Mobile Language Dropdown in Navbar */
.mobile-lang-dropdown {
    display: none;
}

@media (max-width: 768px) {
    .custom-topbar {
        display: none !important;
    }
    
    body {
        padding-top: 0 !important;
    }
    
    /* Fix header responsiveness for LTR languages on small screens */
    header .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    header .de-flex {
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    header .de-flex-col:first-child {
        flex: 0 0 auto !important;
        max-width: 50% !important;
    }
    
    header .de-flex-col:last-child {
        flex: 0 0 auto !important;
        min-width: 0 !important;
        max-width: 50% !important;
    }
    
    header .de-flex-col:last-child > div {
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
        flex-wrap: nowrap !important;
        justify-content: flex-end !important;
    }
    
    /* Reduce logo size on small screens */
    header #logo img.logo,
    header #logo img.logo-2 {
        width: 180px !important;
        height: auto !important;
        max-width: 100% !important;
    }
    
    /* Adjust menu button for small screens */
    #menu-btn {
        margin-left: 5px !important;
        margin-right: 0 !important;
        flex-shrink: 0 !important;
        width: 28px !important;
        height: 28px !important;
        padding: 2px !important;
    }
    
    /* Hide Reservar Cita button on small screens */
    .btn-custom.btn-id {
        display: none !important;
    }
    
    /* Show mobile language dropdown */
    .mobile-lang-dropdown {
        display: block;
        margin-left: 10px;
        position: relative;
        z-index: 999999 !important;
        flex-shrink: 0 !important;
    }
    
    .mobile-lang-btn {
        padding: 6px 10px !important;
        font-size: 12px !important;
        min-width: auto !important;
    }
    
    .mobile-lang-btn {
        background: transparent;
        border: 1px solid rgba(255, 255, 255, 0.3);
        color: #ffffff;
        font-size: 14px;
        padding: 8px 12px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        border-radius: 4px;
        transition: background 0.3s;
        width: auto;
        min-width: 60px;
        position: relative;
        z-index: 999999 !important;
    }
    
    .mobile-lang-btn:hover,
    .mobile-lang-btn:active,
    .mobile-lang-btn:focus {
        background: rgba(255, 255, 255, 0.1);
        outline: none;
    }
    
    .mobile-lang-menu {
        position: fixed !important;
        top: auto !important;
        bottom: auto !important;
        right: auto !important;
        left: auto !important;
        margin-top: 5px;
        background: #ffffff !important;
        width: 160px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        display: none !important;
        visibility: hidden;
        opacity: 0;
        z-index: 9999999 !important;
        border-radius: 4px;
        overflow: hidden;
    }
    
    .mobile-lang-dropdown.show-menu .mobile-lang-menu {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 9999999 !important;
    }
    
    /* Ensure button is clickable */
    .mobile-lang-btn {
        pointer-events: auto !important;
        touch-action: manipulation;
    }
    
    /* Ensure dropdown container has high z-index */
    .mobile-lang-dropdown {
        z-index: 9999999 !important;
    }
    
    .mobile-lang-dropdown.show-menu {
        z-index: 9999999 !important;
    }
    
    /* Position menu dynamically via JavaScript */
    .mobile-lang-menu.positioned {
        position: fixed !important;
    }
    
    .mobile-lang-option {
        display: flex;
        align-items: center;
        padding: 10px 15px;
        color: #333333;
        text-decoration: none;
        transition: background 0.3s;
        border-bottom: 1px solid #f0f0f0;
        font-size: 14px;
    }
    
    .mobile-lang-option:last-child {
        border-bottom: none;
    }
    
    .mobile-lang-option:hover {
        background: #f8f8f8;
    }
    
    .mobile-lang-option.active {
        background: #f0f0f0;
        font-weight: 600;
    }
}

/* Logo Dimensions in Navbar */
header #logo img.logo,
header #logo img.logo-2 {
    width: 260px !important;
    height: 48px !important;
    object-fit: contain !important;
}

/* Preloader Styles */
#preloader {
    background: #000000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 20000 !important;
}

#preloader.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

#preloader .spinner {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}

.preloader-logo {
    width: 400px !important;
    height: auto !important;
    max-width: 80% !important;
    animation: preloader-pulse 1.5s ease-in-out infinite !important;
}

@keyframes preloader-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(0.85);
        opacity: 0.8;
    }
}

/* Hide spinner dots */
#preloader .bounce1,
#preloader .bounce2,
#preloader .bounce3 {
    display: none !important;
}

/* Practice Area Cards - Reduce Height */
.dcg-item {
    max-height: 400px !important;
    overflow: hidden !important;
}

.dcg-four .dcg-image {
    height: 400px !important;
    object-fit: cover !important;
}

/* Center text on hover */
.dcg-four .dcg-content {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
}

/* Reduce empty space on practice area detail page */
#subheader .center-y {
    padding: 40px 0 !important;
}

#subheader h1 {
    margin-bottom: 10px !important;
}

#subheader p {
    margin-bottom: 0 !important;
}

/* Reduce breadcrumb section spacing */
section.no-top {
    padding-top: 0 !important;
}

.breadcrumb-wrapper {
    margin-bottom: 0 !important;
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    width: 50px;
    height: 50px;
    bottom: 70px;
    right: 20px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 24px;
    box-shadow: 2px 2px 3px #999;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background-color: #20ba5a;
    transform: scale(1.1);
    box-shadow: 3px 3px 5px #666;
}

.whatsapp-float i {
    margin-top: 0;
}

/* RTL Support for Arabic */
body[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

body[dir="rtl"] .container:not(section[data-bgcolor="#111111"].text-light .container),
body[dir="rtl"] .row:not(section[data-bgcolor="#111111"].text-light .row),
body[dir="rtl"] .col-lg-4,
body[dir="rtl"] .col-md-6,
body[dir="rtl"] .col-md-12,
body[dir="rtl"] .col-lg-5:not(section[data-bgcolor="#111111"].text-light .col-lg-5),
body[dir="rtl"] .col-lg-8,
body[dir="rtl"] .col-lg-12 {
    direction: rtl;
}

body[dir="rtl"] .text-left {
    text-align: right !important;
}

body[dir="rtl"] .text-right {
    text-align: left !important;
}

body[dir="rtl"] .text-lg-start {
    text-align: right !important;
}

body[dir="rtl"] .text-lg-end {
    text-align: left !important;
}

body[dir="rtl"] .offset-md-1 {
    margin-right: 8.333333%;
    margin-left: 0;
}

body[dir="rtl"] .offset-lg-7:not(section[data-bgcolor="#111111"] .offset-lg-7) {
    margin-right: 58.333333%;
    margin-left: 0;
}

/* Experience Section - Keep LTR even in Arabic (for mobile) */
body[dir="rtl"] section[data-bgcolor="#111111"].text-light {
    direction: ltr !important;
    text-align: left !important;
    position: relative !important;
    overflow: visible !important;
}

body[dir="rtl"] section[data-bgcolor="#111111"].text-light .container {
    direction: ltr !important;
    text-align: left !important;
    position: relative !important;
    z-index: 100 !important;
}

body[dir="rtl"] section[data-bgcolor="#111111"].text-light .row {
    direction: ltr !important;
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    position: relative !important;
    z-index: 100 !important;
}

/* For Arabic: Move text to left side on large screens */
@media (min-width: 992px) {
    body[dir="rtl"] section[data-bgcolor="#111111"].text-light .row {
        display: flex !important;
        flex-wrap: wrap !important;
    }
    body[dir="rtl"] section[data-bgcolor="#111111"].text-light .col-lg-5.offset-lg-7 {
        direction: ltr !important;
        text-align: left !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 30px !important;
        padding-right: 30px !important;
        visibility: visible !important;
        opacity: 1 !important;
        display: block !important;
        position: relative !important;
        z-index: 200 !important;
        width: 50% !important;
        max-width: 50% !important;
        flex: 0 0 50% !important;
        order: 1 !important;
    }
    body[dir="rtl"] section[data-bgcolor="#111111"].text-light .jarallax.image-container {
        order: 2 !important;
        position: absolute !important;
        right: 0 !important;
        left: auto !important;
        width: 50% !important;
        z-index: 1 !important;
        pointer-events: none !important;
    }
}

/* For smaller screens, keep original positioning */
body[dir="rtl"] section[data-bgcolor="#111111"].text-light .col-lg-5.offset-lg-7 {
    direction: ltr !important;
    text-align: left !important;
    margin-left: 58.333333% !important;
    margin-right: 0 !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
    position: relative !important;
    z-index: 100 !important;
    width: 41.666667% !important;
    max-width: 41.666667% !important;
    flex: 0 0 41.666667% !important;
}

body[dir="rtl"] section[data-bgcolor="#111111"].text-light .offset-lg-7 {
    margin-left: 58.333333% !important;
    margin-right: 0 !important;
}

body[dir="rtl"] section[data-bgcolor="#111111"].text-light .jarallax.image-container {
    float: right !important;
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    width: 50% !important;
    height: 100% !important;
    top: 0 !important;
    z-index: 1 !important;
}

/* On desktop, ensure image doesn't cover text and text is on left */
@media (min-width: 992px) {
    body[dir="rtl"] section[data-bgcolor="#111111"].text-light {
        position: relative !important;
        overflow: visible !important;
    }
    body[dir="rtl"] section[data-bgcolor="#111111"].text-light .row {
        display: flex !important;
        flex-wrap: wrap !important;
        position: relative !important;
    }
    body[dir="rtl"] section[data-bgcolor="#111111"].text-light .col-lg-5.offset-lg-7 {
        z-index: 300 !important;
        position: relative !important;
        background: transparent !important;
        padding: 30px !important;
        min-height: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 50% !important;
        max-width: 50% !important;
        flex: 0 0 50% !important;
        order: 1 !important;
        left: 0 !important;
        right: auto !important;
    }
    body[dir="rtl"] section[data-bgcolor="#111111"].text-light .jarallax.image-container {
        position: absolute !important;
        right: 0 !important;
        left: auto !important;
        width: 50% !important;
        z-index: 0 !important;
        order: 2 !important;
        top: 0 !important;
        height: 100% !important;
        pointer-events: none !important;
    }
    body[dir="rtl"] section[data-bgcolor="#111111"].text-light .jarallax.image-container #jarallax-container-1,
    body[dir="rtl"] section[data-bgcolor="#111111"].text-light .jarallax.image-container [id^="jarallax-container"] {
        z-index: -100 !important;
    }
    body[dir="rtl"] section[data-bgcolor="#111111"].text-light .container {
        position: relative !important;
        z-index: 100 !important;
    }
    body[dir="rtl"] section[data-bgcolor="#111111"].text-light .offset-lg-7 {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

body[dir="rtl"] section[data-bgcolor="#111111"].text-light .jarallax.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Layout LTR but keep Arabic text readable RTL */
body[dir="rtl"] section[data-bgcolor="#111111"].text-light .col-lg-5,
body[dir="rtl"] section[data-bgcolor="#111111"].text-light .col-lg-5 > * {
    direction: rtl !important;
    text-align: right !important;
}

body[dir="rtl"] section[data-bgcolor="#111111"].text-light .nav-pills {
    direction: rtl !important;
    text-align: right !important;
}

body[dir="rtl"] section[data-bgcolor="#111111"].text-light .nav-pills .nav-link {
    text-align: right !important;
    direction: rtl !important;
}

body[dir="rtl"] section[data-bgcolor="#111111"].text-light .tab-content {
    direction: rtl !important;
    text-align: right !important;
}

body[dir="rtl"] section[data-bgcolor="#111111"].text-light .tab-content p {
    text-align: right !important;
    direction: rtl !important;
}

body[dir="rtl"] section[data-bgcolor="#111111"].text-light h2 {
    direction: rtl !important;
    text-align: right !important;
}

body[dir="rtl"] section[data-bgcolor="#111111"].text-light .p-title {
    direction: rtl !important;
    text-align: right !important;
}

body[dir="rtl"] .pull-right {
    float: left !important;
}

body[dir="rtl"] .pull-left {
    float: right !important;
}

body[dir="rtl"] .sm-left {
    margin-right: 0;
    margin-left: auto;
}

body[dir="rtl"] header #mainmenu {
    direction: rtl;
}

body[dir="rtl"] .de-flex {
    direction: rtl;
}

body[dir="rtl"] .contact-form-arabic {
    text-align: center !important;
    margin: 0 auto;
}

body[dir="rtl"] .contact-form-arabic .form-border {
    text-align: center !important;
    margin: 0 auto;
}

body[dir="rtl"] .contact-form-arabic .field-set {
    text-align: center !important;
    margin: 0 auto;
}

body[dir="rtl"] .contact-form-arabic .form-control {
    text-align: center !important;
    margin: 0 auto;
    display: block;
}

body[dir="rtl"] .contact-form-arabic textarea.form-control {
    text-align: center !important;
    margin: 0 auto;
    display: block;
}

body[dir="rtl"] .contact-form-arabic #submit {
    text-align: center !important;
}

body[dir="rtl"] .contact-form-arabic #send_message {
    margin: 0 auto;
}

body[dir="rtl"] .news-section-arabic .row {
    justify-content: center !important;
}

body[dir="rtl"] .news-section-arabic .bloglist {
    text-align: center !important;
}

body[dir="rtl"] .news-section-arabic .post-text {
    text-align: center !important;
}

/* News Section RTL Fixes */
body[dir="rtl"] #news {
    direction: rtl;
}

body[dir="rtl"] #news .row {
    direction: rtl;
}

body[dir="rtl"] #news .bloglist {
    direction: rtl;
    text-align: right;
}

body[dir="rtl"] #news .post-text {
    text-align: right;
    direction: rtl;
}

body[dir="rtl"] #news .post-text h4 {
    text-align: right;
}

body[dir="rtl"] #news .post-text p {
    text-align: right;
}

body[dir="rtl"] #news .post-text .p-tagline {
    text-align: right;
}

body[dir="rtl"] #news .post-text .p-author {
    text-align: right;
}

body[dir="rtl"] #news h2 {
    text-align: center;
}

body[dir="rtl"] .news-pagination-arabic {
    justify-content: center !important;
    display: flex !important;
}

body[dir="rtl"] .faq-section-arabic .row {
    justify-content: center !important;
}

body[dir="rtl"] .faq-section-arabic .box-highlight {
    text-align: center !important;
}

body[dir="rtl"] .privacy-section-arabic .text-content {
    text-align: center !important;
}

body[dir="rtl"] .privacy-section-arabic h3 {
    text-align: center !important;
}

body[dir="rtl"] .privacy-section-arabic p {
    text-align: center !important;
}

/* Practice Area Detail RTL Fixes */
body[dir="rtl"] .service-section-1 .row,
body[dir="rtl"] .service-section-2 .row,
body[dir="rtl"] .service-section-3 .row {
    direction: rtl;
    text-align: right;
}

body[dir="rtl"] .service-section-1 .col-lg-5,
body[dir="rtl"] .service-section-1 .col-lg-7,
body[dir="rtl"] .service-section-2 .col-lg-6,
body[dir="rtl"] .service-section-3 .col-lg-6 {
    direction: rtl;
    text-align: right;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

body[dir="rtl"] .service-section-1 .col-lg-5,
body[dir="rtl"] .service-section-1 .col-lg-7 {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

body[dir="rtl"] .service-section-2 .col-lg-6,
body[dir="rtl"] .service-section-3 .col-lg-6 {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

body[dir="rtl"] .service-list {
    direction: rtl;
    text-align: right;
}

body[dir="rtl"] .service-list li {
    flex-direction: row-reverse;
}

body[dir="rtl"] .service-list li span {
    direction: rtl;
    text-align: right;
}

body[dir="rtl"] .service-check-icon {
    margin-right: 0;
    margin-left: 15px;
}

body[dir="rtl"] .expertise-header {
    text-align: right;
    padding-right: 20px;
    padding-left: 0;
}

body[dir="rtl"] .expertise-separator-line {
    margin-left: auto;
    margin-right: 0;
}

body[dir="rtl"] .service-separator {
    margin-right: 0;
}

body[dir="rtl"] .service-category,
body[dir="rtl"] .service-main-heading,
body[dir="rtl"] .service-description {
    text-align: right;
    direction: rtl;
}

body[dir="rtl"] h3.mb-4 {
    text-align: right;
    direction: rtl;
}

body[dir="rtl"] .why-choose-heading,
body[dir="rtl"] .why-choose-subtitle,
body[dir="rtl"] .why-choose-text {
    text-align: right;
    direction: rtl;
}

body[dir="rtl"] .why-choose-separator {
    margin-left: auto;
    margin-right: 0;
}

/* Testimonials Section RTL Fixes */
body[dir="rtl"] #testimonial-carousel .item {
    direction: rtl;
    text-align: right;
}

body[dir="rtl"] #testimonial-carousel .de_testi {
    direction: rtl;
    text-align: right;
}

body[dir="rtl"] #testimonial-carousel blockquote {
    direction: rtl;
    text-align: right;
}

body[dir="rtl"] #testimonial-carousel blockquote h3 {
    text-align: right;
    direction: rtl;
}

body[dir="rtl"] #testimonial-carousel blockquote p {
    text-align: right;
    direction: rtl;
}

body[dir="rtl"] #testimonial-carousel .de_testi_by {
    text-align: right;
    direction: rtl;
}

body[dir="rtl"] #testimonial-carousel .fa-quote-left {
    float: right;
    margin-left: 10px;
    margin-right: 0;
}

/* Keep owl-carousel structure LTR for proper functionality */
body[dir="rtl"] .owl-carousel {
    direction: ltr;
}

body[dir="rtl"] .owl-carousel .owl-stage-outer {
    direction: ltr;
}

body[dir="rtl"] .owl-carousel .owl-stage {
    direction: ltr;
}

/* But make content inside RTL */
body[dir="rtl"] .owl-carousel .owl-item {
    direction: rtl;
}

/* TikTok Icon for Footer */
.social-icons .tiktok-icon-footer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    text-align: center;
    border-radius: 3px;
    margin: 0 5px 0 5px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s;
}

.social-icons .tiktok-icon-footer svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: block;
}

.social-icons .tiktok-icon-footer:hover {
    background: #fff;
    color: #333;
}

/* Services Section - Make content scrollable and ensure button visibility */
#practice-areas .feature-box.f-boxed.style-3 {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#practice-areas .feature-box.f-boxed.style-3 .text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#practice-areas .feature-box.f-boxed.style-3 .text h4 {
    flex-shrink: 0;
    margin-bottom: 15px;
}

#practice-areas .feature-box.f-boxed.style-3 .text h4 a {
    cursor: pointer;
    pointer-events: auto;
    z-index: 10;
    position: relative;
}

#practice-areas .feature-box.f-boxed.style-3 .text p {
    flex: 1;
    overflow-y: auto;
    max-height: 150px;
    margin-bottom: 15px;
    padding-right: 5px;
}

/* Custom scrollbar for services content */
#practice-areas .feature-box.f-boxed.style-3 .text p::-webkit-scrollbar {
    width: 6px;
}

#practice-areas .feature-box.f-boxed.style-3 .text p::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#practice-areas .feature-box.f-boxed.style-3 .text p::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

#practice-areas .feature-box.f-boxed.style-3 .text p::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#practice-areas .feature-box.f-boxed.style-3 .text .btn-custom {
    flex-shrink: 0;
    margin-top: auto;
    z-index: 10;
    position: relative;
}

/* Footer - Smaller height and inline layout */
.subfooter {
    padding: 10px 0 !important;
    min-height: auto !important;
}

.subfooter-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 15px 0;
    gap: 15px;
}

.subfooter-copyright {
    flex: 1;
    min-width: 0;
}

.subfooter-social {
    flex-shrink: 0;
    margin-left: 20px;
}

@media (max-width: 768px) {
    .subfooter-content {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }
    
    .subfooter-social {
        margin-left: 0 !important;
        width: 100%;
    }
    
    .subfooter-copyright {
        width: 100%;
        white-space: normal !important;
    }
}

/* Responsive carousel images */
@media (max-width: 768px) {
    #de-carousel .carousel-item[data-bgimage] {
        background-image: url(../images/mobile.jpg) !important;
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        position: relative;
    }
    #de-carousel .carousel-item[data-bgimage]::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1;
    }
    #de-carousel .carousel-item .mask {
        position: relative;
        z-index: 2;
    }
    #de-carousel .carousel-item .container {
        padding-top: 120px !important;
    }
}

/* Header image object-fit cover */
#de-carousel .carousel-item[data-bgimage] {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Mirror carousel image on desktop for Arabic */
@media (min-width: 769px) {
    body[dir="rtl"] #de-carousel .carousel-item {
        transform: scaleX(-1) !important;
        -webkit-transform: scaleX(-1) !important;
        -moz-transform: scaleX(-1) !important;
        -ms-transform: scaleX(-1) !important;
    }
    
    /* Reverse the content inside so text appears normal */
    body[dir="rtl"] #de-carousel .carousel-item .mask {
        transform: scaleX(-1) !important;
        -webkit-transform: scaleX(-1) !important;
        -moz-transform: scaleX(-1) !important;
        -ms-transform: scaleX(-1) !important;
    }
    
    body[dir="rtl"] #de-carousel .carousel-item .mask > * {
        transform: scaleX(-1) !important;
        -webkit-transform: scaleX(-1) !important;
        -moz-transform: scaleX(-1) !important;
        -ms-transform: scaleX(-1) !important;
    }
}

/* Practice Areas Services Section */
.practice-area-services-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8b500;
}

.service-separator-centered {
    width: 60px;
    height: 3px;
    background: #f8b500;
    margin: 0 auto 30px;
}

.service-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-list li {
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: flex-start;
}

.service-list li:last-child {
    border-bottom: none;
}

.service-check-icon {
    width: 22px;
    height: 22px;
    min-width: 22px;
    margin-right: 15px;
    margin-left: 0;
    margin-top: 3px;
    background: linear-gradient(135deg, #f8b500 0%, #f39c12 100%);
    border-radius: 4px;
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.service-check-icon::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 13px;
    font-weight: bold;
}

.service-list li span {
    flex: 1;
    color: #333;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* RTL Support for Services List */
body[dir="rtl"] .service-list {
    direction: rtl;
    text-align: right;
}

body[dir="rtl"] .service-list li {
    flex-direction: row-reverse;
}

body[dir="rtl"] .service-list li span {
    direction: rtl;
    text-align: right;
}

body[dir="rtl"] .service-check-icon {
    margin-right: 0;
    margin-left: 15px;
}

body[dir="rtl"] .practice-area-services-title {
    text-align: right;
    direction: rtl;
}
