/* Responsive Styles */

/* Large Screens (1200px и меньше) */
@media screen and (max-width: 1200px) {
    .container {
        max-width: 960px;
    }

    #hero:not(.new-hero-style) .hero-content h1 {
        font-size: 2.5rem;
    }

    .new-hero-style .hero-content h1 {
        font-size: 3rem;
    }

    .new-hero-style .animated-word-container,
    .new-hero-style .animated-word {
        height: calc(3rem * var(--new-hero-h1-line-height));
        line-height: calc(3rem * var(--new-hero-h1-line-height));
    }
}

/* Medium Screens (992px и меньше) */
@media screen and (max-width: 992px) {
    .container {
        max-width: 720px;
    }

    header:not(.new-header-style) .main-nav ul {
        gap: 1.5rem;
    }

    #hero:not(.new-hero-style) .hero-content h1 {
        font-size: 2.25rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .about-content,
    .contact-wrapper {
        flex-direction: column;
    }

    .footer-content {
        gap: 2rem;
    }

    .new-header-style .main-nav {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: white;
        height: 0;
        overflow: hidden;
        transition: height 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        visibility: hidden;
        opacity: 0;
        z-index: 999;
        padding: 0;
    }

    .new-header-style .main-nav.active {
        display: block;
        height: auto;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        visibility: visible;
        opacity: 1;
        padding: 0.5rem 0;
    }

    .new-header-style .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0;
    }

    .new-header-style .main-nav ul li {
        width: 100%;
        border-bottom: 1px solid var(--light-gray);
    }

    .new-header-style .main-nav ul li:last-child {
        border-bottom: none;
    }

    .new-header-style .main-nav ul li a {
        display: block;
        padding: 0.9rem 1.5rem;
        color: var(--dark-color);
        font-weight: 500;
    }

    .new-header-style .main-nav ul li a:hover {
        background-color: var(--light-color);
    }

    .new-header-style .main-nav ul li a::after {
        display: none;
    }

    header.new-header-style .main-nav ul li.mobile-lang-switcher-item {
        display: none;
        padding: 0;
        background-color: #f8f9fa;
        border-top: 1px solid var(--light-gray);
    }

    header.new-header-style .main-nav.active ul li.mobile-lang-switcher-item {
        display: block;
    }

    .new-header-style .main-nav .language-switcher.mobile-menu-lang {
        padding: 0.9rem 1.5rem;
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.3em;
    }

    .new-header-style .main-nav .language-switcher.mobile-menu-lang a,
    .new-header-style .main-nav .language-switcher.mobile-menu-lang strong {
        font-size: var(--font-md);
        color: var(--gray-color);
        text-decoration: none;
        padding: 0.2em;
        line-height: 1;
    }

    .new-header-style .main-nav .language-switcher.mobile-menu-lang strong {
        color: var(--primary-color);
        font-weight: bold;
    }

    .new-header-style .main-nav .language-switcher.mobile-menu-lang .lang-separator {
        color: var(--gray-color);
        margin: 0;
        line-height: 1;
    }

    .new-header-style .header-actions {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .new-header-style .header-actions .desktop-lang-switcher {
        display: none;
    }

    .new-header-style .header-actions .btn-leave-request {
        padding: 0.5rem 1rem;
        font-size: calc(var(--font-sm) * 0.9);
        order: 1;
    }

    .new-header-style .menu-toggle {
        display: flex !important;
        order: 2;
    }

    .new-hero-style .hero-content h1 {
        font-size: 2.5rem;
    }

    .new-hero-style .animated-word-container,
    .new-hero-style .animated-word {
        height: calc(2.5rem * var(--new-hero-h1-line-height));
        line-height: calc(2.5rem * var(--new-hero-h1-line-height));
    }

    .hero-background-shape {
        height: 330px;
        /* Высота фигуры остается */
        /* ИЗМЕНЕНИЕ ТОЛЬКО ЗДЕСЬ: Поднимаем фигуру выше */
        transform: translate(-50%, -70%) scaleY(0.55);
        /* Было -60%. Попробуйте -70% или -75% */
    }
}

/* Small Screens (768px и меньше) */
@media screen and (max-width: 768px) {
    .container {
        max-width: 540px;
    }

    header:not(.new-header-style) .menu-toggle {
        display: flex;
    }

    header:not(.new-header-style) .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: white;
        height: 0;
        overflow: hidden;
        transition: var(--transition);
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        visibility: hidden;
        opacity: 0;
    }

    header:not(.new-header-style) .main-nav.active {
        height: auto;
        visibility: visible;
        opacity: 1;
        padding: 1rem 0;
    }

    header:not(.new-header-style) .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0 1rem;
    }

    header:not(.new-header-style) .main-nav ul li {
        width: 100%;
        border-bottom: 1px solid var(--light-gray);
    }

    header:not(.new-header-style) .main-nav ul li:last-child {
        border-bottom: none;
    }

    header:not(.new-header-style) .main-nav ul li a {
        display: block;
        padding: 1rem 0;
    }

    header:not(.new-header-style) .main-nav ul li a::after {
        display: none;
    }

    #hero:not(.new-hero-style) {
        min-height: 500px;
    }

    #hero:not(.new-hero-style) .hero-content h1 {
        font-size: 2rem;
    }

    #hero:not(.new-hero-style) .hero-content p {
        font-size: 1rem;
    }

    #hero:not(.new-hero-style) .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    #hero:not(.new-hero-style) .hero-buttons .btn {
        width: 100%;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    .portfolio-filter {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        flex-direction: column;
        gap: 1.5rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-policy {
        justify-content: center;
    }

    .new-header-style .header-actions .btn-leave-request {
        padding: 0.4rem 0.8rem;
        font-size: calc(var(--font-sm) * 0.85);
    }

    .new-header-style .main-nav.active {
        top: 50px;
        max-height: calc(100vh - 50px);
    }

    .new-hero-style {
        min-height: auto;
        padding-top: 2.2rem;
        padding-bottom: 2.2rem;
    }

    .new-hero-style .hero-content h1 {
        font-size: 2.3rem;
        font-weight: 700;
        line-height: 1.25;
    }

    .hero-first-line-wrapper {
        display: block;
        text-align: center;
    }

    .static-text-part {
        display: block;
        margin-bottom: 0;
        padding-right: 0;
    }

    .animated-word-container {
        display: block;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
        margin-bottom: 0;
    }

    /* Оставил ваш margin-bottom: 0.4em здесь */
    .new-hero-style .animated-word-container,
    .new-hero-style .animated-word {
        font-size: larger;
        height: calc(2.3rem * 1.25);
        line-height: calc(2.3rem * 1.25);
    }

    .new-hero-style .animated-word {
        text-align: center;
    }

    .hero-background-shape {
        height: 280px;
        /* Высота фигуры остается */
        /* ИЗМЕНЕНИЕ ТОЛЬКО ЗДЕСЬ: Поднимаем фигуру выше */
        transform: translate(-50%, -75%) scaleY(0.40);
        /* Было -55% и 0.45. Попробуйте -75% и 0.40 или -80% */
    }

    #about {
        padding-top: 2.2rem;
    }
}

/* Extra Small Screens (576px и меньше) */
@media screen and (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    .section-header p {
        font-size: 1rem;
    }

    .service-card {
        padding: 1.5rem;
    }

    .service-icon {
        width: 60px;
        height: 60px;
    }

    .service-icon img {
        width: 30px;
        height: 30px;
    }

    .contact-item {
        flex-direction: column;
        text-align: center;
    }

    .contact-icon {
        margin: 0 auto 1rem;
    }

    .contact-text {
        width: 100%;
        text-align: center;
    }

    .footer-content {
        text-align: center;
    }

    .footer-column h3::after,
    .footer-social h3::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .social-icons {
        justify-content: center;
    }

    #hero:not(.new-hero-style) .hero-content h1 {
        font-size: 1.75rem;
    }

    .new-header-style .header-actions .btn-leave-request {
        padding: 0.4rem 0.6rem;
        font-size: calc(var(--font-sm) * 0.75);
    }

    .new-header-style .main-nav.active {
        top: 48px;
        max-height: calc(100vh - 48px);
    }

    .new-hero-style {
        padding-top: 1.8rem;
        padding-bottom: 1.8rem;
    }

    .new-hero-style .hero-content h1 {
        font-size: 2.05rem;
        font-weight: 700;
        line-height: 1.2;
    }

    .static-text-part {
        margin-bottom: 0.5em;
    }

    .animated-word-container {
        margin-bottom: 0;
    }

    /* Оставил ваш margin-bottom: 0.4em здесь */
    .new-hero-style .animated-word-container,
    .new-hero-style .animated-word {
        height: calc(2.05rem * 1.2);
        line-height: calc(2.05rem * 1.2);
    }

    .new-hero-style .animated-word {
        text-align: center;
    }

    .hero-background-shape {
        height: 230px;
        /* Высота фигуры остается */
        /* ИЗМЕНЕНИЕ ТОЛЬКО ЗДЕСЬ: Поднимаем фигуру выше */
        transform: translate(-50%, -80%) scaleY(0.35);
        /* Было -50% и 0.4. Попробуйте -80% или -85% */
    }

    #about {
        padding-top: 1.8rem;
    }

    #floating-contact-widget {
        bottom: 15px;
        left: 15px;
        gap: 8px;
    }

    #floating-contact-widget .contact-icon {
        width: 45px;
        height: 45px;
    }

    #floating-contact-widget .contact-icon svg {
        width: 20px;
        height: 20px;
    }

    #floating-chatbot-widget {
        bottom: 15px;
        right: 15px;
    }

    #floating-chatbot-widget #chatbot-toggle-button {
        width: 45px;
        height: 45px;
    }

    #floating-chatbot-widget #chatbot-toggle-button svg {
        width: 20px;
        height: 20px;
    }

    .chatbot-bubble {
        padding: 6px 10px;
        font-size: var(--font-xs);
        margin-right: 8px;
    }

    .chatbot-bubble::after {
        border-width: 5px;
        right: -5px;
    }

    #chatbot-popup {
        width: calc(100vw - 30px);
        height: calc(100vh - 90px);
        max-height: none;
        right: 15px;
        bottom: 70px;
    }

    #chatbot-title {
        font-size: var(--font-md);
    }
}