/* ----------------------------------------------------------------------
 * Custom Language Switcher & Multilingual Styles
 * ------------------------------------------------------------------- */

.custom-lang-switcher-wrap {
    display: inline-flex;
    align-items: center;
}

.custom-lang-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    color: #1e293b;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.25s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.custom-lang-switch-btn:hover {
    background-color: #f8fafc;
    border-color: var(--primary);
    color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.custom-lang-switch-btn i {
    font-size: 14px;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.custom-lang-switch-btn:hover i {
    transform: rotate(20deg);
}

/* Mobile Offcanvas Language Switcher */
.custom-mobile-lang-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.custom-mobile-lang-box .lang-toggle-btn {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.custom-mobile-lang-box .lang-toggle-btn.active {
    background-color: var(--primary);
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.custom-mobile-lang-box .lang-toggle-btn:not(.active) {
    background-color: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.custom-mobile-lang-box .lang-toggle-btn:not(.active):hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Direction and typography helpers */
[dir="rtl"] .custom-lang-switch-btn {
    font-family: 'Alexandria', 'Tajawal', sans-serif !important;
}

.phone-number,
[href^="tel:"],
[href^="mailto:"],
.ltr-text {
    direction: ltr !important;
    display: inline-block;
    unicode-bidi: embed;
}

/* Rehab Language Switcher Dropdown Styling */
.language-switcher .dropdown-toggle {
    transition: all 0.2s ease-in-out;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.language-switcher .dropdown-toggle:hover,
.language-switcher .dropdown-toggle:focus {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.language-switcher .dropdown-menu {
    min-width: 175px;
    z-index: 1050;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.language-switcher .dropdown-item {
    transition: background-color 0.15s ease, color 0.15s ease;
}

.language-switcher .dropdown-item:hover {
    background-color: rgba(var(--primary-rgb, 13, 110, 253), 0.08);
    color: var(--primary) !important;
}

.language-switcher .flag,
.language-switcher-list .flag {
    display: inline-block;
    vertical-align: middle;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.language-switcher-list a {
    transition: all 0.2s ease;
}

.language-switcher-list a:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* ==========================================================================
   Comprehensive RTL (Arabic) Polish & Premium Typography
   ========================================================================== */
html[dir="rtl"],
html[dir="rtl"] body,
[dir="rtl"] body {
    font-family: 'Alexandria', 'Tajawal', sans-serif !important;
    line-height: 1.75;
    letter-spacing: 0 !important;
}

/* Headings & Prominent Titles */
[dir="rtl"] h1, 
[dir="rtl"] h2, 
[dir="rtl"] h3, 
[dir="rtl"] h4, 
[dir="rtl"] h5, 
[dir="rtl"] h6,
[dir="rtl"] .card-title,
[dir="rtl"] .heading-primary,
[dir="rtl"] .font-weight-semibold,
[dir="rtl"] .font-weight-bold {
    font-family: 'Alexandria', sans-serif !important;
    letter-spacing: 0 !important;
    line-height: 1.35;
}

[dir="rtl"] p,
[dir="rtl"] .card-text,
[dir="rtl"] .feature-box-info p {
    font-family: 'Alexandria', 'Tajawal', sans-serif !important;
    line-height: 1.8 !important;
}

/* Subheadings & Badges */
[dir="rtl"] .badge,
[dir="rtl"] .custom-font-secondary,
[dir="rtl"] .custom-font-tertiary {
    font-family: 'Tajawal', 'Alexandria', sans-serif !important;
    font-style: normal !important;
    letter-spacing: 0 !important;
}

/* Interactive Elements (Buttons, Navigation, Dropdowns) */
[dir="rtl"] .btn,
[dir="rtl"] .nav-link,
[dir="rtl"] .dropdown-item,
[dir="rtl"] .read-more,
[dir="rtl"] button {
    font-family: 'Alexandria', 'Tajawal', sans-serif !important;
    letter-spacing: 0 !important;
}

/* Reset negative letter spacing in Arabic */
[dir="rtl"] .n-ls-5,
[dir="rtl"] .n-ls-1,
[dir="rtl"] .negative-ls-05,
[dir="rtl"] .negative-ls-1 {
    letter-spacing: 0 !important;
}

/* RTL Arrow Flipping (mirrors icons to point forward in reading direction) */
[dir="rtl"] .fa-arrow-right,
[dir="rtl"] .fa-angle-right,
[dir="rtl"] .fa-chevron-right {
    transform: scaleX(-1);
    display: inline-block;
}

[dir="rtl"] .btn-with-arrow-solid i,
[dir="rtl"] .btn-swap-1 i {
    transform: scaleX(-1);
}

/* RTL Form Alignment */
[dir="rtl"] .form-control,
[dir="rtl"] .form-label {
    text-align: right;
    font-family: 'Alexandria', 'Tajawal', sans-serif !important;
}

[dir="rtl"] .form-control::placeholder {
    text-align: right;
    font-family: 'Alexandria', 'Tajawal', sans-serif !important;
}

/* RTL Header & Dropdown Alignment */
[dir="rtl"] .header-nav-main nav > ul > li > a {
    text-align: right;
}

[dir="rtl"] .language-switcher .dropdown-menu {
    text-align: right;
}

/* RTL Accordion Chevron */
[dir="rtl"] .accordion.accordion-modern-status.accordion-modern-status-arrow .card-header .accordion-toggle:after {
    left: 20px;
    right: auto;
    transform: scaleX(-1);
}

[dir="rtl"] .accordion.accordion-modern-status.accordion-modern-status-arrow .card-header .accordion-toggle {
    padding-left: 50px;
    padding-right: 25px;
}

/* ==========================================================================
   Al Rehaab Brand Identity Styles (Logo & Theme Colors)
   Primary: Rich Obsidian / Charcoal Black (#141618)
   Accent: Al Rehaab Signature Red (#ab2325)
   ========================================================================== */

/* Logo proportions and presentation */
#header .header-logo img,
.custom-header-logo {
    max-height: 64px !important;
    height: auto !important;
    width: auto !important;
    max-width: 220px !important;
    object-fit: contain !important;
    transition: all 0.3s ease;
}

#header.header-narrow .header-logo img,
#header.header-scrolled .header-logo img,
.sticky-header-active #header .header-logo img {
    max-height: 52px !important;
}

#offCanvasLogo img {
    max-height: 58px !important;
    height: auto !important;
    width: auto !important;
    max-width: 200px !important;
    object-fit: contain !important;
}

#footer .custom-footer-logo,
#footer .header-logo img,
#footer .col-lg-3 img {
    max-height: 72px !important;
    height: auto !important;
    width: auto !important;
    max-width: 240px !important;
    object-fit: contain !important;
}

/* Slide 1 - Rich Black Hero Background Contrast */
.owl-item .bg-primary,
.page-header.bg-primary {
    background-color: var(--primary) !important;
    color: #ffffff;
}

.owl-item .bg-primary h1,
.owl-item .bg-primary h4,
.page-header.bg-primary h1 {
    color: #ffffff !important;
}

.owl-item .bg-primary p.text-dark {
    color: rgba(255, 255, 255, 0.88) !important;
}

/* Button in Slide 1: Keep text and arrow sharp and readable */
.owl-item .bg-primary .btn-light {
    background-color: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
}

.owl-item .bg-primary .btn-light strong,
.owl-item .bg-primary .btn-light .text-dark,
.owl-item .bg-primary .btn-light i {
    color: var(--dark) !important;
    transition: color 0.25s ease;
}

.owl-item .bg-primary .btn-light:hover strong,
.owl-item .bg-primary .btn-light:hover .text-dark,
.owl-item .bg-primary .btn-light:hover i {
    color: var(--secondary) !important;
}

.owl-item .bg-primary .btn-light span.box-shadow-6 {
    background-color: rgba(20, 22, 24, 0.08) !important;
}

.owl-item .bg-primary .btn-light:hover span.box-shadow-6 {
    background-color: rgba(171, 35, 37, 0.12) !important;
}

/* Slide 1 Stamp & Center Icon */
.custom-stamp-1 {
    background-color: var(--dark) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

.custom-stamp-1 path#curvedText1,
#curvedText1 {
    fill: none !important;
    stroke: none !important;
}

.custom-stamp-1 svg text,
.custom-stamp-1 svg text textPath {
    fill: #ffffff !important;
}

.custom-stamp-1 .transform3dxy-n50 svg,
.custom-stamp-1 .transform3dxy-n50 svg path,
.custom-stamp-1 .transform3dxy-n50 .svg-fill-color-secondary,
.custom-stamp-1 .transform3dxy-n50 .svg-fill-color-secondary path,
.custom-stamp-1 .transform3dxy-n50 .svg-fill-color-primary,
.custom-stamp-1 .transform3dxy-n50 .svg-fill-color-primary path {
    fill: var(--secondary) !important;
}

/* Slide 2 Starburst Icon in Accent Red */
.rotate-animation svg.svg-fill-color-secondary,
.rotate-animation svg.svg-fill-color-secondary path,
.rotate-animation .svg-fill-color-secondary,
.rotate-animation .svg-fill-color-secondary path {
    fill: var(--secondary) !important;
}

.page-header.bg-primary .text-dark,
.page-header.bg-primary .breadcrumb li a,
.page-header.bg-primary .breadcrumb li.active {
    color: #ffffff !important;
}

.page-header.bg-primary .badge {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Navigation Links - Accent Hover */
#header .header-nav.header-nav-links nav > ul > li > a:hover {
    color: var(--secondary) !important;
}

#header .header-nav.header-nav-links nav > ul > li.active > a,
#header .header-nav.header-nav-links nav > ul > li > a.active {
    color: var(--secondary) !important;
    font-weight: 700;
}

/* Badges - Refined Palette with Logo Red Accent */
.badge.bg-gradient-light-primary-rgba-20 {
    background: rgba(171, 35, 37, 0.08) !important;
    color: var(--secondary) !important;
    border: 1px solid rgba(171, 35, 37, 0.18) !important;
}

.badge.bg-color-dark-rgba-10 {
    background-color: rgba(20, 22, 24, 0.12) !important;
}

/* Feature Box Icons with Red Accent */
.feature-box-secondary .feature-box-icon {
    background-color: var(--secondary) !important;
    box-shadow: 0 4px 15px rgba(171, 35, 37, 0.3) !important;
}

.feature-box-secondary strong.text-color-secondary {
    color: var(--secondary) !important;
}

/* Buttons - Primary & Quote Actions */
.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(20, 22, 24, 0.25);
    transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(171, 35, 37, 0.35);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(171, 35, 37, 0.3);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: #881c1d !important;
    border-color: #881c1d !important;
    color: #ffffff !important;
}

/* Header Quote Button ("Get Free Quote") */
#header .btn-dark,
.btn.btn-rounded.btn-dark {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(20, 22, 24, 0.25) !important;
    transition: all 0.25s ease-in-out;
}

#header .btn-dark:hover,
.btn.btn-rounded.btn-dark:hover {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(171, 35, 37, 0.35) !important;
    transform: translateY(-1px);
}

/* Footer Newsletter Submit Button */
#footer #newsletterForm button[type="submit"] {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(171, 35, 37, 0.3) !important;
}

#footer #newsletterForm button[type="submit"]:hover {
    background-color: #881c1d !important;
    border-color: #881c1d !important;
}

/* Experience Mark Highlight in Footer & Intro */
mark.bg-color-before-primary-rgba-30:before {
    background-color: rgba(171, 35, 37, 0.25) !important;
}

/* Text hover primary defaults to red accent for lively contrast */
.text-color-hover-primary:hover {
    color: var(--secondary) !important;
}

/* Social icons on hover */
.social-icons li a:hover {
    color: var(--secondary) !important;
}

/* Pulse animation / Video play icon */
.pulseAnim.bg-primary {
    background-color: var(--secondary) !important;
}

/* Offcanvas nav active / hover */
.offcanvas-nav a:hover {
    color: var(--secondary) !important;
}

/* ----------------------------------------------------------------------
 * Accessibility & Core Web Vitals Enhancements
 * ------------------------------------------------------------------- */

/* Contrast adjustments for WCAG AA (min 4.5:1 ratio) */
.text-color-grey,
p.text-color-grey,
span.text-color-grey {
    color: #4a5568 !important;
}

.text-color-dark-grey {
    color: #2d3748 !important;
}

/* Ensure secondary buttons and links have sufficient contrast */
.btn-outline-primary {
    border-color: #0b457f !important;
    color: #0b457f !important;
}

.btn-outline-primary:hover {
    background-color: #0b457f !important;
    border-color: #0b457f !important;
    color: #ffffff !important;
}

/* Focus indicator for keyboard navigation & accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #0b457f !important;
    outline-offset: 2px !important;
}

/* Tap Target sizing for mobile buttons and controls */
.owl-nav button.owl-prev,
.owl-nav button.owl-next {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.scroll-to-top {
    min-width: 48px !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Reduce layout shift (CLS) for dynamic elements */
.owl-carousel {
    contain: layout paint style;
}

/* Ensure smooth font display */
@font-face {
    font-family: 'Font Awesome 7 Free';
    font-display: swap;
}
@font-face {
    font-family: 'Font Awesome 7 Brands';
    font-display: swap;
}
@font-face {
    font-family: 'simple-line-icons';
    font-display: swap;
}

/* Accessibility Color Contrast Enhancements (WCAG AA Compliant) */
#footer {
    color: #334155;
}
#footer p, 
#footer span, 
#footer .text-color-grey, 
#footer .text-3-5 {
    color: #334155 !important;
}
#footer strong.text-color-secondary,
.text-color-secondary {
    color: #991b1b !important;
}
#footer .footer-copyright p, 
#footer .opacity-6 {
    opacity: 1 !important;
    color: #475569 !important;
}
#footer a.text-color-grey {
    color: #334155 !important;
}
#footer a.text-color-grey:hover {
    color: #0b457f !important;
}

/* Header Navigation Contrast (WCAG AA Compliant) */
#header .header-nav-main nav > ul > li > a,
#header .header-nav-main nav > ul > li > a.nav-link,
#header .header-nav-main nav > ul > li > a.nav-link.active,
#header .header-nav-main nav > ul > li > a.active {
    color: #0f172a !important;
}
#header .header-nav-main nav > ul > li > a.nav-link:hover,
#header .header-nav-main nav > ul > li > a.nav-link.active:hover {
    color: #0b457f !important;
}

#header .header-body {
    background-color: #ffffff !important;
}

/* Footer Submit Button Contrast (100% WCAG AAA 17:1 ratio) */
#footer #newsletterForm button[type="submit"],
#footer .subscribe-form button[type="submit"],
#footer button.btn-dark {
    background-color: #0f172a !important;
    border-color: #0f172a !important;
    color: #ffffff !important;
}
#footer #newsletterForm button[type="submit"] span,
#footer .subscribe-form button[type="submit"] span,
#footer button.btn-dark span {
    color: #ffffff !important;
}

/* Icon dimensions placeholder to guarantee 0 CLS */
.fa-solid, .fas, .fa {
    display: inline-block;
    width: 1em;
    height: 1em;
    line-height: 1;
}

@media (min-width: 992px) {
    #header .header-nav.header-nav-links:not(.header-nav-light-text) nav > ul > li > a.active,
    #header .header-nav.header-nav-links nav > ul > li > a.active,
    #header .header-nav-main nav > ul > li > a.active {
        color: #0f172a !important;
    }
}


