/* ===========================
   МОБІЛЬНІ СТИЛІ
   Для пристроїв з шириною до 1024px
   =========================== */

/* ===========================
   Планшети та малі екрани (до 1024px)
   =========================== */

@media (max-width: 1024px) {
    .burger-menu {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background-color: #ffffff;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
        border-bottom: 3px solid #0066cc;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        padding: 0;
        margin: 0;
    }

    .nav-menu.active {
        max-height: 600px;
        padding: 0.5rem 0;
    }

    .nav-menu a {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .dropdown-menu {
        position: static;
        opacity: 0;
        visibility: hidden;
        transform: none;
        background-color: transparent;
        box-shadow: none;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .dropdown:hover .dropdown-menu {
        opacity: 0;
        visibility: hidden;
        max-height: 0;
    }

    .dropdown.active .dropdown-menu {
        opacity: 1;
        visibility: visible;
        max-height: 500px;
        background-color: var(--light-blue);
        padding: 0.3rem 0;
        margin-top: 0.2rem;
        border-radius: 5px;
    }

    .dropdown-menu a {
        padding-left: 1.6rem;
        padding: 0.6rem 1rem;
        font-size: 0.88rem;
    }

    .section-content h2,
    .features h2 {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: 2rem 1.5rem;
    }

    .feature-icon {
        font-size: 2.8rem;
    }

    .feature-card h3 {
        font-size: 1.3rem;
    }

    footer .container {
        flex-direction: column;
        text-align: center;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .navbar .container {
        position: relative;
    }
}

/* ===========================
   Хідер на табелтах (768px)
   =========================== */

@media (max-width: 768px) {
    .navbar {
        padding: 0 !important;
        display: flex !important;
        flex-wrap: wrap !important;
    }

    .navbar .container {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 0.3rem !important;
        gap: 0 !important;
        min-height: 55px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        flex: 1 0 100%;
    }

    .logo {
        flex: 0 0 auto !important;
        font-size: 1.3rem;
        display: flex !important;
        align-items: center !important;
        gap: 0.1rem;
        height: 55px !important;
        padding: 0 !important;
        white-space: nowrap !important;
    }

    .logo-image {
        height: 40px !important;
        width: auto !important;
        margin-right: 0 !important;
    }

    .logo-text {
        font-size: 0.95rem !important;
        font-weight: 700 !important;
        letter-spacing: 0.5px;
        color: #0066cc !important;
        white-space: nowrap !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1 !important;
    }

    /* Бургер меню */
    .burger-menu {
        display: flex !important;
        margin-left: auto !important;
        padding: 0.3rem 0.3rem !important;
        gap: 5px !important;
        flex: 0 0 auto !important;
        background: none !important;
        border: none !important;
        cursor: pointer !important;
    }

    .burger-menu span {
        display: block !important;
        width: 24px !important;
        height: 2.5px !important;
        background: #0066cc !important;
        margin: 4px 0 !important;
        transition: all 0.3s ease !important;
    }

    /* Навігаційне меню поза контейнером */
    .nav-menu {
        width: 100% !important;
        flex: 1 0 100%;
    }

    /* Навігаційне меню */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 55px;
        flex-direction: column;
        background: linear-gradient(180deg, #ffffff 0%, #f5f7ff 50%, #ffffff 100%);
        width: 100%;
        text-align: left;
        transition: left 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        box-shadow: 0 15px 50px rgba(0, 102, 204, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.8);
        gap: 0;
        padding: 0;
        max-height: calc(100vh - 55px);
        overflow-y: auto;
        overflow-x: hidden;
        margin-left: 0 !important;
    }

    .nav-menu::-webkit-scrollbar {
        width: 6px;
    }

    .nav-menu::-webkit-scrollbar-track {
        background: transparent;
    }

    .nav-menu::-webkit-scrollbar-thumb {
        background: #0066cc;
        border-radius: 3px;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        width: 100%;
        margin: 0;
    }

    .nav-menu a {
        display: block;
        padding: 1.2rem 1.5rem;
        width: 100%;
        border-bottom: 1px solid rgba(0, 102, 204, 0.06);
        color: #0066cc;
        font-weight: 500;
        font-size: 0.95rem;
        transition: all 0.25s ease;
        position: relative;
    }

    .nav-menu a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 4px;
        background: #ff8c00;
        transform: scaleY(0);
        transition: transform 0.3s ease;
    }

    .nav-menu a:hover {
        background: linear-gradient(90deg, rgba(0, 102, 204, 0.08) 0%, transparent 100%);
        color: #ff8c00;
        padding-left: 1.8rem;
    }

    .nav-menu a:hover::before {
        transform: scaleY(1);
    }

    .nav-menu a.active {
        background: linear-gradient(90deg, rgba(0, 102, 204, 0.15) 0%, transparent 100%);
        color: #0066cc;
        font-weight: 600;
        border-left: 4px solid #0066cc;
        padding-left: 1.2rem;
    }

    /* Dropdown меню на мобільних */
    .dropdown-toggle {
        justify-content: space-between;
        width: 100%;
        padding: 1.2rem 1.5rem;
        align-items: center;
        font-weight: 600;
        display: flex;
    }

    .dropdown-toggle::after {
        content: '›';
        font-size: 1.8rem;
        margin-left: auto;
        transition: transform 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        font-weight: bold;
        color: #0066cc;
        line-height: 1;
        display: flex;
        align-items: center;
        margin-top: -2px;
    }

    .dropdown.active .dropdown-toggle::after {
        transform: rotate(90deg);
        color: #ff8c00;
    }

    .dropdown-menu {
        position: static;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        transform: none;
        background: white;
        box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.03);
        border-radius: 0;
        min-width: unset;
        transition: all 0.3s ease;
        margin-top: 0;
    }

    .dropdown.active .dropdown-menu {
        opacity: 1;
        visibility: visible;
        max-height: 500px;
    }

    .dropdown-menu li {
        background: white;
    }

    .dropdown-menu a {
        padding: 1rem 1.5rem 1rem 3.5rem;
        border-bottom: 1px solid rgba(0, 102, 204, 0.04);
        color: #0066cc;
        font-size: 0.9rem;
        font-weight: 500;
    }

    .dropdown-menu a::before {
        left: 2.5rem;
    }

    .dropdown-menu a:hover {
        background: linear-gradient(90deg, rgba(0, 102, 204, 0.08) 0%, transparent 100%);
        padding-left: 3.8rem;
        color: #ff8c00;
    }

    /* Мовні кнопки */
    .language-switcher {
        margin-left: 0;
        width: 100%;
        border-top: 2px solid rgba(0, 102, 204, 0.12);
        padding: 1.2rem 0;
        background: linear-gradient(180deg, rgba(0, 102, 204, 0.02) 0%, transparent 100%);
    }

    .language-btn {
        width: calc(100% - 3rem);
        margin: 0 1.5rem;
        color: white;
        background: linear-gradient(135deg, #0066cc 0%, #003d82 100%);
        border: none;
        padding: 0.95rem 1.5rem;
        border-radius: 6px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        box-shadow: 0 4px 15px rgba(0, 102, 204, 0.2);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-size: 0.85rem;
    }

    .language-btn:hover {
        background: linear-gradient(135deg, #ff8c00 0%, #ff6b35 100%);
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(255, 140, 0, 0.3);
    }

    .language-btn:active {
        transform: translateY(-1px);
    }


    /* Контейнер навбару */
    .navbar .container {
        padding: 0 1rem;
        justify-content: flex-start;
    }

    /* Інші сторінки */
    .nav-menu {
        gap: 0.5rem;
    }

    .nav-menu a {
        font-size: 0.9rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .section-content h2,
    .features h2 {
        font-size: 1.8rem;
    }

    .logo {
        font-size: 1.4rem;
    }

    .language-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* ===========================
   Мобільні телефони (до 600px)
   =========================== */

@media (max-width: 600px) {
    /* Хідер */
    .navbar {
        padding: 0.4rem 0;
        border-bottom: 2px solid #0066cc;
    }

    .navbar .container {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 0.3rem !important;
        gap: 0.6rem !important;
        min-height: 50px !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .logo {
        height: 50px !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.1rem !important;
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        order: 1;
    }

    .logo-image {
        height: 40px !important;
        width: auto !important;
        margin-right: 0 !important;
    }

    .logo-text {
        font-size: 0.9rem !important;
        font-weight: 700 !important;
        color: #0066cc !important;
        white-space: nowrap !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1 !important;
    }

    /* Бургер меню */
    .burger-menu {
        display: flex !important;
        margin-left: auto !important;
        padding: 0.3rem 0.3rem !important;
        gap: 4px !important;
        flex: 0 0 auto !important;
        order: 2;
    }

    .burger-menu span {
        width: 24px !important;
        height: 2.5px !important;
        gap: 4px !important;
    }

    /* Навігаційне меню */
    .nav-menu {
        top: 50px;
        max-height: calc(100vh - 50px);
    }

    .nav-menu a {
        padding: 1rem 1.2rem;
        font-size: 0.9rem;
    }

    .dropdown-toggle {
        padding: 1rem 1.2rem;
    }

    .dropdown-toggle::after {
        font-size: 1.5rem;
        margin-top: -1px;
    }

    .dropdown-menu a {
        padding: 0.85rem 1.2rem 0.85rem 3rem;
    }

    /* Мовні кнопки */
    .language-btn {
        padding: 0.8rem 1rem;
        font-size: 0.75rem;
        letter-spacing: 0px;
    }

    /* Заголовки */
    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    /* Додаткові стилі для малих екранів */
    .container {
        padding: 0 1rem;
    }

    .section {
        padding: 2rem 0;
    }

    .feature-card {
        padding: 1.5rem 1rem;
    }

    .feature-icon {
        font-size: 2rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        width: 100%;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    /* Таблиці та контент */
    table {
        font-size: 0.85rem;
    }

    /* Форми */
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="tel"],
    textarea,
    select {
        width: 100%;
        padding: 0.8rem;
        font-size: 1rem;
    }

    /* Списки */
    ul, ol {
        padding-left: 1.2rem;
    }

    li {
        margin-bottom: 0.5rem;
    }
}

/* ===========================
   Дуже малі екрани (до 480px)
   =========================== */

@media (max-width: 480px) {
    /* Хідер */
    .navbar {
        padding: 0.35rem 0;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0.3rem 0.3rem !important;
        gap: 0 !important;
        min-height: 48px !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .logo {
        height: 48px !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.1rem !important;
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        order: 1;
    }

    .logo-image {
        height: 35px !important;
        width: auto !important;
        margin-right: 0 !important;
    }

    .logo-text {
        font-size: 0.85rem !important;
        font-weight: 700 !important;
        color: #0066cc !important;
        white-space: nowrap !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1 !important;
    }

    /* Бургер меню */
    .burger-menu {
        display: flex !important;
        margin-left: auto !important;
        padding: 0.3rem 0.3rem !important;
        gap: 4px !important;
        flex: 0 0 auto !important;
        order: 2;
    }

    .burger-menu span {
        width: 22px !important;
        height: 2px !important;
    }

    /* Навігаційне меню */
    .nav-menu {
        top: 48px;
        max-height: calc(100vh - 48px);
        padding: 0;
    }

    .nav-menu a {
        padding: 0.9rem 1rem;
        font-size: 0.85rem;
    }

    .dropdown-toggle {
        padding: 0.9rem 1rem;
        font-size: 0.85rem;
    }

    .dropdown-toggle::after {
        font-size: 1.5rem;
        margin-top: -1px;
    }

    .dropdown-menu a {
        padding: 0.75rem 1rem 0.75rem 2.8rem;
        font-size: 0.8rem;
    }

    /* Мовні кнопки */
    .language-btn {
        padding: 0.7rem 0.8rem;
        font-size: 0.7rem;
        margin: 0 1rem;
        width: calc(100% - 2rem);
    }

    /* Основний контент */
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1rem;
    }

    .feature-card {
        padding: 1rem;
    }

    .feature-icon {
        font-size: 1.8rem;
    }

    /* Форми */
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="tel"],
    textarea,
    select {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
}

/* ===========================
   Десктоп (більше 768px)
   =========================== */

@media (min-width: 769px) {
    .burger-menu {
        display: none !important;
    }

    /* Восстановление оригинального размера логотипа на десктопе */
    .logo {
        font-size: 1.5rem !important;
        height: auto !important;
        gap: 0.5rem !important;
    }

    .logo-image {
        height: 50px !important;
        width: auto !important;
        margin-right: 0 !important;
    }

    .logo-text {
        font-size: 1.2rem !important;
        font-weight: 700 !important;
        color: #0066cc !important;
        letter-spacing: 1px !important;
    }
}
