@media screen and (max-width: 768px) {
    main#app-content {
        flex-grow: 1;
    }
    body {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        overflow-wrap: break-word;
    }

    #home.section-padded {
        flex-direction: column;
        gap: 20px;
        padding-top: 6.5rem;
        hyphens: auto;
    }

    #home .left-section, 
    #home .right-section {
        width: 100%;
    }

    .right-section #bg-video {
        width: 100%;
        height: auto;
        margin: 0;
    }

    #home .home-text h1 {
        font-size: clamp(1.5rem, 4vw + 1rem, 3rem);
        line-height: 0.9;
    }

    #home .home-text h2 {
        font-size: clamp(1rem, 2.5vw + 1rem, 2rem);
        line-height: 1;
    }

    #home .home-text h1, .home-text h2 {
        text-align: left;
        width: auto;
        margin: 1rem;
    }

    .logo, .hamburger-toggle {
        display: block;
        z-index: 2001;
        position: relative;
    }

    .main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #ffffff;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    z-index: 100;
    transform: translateY(3rem);
    opacity: 0; 
    visibility: hidden;
    transition: transform 0.6s ease-in-out, opacity 0.3s ease-in-out;
    }

    .main-nav.active {
    transform: translateY(6.5rem);
    opacity: 1;
    visibility: visible;
    }

    .main-nav ul {
        margin: 0;
        padding: 10px 0;
        display: flex;
        flex-direction: column;
    }

    .main-nav li {
        width: 100%;
        list-style: none;
    }

    .main-nav li a {
        display: block;
        text-align: center;
        padding: 20px;
        color: rgb(36, 128, 76); 
        font-size: 1.2rem;
        text-decoration: none;
    }

    #home.section-padded {
        flex-direction: column;
        gap: 20px;
        padding-top: 6.5rem;
    }

    #home .left-section, 
    #home .right-section {
        width: 100%;
    }

    .right-section #bg-video {
        width: 100%;
        height: auto;
        margin-right: 0;
    }

    /* Начало блока advantages.html */
    .advantages-grid {
    margin: 5rem 1rem;
    }
    /* Конец блока advantages.html */

    /*Начало куска медиа конкретно для страницы portfolio.html */
    section#portfolio.content {
        flex-direction: column;
        flex-wrap: wrap;
        padding: 7rem 0.5rem 0.5rem 0.5rem;
    }

    #portfolio aside.left-sidebar,
    #portfolio main.right-sidebar {
        width: 100%;
        border-radius: 20px;
    }

    #portfolio .left-sidebar h2 {
        grid-column: 1/-1;
    }

    #portfolio aside.left-sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        align-items: start;
        text-align: center;
    }

    #portfolio .left-sidebar {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }

    main.right-sidebar {
        margin-bottom: 5rem;
    }

    main.right-sidebar .slider-viewport .product-card {
        margin: 0 auto;
    }

    /* Медиа для pop-up страницы portfolio */
    .pop-up-window {
        max-width: 100vw;
        max-height: 100vh;
        margin: auto;
    }

    .pop-up-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .pop-up-info h2 {
        font-size: 1.4rem;
    }

    .close-btn {
        top: 10px;
        right: 15px;
    }
    
    /* Конец медиа для pop-up */
    /* Конец куска медиа конкретно для страницы portfolio.html */

    #contact .section-padded h1 {
        font-size: 2rem;
    }

    #contact .section-padded h2 {
        font-size: 1.2rem;
    }

    footer .second {
        display: flex;
        flex-direction: column;
    }

    .footer-meta {
        display: flex; 
        align-items: center;
        margin: 1rem 0rem;
        text-align: center;
    }

    .footer-policy {
        margin: 0;
    }
}

@media screen and (max-width: 480px) {
    main#app-content {
        flex-grow: 1;
    }
    body {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        overflow-wrap: break-word;
    }

    #home.section-padded {
        flex-direction: column;
        gap: 20px;
        padding-top: 6.5rem;
    }

    #home .left-section, 
    #home .right-section {
        width: 100%;
    }

    /* Начало куска медиа конкретно для страницы portfolio.html */
    section#portfolio.content {
        flex-direction: column;
        flex-wrap: wrap;
        padding: 7rem 0.5rem 0.5rem 0.5rem;
    }

    #portfolio aside.left-sidebar,
    #portfolio main.right-sidebar {
        width: 100%;
        border-radius: 20px;
    }

    #portfolio aside.left-sidebar {
        text-align: left;
    }

    main.right-sidebar .slider-viewport .product-card {
        margin: 0 auto;
    }
    /* Конец куска медиа конкретно для страницы portfolio.html */

    .right-section #bg-video {
        width: 100%;
        height: auto;
        margin: 0;
    }

    #home .home-text h1 {
        font-size: clamp(1.5rem, 4vw + 1rem, 3rem);
        line-height: 0.9;
    }

    #home .home-text h2 {
        font-size: clamp(1rem, 2.5vw + 1rem, 2rem);
        line-height: 1;
    }

    #home .home-text h1, .home-text h2 {
        text-align: left;
        width: auto;
        margin: 1rem;
    }

    /* Начало куска медиа конкретно для блока reviews.html */
    .reviews-section {
        margin: 5rem 1rem 0 1rem;
    }
    /* Конец куска медиа конкретно для блока reviews.html */

    #contact .section-padded h1 {
        font-size: 2rem;
    }

    #contact .section-padded h2 {
        font-size: 1.2rem;
    }

    #contact ul {
        text-indent: 0rem;
    }

    .section-padded p {
        margin-left: 10px;
        text-indent: 0;
    }

    .social-links {
        display: flex;
        align-items: center;
        gap: 1rem; 
    }

    footer .second {
        display: flex;
        flex-direction: column;
    }

    .footer-meta {
        display: flex; 
        align-items: center;
        margin: 1rem 0rem;
        text-align: center;
    }

    .footer-policy {
        margin: 0;
    }
}
