/* ============================================
   Barista Coffee Menu - RTL & Language Switcher
   ============================================ */

/* ---- Language Switcher ---- */
.lang-switcher {
    position: relative;
    z-index: 1100;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    backdrop-filter: blur(10px);
    border: 1px solid #e8e0d6;
    color: #2d2016;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}


.lang-toggle:hover {
    background: #f8f5f1;
}

.lang-toggle .fa-chevron-down {
    font-size: 0.65rem;
    transition: transform 0.3s;
}

.lang-switcher.open .lang-toggle .fa-chevron-down {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s;
    min-width: 180px;
}

[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

.lang-switcher.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #2d2016;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.lang-option:hover {
    background: #f8f5f1;
}

.lang-option.active {
    background: #f0e4d4;
    font-weight: 600;
}

.lang-flag {
    font-size: 1.2rem;
}

/* ============================================
   RTL Overrides - only active when dir="rtl"
   ============================================ */

/* ---- RTL Font ---- */
[dir="rtl"] body {
    font-family: 'Noto Kufi Arabic', 'Inter', sans-serif;
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4 {
    font-family: 'Noto Kufi Arabic', 'Playfair Display', serif;
}

/* ---- RTL General ---- */
[dir="rtl"] {
    text-align: right;
}

/* ---- RTL Hero ---- */
[dir="rtl"] .hero {
    text-align: center;
}

[dir="rtl"] .hero-badge {
    letter-spacing: 0;
}

[dir="rtl"] .hero h1 {
    letter-spacing: 0;
}

/* ---- RTL Navbar ---- */
[dir="rtl"] .navbar {
    direction: rtl;
}

[dir="rtl"] .navbar-inner {
    direction: rtl;
}

[dir="rtl"] .nav-right {
    direction: rtl;
}

[dir="rtl"] .nav-logo {
    order: 0;
}

[dir="rtl"] .nav-links {
    direction: rtl;
}

[dir="rtl"] .hero-btn {
    flex-direction: row-reverse;
}

[dir="rtl"] .btn-nav {
    flex-direction: row-reverse;
}

/* ---- RTL Info Bar ---- */
[dir="rtl"] .info-item {
    flex-direction: row-reverse;
}

/* ---- RTL Category Tabs ---- */
[dir="rtl"] .tab-btn {
    flex-direction: row-reverse;
}

/* ---- RTL Card ---- */
[dir="rtl"] .card-badge {
    right: auto;
    left: 12px;
}

[dir="rtl"] .card-body {
    text-align: right;
}

[dir="rtl"] .card-footer {
    flex-direction: row-reverse;
}

[dir="rtl"] .card-badge {
    flex-direction: row-reverse;
}

/* ---- RTL Featured ---- */
[dir="rtl"] .featured-card {
    text-align: center;
}

/* ---- RTL Footer ---- */
[dir="rtl"] .footer {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .footer-inner {
    direction: rtl;
}

[dir="rtl"] .footer h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

[dir="rtl"] .footer p {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

[dir="rtl"] .footer p i {
    margin-right: 0;
    margin-left: 6px;
}

[dir="rtl"] .footer-bottom {
    text-align: center;
    direction: rtl;
}

/* ---- RTL Info Bar (icons before text in RTL) ---- */
[dir="rtl"] .info-bar {
    direction: rtl;
}

[dir="rtl"] .info-item {
    flex-direction: row;
}

/* ---- RTL Hero Badge ---- */
[dir="rtl"] .hero-badge {
    flex-direction: row-reverse;
}

/* ---- RTL Mobile ---- */
@media (max-width: 768px) {
    /* Navbar */
    [dir="rtl"] .nav-links {
        flex-direction: column;
        direction: rtl;
    }

    [dir="rtl"] .nav-links a {
        text-align: right;
    }

    [dir="rtl"] .nav-links .btn-nav {
        text-align: center;
    }

    /* Info bar stacked */
    [dir="rtl"] .info-bar {
        align-items: center;
    }

    [dir="rtl"] .info-item {
        flex-direction: row-reverse;
    }

    /* Footer centered on mobile */
    [dir="rtl"] .footer-inner {
        text-align: center;
    }

    [dir="rtl"] .footer h4 {
        justify-content: center;
    }

    [dir="rtl"] .footer p {
        justify-content: center;
    }

    /* Category tabs scroll direction */
    [dir="rtl"] .category-tabs {
        direction: rtl;
    }

    /* Lang switcher mobile - compact */
    .lang-toggle {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .lang-text {
        display: none;
    }

    .lang-arrow {
        display: none;
    }

    .lang-toggle .fa-globe {
        font-size: 1.1rem;
    }

    .lang-dropdown {
        right: 0;
        left: auto;
        min-width: 160px;
    }

    [dir="rtl"] .lang-dropdown {
        right: auto;
        left: 0;
    }

    .lang-option {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
}

