/* ==========================================================================
   TRAMITE24 I18N & RTL MULTI-LANGUAGE SYSTEM
   Idiomas: Español (es), English (en), Français (fr), العربية (ar), Português (pt)
   ========================================================================== */

/* 1. Language Switcher Dropdown (Navbar & Footer) */
.lang-switcher-wrap {
    position: relative;
    display: inline-block;
}
.lang-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    outline: none;
}
.lang-trigger-btn:hover {
    border-color: #2563eb;
    background: #f8fafc;
    color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}
.lang-flag {
    line-height: 1;
    display: inline-flex;
    align-items: center;
}
.lang-flag-svg {
    width: 20px;
    height: 15px;
    border-radius: 3px;
    display: inline-block;
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
}
.lang-code {
    letter-spacing: 0.05em;
    font-size: 12px;
}
.lang-chevron {
    font-size: 10px;
    color: #64748b;
    transition: transform 0.2s ease;
}
.lang-switcher-wrap.is-open .lang-chevron {
    transform: rotate(180deg);
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 6px;
    box-shadow: 0 10px 28px -4px rgba(15, 23, 42, 0.14), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
    z-index: 99999 !important;
    display: none;
    backdrop-filter: blur(8px);
    animation: langFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes langFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.lang-switcher-wrap.is-open .lang-dropdown-menu {
    display: block !important;
}
.lang-switcher-wrap#footer-lang-selector .lang-dropdown-menu {
    bottom: calc(100% + 8px);
    top: auto;
}
.lang-dropdown-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    padding: 8px 10px 4px;
}
.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #1e293b;
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.12s ease;
}
.lang-option:hover {
    background: #f1f5f9;
    color: #2563eb;
    transform: translateX(2px);
}
.lang-option.is-active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 700;
}
.lang-opt-flag {
    font-size: 18px;
    line-height: 1;
}
.lang-opt-name {
    flex: 1;
}
.lang-check {
    color: #2563eb;
    font-size: 12px;
}

/* Mobile Drawer version */
.lang-switcher-wrap.is-mobile {
    width: 100%;
    margin-bottom: 12px;
}
.lang-switcher-wrap.is-mobile .lang-trigger-btn {
    width: 100%;
    justify-content: space-between;
    height: 44px;
    padding: 0 16px;
    border-radius: 12px;
}
.lang-switcher-wrap.is-mobile .lang-dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    border: 1px solid #e2e8f0;
    margin-top: 6px;
}

/* 2. ARABIC & RTL (Right-to-Left) COMPLETE LAYOUT SUPPORT */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;500;600;700;800&display=swap');

html[lang="ar"], html[data-lang="ar"], html[dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: 'Inter', 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
}

html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

/* RTL: Navbar */
html[dir="rtl"] .site-navbar-container {
    flex-direction: row-reverse;
}
html[dir="rtl"] .nav-desktop-menu {
    flex-direction: row-reverse;
}
html[dir="rtl"] .nav-desktop-dropdown,
html[dir="rtl"] .nav-dropdown-card {
    left: auto;
    right: 0;
    text-align: right;
}
html[dir="rtl"] .nav-dropdown-item,
html[dir="rtl"] .nav-dropdown-row {
    flex-direction: row-reverse;
    text-align: right;
}
html[dir="rtl"] .nav-row-header {
    justify-content: flex-end;
    flex-direction: row-reverse;
}
html[dir="rtl"] .nav-actions {
    flex-direction: row-reverse;
}
html[dir="rtl"] .lang-dropdown-menu {
    right: auto;
    left: 0;
    text-align: right;
}
html[dir="rtl"] .lang-option:hover {
    transform: translateX(-2px);
}

/* RTL: Hero Universal Search */
html[dir="rtl"] .hero-search input {
    padding: 0 34px 0 76px;
    text-align: right;
}
html[dir="rtl"] .hero-search-submit {
    right: auto;
    left: 8px;
}
html[dir="rtl"] #search-clear {
    right: auto;
    left: 72px;
}
html[dir="rtl"] #search-panel {
    text-align: right;
}

/* RTL: Icons & Arrows direction */
html[dir="rtl"] .fa-arrow-right,
html[dir="rtl"] .fa-chevron-right,
html[dir="rtl"] .news-link-label i,
html[dir="rtl"] .organism-btn i,
html[dir="rtl"] .proc-action-btn i {
    transform: rotate(180deg);
}

/* RTL: Badges, Cards & Articles */
html[dir="rtl"] .cat-card-accent-bar,
html[dir="rtl"] .quick-card-accent-bar {
    left: auto;
    right: 0;
}
html[dir="rtl"] .cat-thumb-friendly {
    margin-right: 0;
    margin-left: 14px;
}
html[dir="rtl"] .cat-star-btn {
    margin-left: 0;
    margin-right: 8px;
}
html[dir="rtl"] .cat-info,
html[dir="rtl"] .organism-meta,
html[dir="rtl"] .proc-card-body,
html[dir="rtl"] .news-body,
html[dir="rtl"] .guide-card,
html[dir="rtl"] .article-main,
html[dir="rtl"] .article-content,
html[dir="rtl"] .sidebar-card {
    text-align: right;
}
html[dir="rtl"] .article-content h2 {
    border-left: none;
    border-right: 4px solid #4f46e5;
    padding-left: 0;
    padding-right: 14px;
}
html[dir="rtl"] .article-content blockquote,
html[dir="rtl"] .article-lead,
html[dir="rtl"] .actualidad-lead {
    border-left: none;
    border-right: 4px solid #6366f1;
    border-radius: 12px 0 0 12px;
}
html[dir="rtl"] .article-content ul,
html[dir="rtl"] .article-content ol {
    padding-left: 0;
    padding-right: 24px;
}

/* RTL: AlertaTel */
html[dir="rtl"] .alertatel-header {
    text-align: right;
}
html[dir="rtl"] .alertatel-form-box {
    flex-direction: row-reverse;
}
html[dir="rtl"] .alertatel-form-box input {
    text-align: right;
}

/* RTL: Footer */
html[dir="rtl"] .footer-main-grid {
    text-align: right;
}

/* Google Translate RTL and LTR support */
html.translated-rtl {
    direction: rtl;
    text-align: right;
}
html.translated-ltr {
    direction: ltr;
    text-align: left;
}

/* 3. Hide third-party translation frames to ensure 100% native corporate look without killing DOM rendering */
.goog-te-banner-frame,
iframe.goog-te-banner-frame,
.goog-tooltip,
.goog-tooltip:hover,
#goog-gt-tt,
.goog-te-balloon-frame {
    display: none !important;
    visibility: hidden !important;
}
body {
    top: 0px !important;
}
#google_translate_element,
#google_translate_hidden_bridge {
    position: fixed !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    overflow: hidden !important;
    z-index: -9999 !important;
}
.goog-te-gadget {
    font-size: 0px !important;
    color: transparent !important;
    line-height: 0 !important;
}
.goog-te-gadget .goog-te-combo {
    margin: 0 !important;
}
/* Prevent Google Translate banner layout shifting */
.goog-te-banner-frame.skiptranslate {
    display: none !important;
}
body > .skiptranslate {
    display: none;
}
body > #google_translate_element.skiptranslate,
body > #google_translate_element,
body > #google_translate_hidden_bridge.skiptranslate,
body > #google_translate_hidden_bridge {
    display: block !important;
}

