/* ==================== RTL OVERRIDES ==================== */
/* Applied when <html dir="rtl"> */

/* Font: Arabic fallback */
body, input, textarea, select, button {
    font-family: var(--font-body), 'Noto Sans Arabic', Tahoma, sans-serif;
}
h1, h2, h3, h4, h5, h6,
.hero-title, .section-title, .page-header-title, .cta-title,
.header-logo, .footer-brand, .room-card-name, .feature-title {
    font-family: var(--font-heading), 'Noto Sans Arabic', Tahoma, serif;
}

/* Letter-spacing: Arabic doesn't need it */
[dir="rtl"] .nav-link,
[dir="rtl"] .btn-reserve,
[dir="rtl"] .btn-reserve-outline,
[dir="rtl"] .btn-hero-outline,
[dir="rtl"] .section-overtitle,
[dir="rtl"] .hero-badge,
[dir="rtl"] .hero-scroll,
[dir="rtl"] .footer-title {
    letter-spacing: 0;
}

/* Nav underline: flip to right */
[dir="rtl"] .nav-link::after {
    left: auto;
    right: 0;
}

/* Room card price badge: flip */
[dir="rtl"] .room-card-price {
    right: auto;
    left: 16px;
}

/* WhatsApp FAB: flip to left */
[dir="rtl"] .whatsapp-fab {
    right: auto;
    left: 24px;
}

/* Chat widget position */
[dir="rtl"] #chatWidget {
    right: auto !important;
    left: 24px !important;
}
[dir="rtl"] #chatWindow {
    right: auto !important;
    left: 0 !important;
}

/* Chat bubbles: flip corners */
[dir="rtl"] .chat-msg.bot .chat-bubble {
    border-radius: 12px 0 12px 12px;
}
[dir="rtl"] .chat-msg.user .chat-bubble {
    border-radius: 0 12px 12px 12px;
}
[dir="rtl"] .chat-msg.user {
    flex-direction: row;
}
[dir="rtl"] .chat-msg.bot {
    flex-direction: row-reverse;
}

/* Footer contact icon alignment */
[dir="rtl"] .footer-contact-item i {
    margin-top: 3px;
}

/* Header brand gap direction handled by flex + dir */

/* Page header breadcrumb separator */
[dir="rtl"] .page-header-breadcrumb {
    direction: rtl;
}

/* Reservation card left border → right border */
[dir="rtl"] [style*="border-left:"] {
    border-left: none;
}

/* Gallery: first item span direction */
[dir="rtl"] .gallery-item:first-child {
    grid-column: span 2;
}

/* Portal nav: handled by flex + dir */

/* Inline icon margins: flip margin-right to margin-left */
[dir="rtl"] i[style*="margin-right"],
[dir="rtl"] .fas[style*="margin-right"],
[dir="rtl"] .far[style*="margin-right"],
[dir="rtl"] .fab[style*="margin-right"] {
    margin-right: 0 !important;
    margin-left: 6px !important;
}

/* Text alignment fixes */
[dir="rtl"] .footer-copy,
[dir="rtl"] .footer-dev {
    text-align: right;
}

/* Scrolled header lang btn */
[dir="rtl"] .lang-dropdown {
    left: auto;
    right: 0;
}

/* Mobile menu */
@media (max-width: 768px) {
    [dir="rtl"] #chatWidget {
        right: auto !important;
        left: 24px !important;
    }
    [dir="rtl"] .mobile-toggle {
        order: -1;
    }
}

/* Form elements inherit direction */
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select {
    text-align: right;
}
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="url"],
[dir="rtl"] input[type="tel"] {
    text-align: left;
    direction: ltr;
}

/* Hero scroll indicator centered - no change needed */

/* Print page */
@media print {
    [dir="rtl"] .text-right { text-align: left; }
    [dir="rtl"] .text-left { text-align: right; }
}

/* Portal reservation cards: border-left → border-right */
[dir="rtl"] .portal-res-card,
[dir="rtl"] [style*="border-left:4px"],
[dir="rtl"] [style*="border-left:3px"] {
    border-left: none !important;
    border-right-width: 4px !important;
    border-right-style: solid !important;
}

/* General inline margin-right fix for RTL */
[dir="rtl"] [style*="margin-right:4px"],
[dir="rtl"] [style*="margin-right:6px"],
[dir="rtl"] [style*="margin-right:8px"] {
    margin-right: 0 !important;
    margin-left: 6px !important;
}

/* Flex row-reverse handling for chat in RTL */
[dir="rtl"] #chatInput {
    text-align: right;
}
