/* Arabic / English switcher and direction-specific layout. */
.language-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    min-width: 86px;
    padding: 9px 15px;
    color: var(--primary);
    background: var(--surface);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}

.language-toggle:hover {
    background: var(--primary);
    color: var(--background);
    border-color: var(--primary);
    transform: translateY(-2px);
}

html[dir="rtl"] body {
    font-family: "Cairo", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
    line-height: 1.85;
}

html[dir="rtl"] :is(h1, h2, h3, h4) {
    font-family: "Cairo", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
}

html[dir="rtl"] :is(.section-title, .contact-title, .detail-title, .product-name,
    .project-title, .detail-features-title, .section-label, .hero-label, .project-category) {
    letter-spacing: 0;
}

html[dir="rtl"] :is(.hero-title, .brand) {
    direction: ltr;
    unicode-bidi: isolate;
    font-family: var(--font-heading);
}

html[dir="rtl"] .hero-mascot { right: auto; left: 4%; }
html[dir="rtl"] .product-preview .tag { left: auto; right: 12px; }
html[dir="rtl"] .product-mascot { right: auto; left: 8px; }
html[dir="rtl"] .footer-mascot { right: auto; left: 0; }

html[dir="rtl"] .values span::before {
    margin-right: 0;
    margin-inline-end: 8px;
}

html[dir="rtl"] :is(.btn, .card, .text-link):hover .arrow {
    transform: translateX(-4px);
}

html[dir="rtl"] :is(.request-dialog, .detail-actions, .about-panel, .contact-panel) {
    direction: rtl;
}

html[dir="rtl"] .field { text-align: start; }
.field :is(input[type="email"], #briefOutput) { direction: ltr; }
html[dir="rtl"] #briefOutput { direction: rtl; }

@media (max-width: 1050px) {
    .nav-inner { gap: 12px; }
    .nav-cta { display: none; }
}

@media (max-width: 800px) {
    .language-toggle { margin-inline-start: auto; }
}

@media (max-width: 560px) {
    .nav-inner { gap: 8px; }
    .brand { font-size: 18px; gap: 8px; }
    .brand-image { width: 30px; height: 30px; }
    .menu-toggle { width: 40px; height: 40px; flex-shrink: 0; }
    .language-toggle { min-height: 40px; min-width: 74px; padding: 8px 10px; }
    html[dir="rtl"] .hero-mascot { left: 5%; }
}

@media (prefers-reduced-motion: reduce) {
    .language-toggle { transition: none; }
}
