/* ============================
   Reborn Multilingual Switcher
   by CaliDevs
   ============================ */

/* Floating Language Switcher */
.rml-lang-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
}

.rml-current-lang {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    user-select: none;
}

.rml-current-lang:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #c0c0c0;
}

.rml-lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 100%;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.rml-lang-switcher.open .rml-lang-dropdown {
    display: block;
    animation: rmlFadeIn 0.15s ease;
}

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

.rml-lang-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    text-decoration: none !important;
    color: #333 !important;
    transition: background 0.15s ease;
}

.rml-lang-option:hover {
    background: #f5f5f5;
    color: #111 !important;
}

/* Flag images */
.rml-flag {
    display: inline-flex;
    align-items: center;
    width: 22px;
    height: 15px;
    flex-shrink: 0;
}

.rml-flag-img {
    width: 22px;
    height: 15px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    object-fit: cover;
}

.rml-lang-label {
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #333;
}

.rml-chevron {
    transition: transform 0.2s ease;
    color: #999;
    margin-left: 2px;
}

/* Inline Switcher (shortcode) */
.rml-inline-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 4px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.rml-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 16px;
    text-decoration: none !important;
    color: #666 !important;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.rml-lang-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #333 !important;
}

.rml-lang-btn.rml-active {
    background: #2a2a2a;
    color: #fff !important;
}

.rml-lang-btn.rml-active .rml-lang-label {
    color: #fff;
}

/* Flags-only style */
.rml-style-flags-only .rml-lang-label {
    display: none;
}

.rml-style-flags-only .rml-lang-btn {
    padding: 6px 8px;
}

.rml-style-flags-only .rml-flag-img {
    width: 28px;
    height: 19px;
}

/* Nav menu injection */
.rml-nav-lang-item {
    display: flex !important;
    align-items: center !important;
}

.rml-nav-lang-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 20px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    margin-left: 10px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
}

.rml-nav-lang-link:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.rml-nav-flag {
    display: inline-block;
    width: 20px;
    height: 14px;
    background-size: cover;
    background-position: center;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.rml-nav-flag-mx {
    background: linear-gradient(to right, #006847 33.3%, #fff 33.3%, #fff 66.6%, #ce1126 66.6%);
}

.rml-nav-flag-us {
    background: repeating-linear-gradient(
        to bottom,
        #B22234 0px, #B22234 2px,
        #fff 2px, #fff 4px
    );
    position: relative;
}

.rml-nav-flag-us::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 55%;
    background: #3C3B6E;
}

.rml-nav-lang-text {
    color: inherit;
}

/* Animation */
@keyframes rmlFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 767px) {
    .rml-lang-switcher {
        top: auto;
        bottom: 20px;
        right: 20px;
    }

    .rml-lang-dropdown {
        top: auto;
        bottom: calc(100% + 6px);
    }

    .rml-lang-switcher.open .rml-chevron {
        transform: rotate(0deg);
    }

    .rml-nav-lang-item {
        margin-top: 10px !important;
    }
}
