/* ================================================
   main.css — глобальные стили для ВСЕХ страниц
   Гамбургер, мобильное меню, навигация, переводы
   ================================================ */

/* ---- НАВИГАЦИЯ ---- */
.active-nav {
    font-weight: 700 !important;
    color: #1f9a45 !important;
    border-bottom: 2px solid #2fbf57;
    padding-bottom: 2px;
}
.lang-button.active {
    font-weight: 700;
    color: #2fbf57;
}

/* ---- LANG FLAG BUTTONS ---- */
.lang-flag-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: transparent;
    color: #9ca3af;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.03em;
}
.lang-flag-btn .fi {
    display: inline-block !important;
    width: 20px !important;
    height: 15px !important;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    background-size: cover !important;
    vertical-align: middle;
    flex-shrink: 0;
}
.lang-flag-btn:hover {
    color: #1f9a45;
    background: rgba(47,191,87,0.08);
    border-color: rgba(47,191,87,0.2);
}
.lang-flag-btn.active {
    color: #1f9a45;
    background: rgba(47,191,87,0.10);
    border-color: rgba(47,191,87,0.25);
    font-weight: 700;
}

/* ---- ГАМБУРГЕР ---- */
.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 24px;
    cursor: pointer;
}
.hamburger-icon span {
    display: block;
    height: 3px;
    width: 100%;
    background: #1f9a45;
    border-radius: 2px;
    transition: all 0.3s ease;
}
.hamburger-icon.open span:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}
.hamburger-icon.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger-icon.open span:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

/* ---- МОБИЛЬНОЕ МЕНЮ ---- */
.mobile-menu {
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.35s ease;
}
.mobile-menu.open {
    transform: translateY(0);
    opacity: 1;
}

/* ---- FADE IN UP (общий) ---- */
.fade-in-up {
    opacity: 0;
    transform: translateY(14px);
    animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}
.delay-100  { animation-delay: 0.1s; }
.delay-200  { animation-delay: 0.2s; }
.delay-300  { animation-delay: 0.3s; }
.delay-400  { animation-delay: 0.4s; }
.delay-500  { animation-delay: 0.5s; }

/* ---- КНОПКА GRADIENT ---- */
.gradient-button {
    background-image: linear-gradient(135deg, #2fbf57 0%, #1f9a45 100%);
    transition: filter 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 20px rgba(47,191,87,0.30);
}
.gradient-button:hover {
    filter: brightness(1.08);
    box-shadow: 0 8px 28px rgba(47,191,87,0.42);
}

/* ================================================
   ХЕДЕР — компактные стили v2 (С защитой от переполнения)
   ================================================ */

/* Безопасное позиционирование flex-контейнеров внутри самого хедера */
header .max-w-7xl > div {
    flex-wrap: nowrap !important; /* Шапка никогда не развалится на две строки */
    gap: 12px !important;         /* Зазор безопасности между логотипом, меню и кнопками */
}

/* Защита логотипа и правой панели от сдавливания длинным текстом */
header .flex-shrink-0,
header .hidden.md\:flex.items-center {
    flex-shrink: 0 !important;
}

/* Умная десктопная навигация */
header nav {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center !important;
    overflow-x: auto;            /* Если пунктов станет критически много, появится аккуратный свайп без поломки хедера */
    scrollbar-width: none;       /* Скрываем дефолтный скроллбар в Firefox */
}
header nav::-webkit-scrollbar {
    display: none;               /* Скрываем дефолтный скроллбар в Chrome/Safari */
}

/* Десктоп ссылки */
.nav-link {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #4b5563;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.18s ease, background 0.18s ease;
}
.nav-link:hover {
    color: #1f9a45;
    background: rgba(47,191,87,0.07);
}
.nav-link.active-nav {
    color: #1f9a45;
    font-weight: 700;
    background: rgba(47,191,87,0.08);
    border-bottom: 2px solid #2fbf57;
    border-radius: 7px 7px 0 0;
}

/* Компактный переключатель языка */
.lang-flag-btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 7px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.lang-flag-btn-sm:hover {
    color: #1f9a45;
    background: rgba(255,255,255,0.8);
}
.lang-flag-btn-sm.active {
    color: #1f9a45;
    background: white;
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

/* Флажок маленький */
.flag-xs {
    display: inline-block !important;
    width: 16px !important;
    height: 12px !important;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.20);
    background-size: cover !important;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Кнопки справа */
.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.header-btn-green {
    background: #2fbf57;
    color: #fff;
    box-shadow: 0 2px 8px rgba(47,191,87,0.30);
}
.header-btn-green:hover {
    background: #1f9a45;
    box-shadow: 0 4px 12px rgba(47,191,87,0.40);
}
.header-btn-wa {
    background: #25d366;
    color: #fff;
    font-size: 1rem;
    padding: 5px 10px;
    box-shadow: 0 2px 8px rgba(37,211,102,0.30);
}
.header-btn-wa:hover {
    background: #1ebe5d;
}

/* Мобильные ссылки */
.mobile-nav-link {
    display: block;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: color 0.18s ease, background 0.18s ease;
}
.mobile-nav-link:hover {
    color: #1f9a45;
    background: rgba(47,191,87,0.07);
}
.mobile-nav-link.active-nav {
    color: #1f9a45;
    font-weight: 700;
    background: rgba(47,191,87,0.08);
}