/* ========================================
   IFTA HEADER
   ======================================== */


.ifta-header {
    text-align: center;
    padding: 13px 20px;
    background: var(--white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* Тень шапки */
    position: relative;
    z-index: 100;
}

.ifta-header-inner {
    max-width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 16px;
}

.ifta-header-left {
    display: flex;
    align-items: center;
}

/* Название раздела الإفتاء */
.ifta-title {
    font-family: var(--font-arabic-display, 'Amiri', serif);
    font-size: 28px;
    font-weight: 700;
    color: var(--emerald);
    direction: rtl;
    transition: color var(--transition-fast);
}

.ifta-title:hover {
    color: var(--emerald-dark);
}

/* Центральный логотип */
.ifta-header-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.ifta-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 50px;
    height: 50px;
    text-decoration: none;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.ifta-logo-link:hover {
    opacity: 0.85;
}

.ifta-logo-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Тень повторяет форму логотипа */
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.22));
    transition: filter 0.2s ease;
}

.ifta-logo-link:hover img {
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.ifta-header-right {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ЗАМЕТНАЯ КНОПКА */
.ifta-nav-btn {
    padding: 10px 22px;
    border-radius: 10px;
    border: none;
    background: var(--emerald); /* Цвет из переменных */
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px color-mix(in srgb, var(--emerald) 30%, transparent);
}

.ifta-nav-btn:hover {
    background: var(--emerald-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px color-mix(in srgb, var(--emerald) 40%, transparent);
}

/* ── ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКОВ ── */
.lang-switcher {
    position: relative;
}

.lang-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 11px;
    border-radius: 9999px;
    border: 1px solid var(--border-gray, #e2e8f0);
    background: white;
    color: #1f2937;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.02em;
}

.lang-trigger:hover,
.lang-trigger.open {
    border-color: var(--emerald);
    color: var(--emerald);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--emerald) 9%, transparent);
}

.lang-globe { width: 15px; height: 15px; flex-shrink: 0; }
.lang-chevron { width: 13px; height: 13px; flex-shrink: 0; transition: transform 0.15s ease; }
.lang-trigger.open .lang-chevron { transform: rotate(180deg); }

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 148px;
    background: white;
    border: 1px solid var(--border-gray, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    z-index: 100;
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    transform-origin: top right;
}

.lang-dropdown.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background 0.15s ease;
    text-align: start;
}

.lang-option + .lang-option { border-top: 1px solid var(--border-gray, #e2e8f0); }
.lang-option:hover,
.lang-option.active { background: var(--emerald-50, #ecfdf5); }

.lang-opt-code {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.05em;
    min-width: 28px;
}

.lang-option.active .lang-opt-code,
.lang-option:hover .lang-opt-code { color: var(--emerald); }

.lang-opt-name {
    font-size: 13px;
    color: #1f2937;
    font-weight: 400;
}

.lang-option.active .lang-opt-name { font-weight: 500; color: var(--emerald-dark); }

/* ── Показ/скрытие мобильных и десктопных элементов шапки ── */
.ifta-logo-mobile {
    display: none;
    width: 36px;
    height: 36px;
    text-decoration: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ifta-logo-mobile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ifta-center-mobile {
    display: none;
    font-family: 'Scheherazade New', 'Amiri', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--emerald);
    direction: rtl;
}

/* ── RTL-режим (арабский язык) ── */
[dir="rtl"] .ifta-header-left {
    text-align: end;
}

[dir="rtl"] .ifta-header-right {
    justify-content: flex-end;
}

/* ═══════════════════════════════════════════
   IFTA SUBMENU (под шапкой — стиль Quran nav-tabs)
   ═══════════════════════════════════════════ */
.ifta-submenu {
    display: flex;
    align-items: center;
    padding: 0 12px 0 24px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 2px solid #e5e7eb;
    background: var(--page-bg, #f0f2f0);
    gap: 0;
}

.ifta-submenu-inner {
    display: flex;
    align-items: center;
    width: 100%;
}

.ifta-submenu-tabs {
    display: flex;
    gap: 0;
    margin-inline-end: auto;
}

.ifta-submenu-tab {
    padding: 10px 22px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
    font-family: 'Inter', sans-serif;
}

.ifta-submenu-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--emerald, #059669);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.ifta-submenu-tab:hover {
    color: var(--emerald-dark, #065f46);
    background: color-mix(in srgb, var(--emerald, #059669) 6%, transparent);
    border-radius: 6px 6px 0 0;
}

.ifta-submenu-tab.active {
    color: var(--emerald, #059669);
}

.ifta-submenu-tab.active::after {
    transform: scaleX(1);
}

.ifta-submenu .ifta-nav-btn {
    padding: 7px 18px;
    font-size: 13px;
    border-radius: 8px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .ifta-submenu {
        padding: 0 12px;
    }
    .ifta-submenu-tab {
        padding: 10px 14px;
        font-size: 13px;
    }
    .ifta-submenu .ifta-nav-btn {
        padding: 6px 14px;
        font-size: 12px;
    }
}