@media (max-width: 768px) {
    html, body {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    body {
        overflow-x: hidden;
        position: relative;
    }
    
    #main_section {
        min-height: 100vh;
        height: 100%;
    }
    /* ==================== HEADER ==================== */
    header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 70px;
        z-index: 1000; /* Убедитесь, что он выше всего */
        box-sizing: border-box; /* Чтобы padding не раздувал ширину */
        
        /* Добавьте это для iOS Safari */
        -webkit-transform: translateZ(0); 
        transform: translateZ(0);
        
        /* Уберите лишнее */
        margin-top: 0px;
        padding-left: 10px;
        padding-right: 10px;
    }

    header .header-container{
        align-items: flex-start;
    }

    /* Хедер становится белым при скролле */
    header.header--white {
        background-color: #FFFFFF !important;
        background-image: none !important;
        transition: background-color 0.25s ease;
    }

    /* Логотип и текст — голубые */
    header.header--white #name,
    header.header--white #name2,
    header.header--white .logo a {
        color: var(--color-primary) !important;
    }

    /* Линии бургера — голубые */
    header.header--white .menu__btn > span,
    header.header--white .menu__btn > span::before,
    header.header--white .menu__btn > span::after {
        background-color: var(--color-primary) !important;
    }

    /* Чтобы крестик тоже был голубым */
    #menu__toggle:checked ~ .menu__btn > span,
    #menu__toggle:checked ~ .menu__btn > span::before,
    #menu__toggle:checked ~ .menu__btn > span::after {
        background-color: var(--color-primary) !important;
    }


    /* Основной контейнер header теперь flex с тремя частями */
    .logo {
        flex: 1;
    }

    /* Название агентства по центру */
    #name2 {
        position: absolute;
        left: 59%;
        top: 50%;
        transform: translate(-50%, -50%);
        font-size: 12px;
        text-align: left;
        
        width: 140px;
    }

    #name {
        font-size: 20px;
        line-height: 1;
        margin: 0;
        padding-top: 20px;
    }

    /* Скрываем десктопное меню */
    .headerNav, .media {
        display: none;
    }

    .hamburger-menu {
        display: block;
        flex: 0 0 auto;
        z-index: 102;
    }

    .media_s{
        margin-top: 30px;
        display: flex;
    }

    .media_s #tg img{
        width: 36px;
    }
    /* Кнопка бургера */
    .menu__btn {
        position: relative;
        top: 0;
        right: 0;
        width: 32px;
        height: 32px;
    }

    /* ==================== БУРГЕР МЕНЮ ==================== */
    .menu__box {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: linear-gradient(-150deg, #a2cfef 0%, #90BCDB 20%, #2375ac 100%);
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        z-index: 101;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
        padding-top: 90px;
        overflow-y: auto;

    }

    .menu__btn {
        position: fixed;           /* Изменено с relative на fixed */
        top: 20px;                 /* Отступ сверху */
        right: 25px;               /* Отступ справа */
        width: 32px;
        height: 32px;
        z-index: 999;              /* Очень высокий приоритет */
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #menu__toggle:checked ~ .menu__box {
        transform: translateX(0);
    }

    #menu__toggle:checked ~ .menu__btn > span,
    #menu__toggle:checked ~ .menu__btn > span::before,
    #menu__toggle:checked ~ .menu__btn > span::after {
        background-color: var(--color-bg-light);
    }

    /* Блокировка скролла */
    body.menu-open {
        overflow: hidden;
    }

    /* Логотип A&Z в меню */
    #A_Z img {
        width: 300px;
        margin: 30px auto 0;
        display: block;
        margin-left: 16.5%;
    }

    #main_section{
        height: 430px;
        position: relative; 
    }

    .slogan{
        padding: 0px 10px;
        font-size: 30px;
        color: #fff;
        padding-top: 80px;
        font-weight: 600;
        width: 300px;
        display: block;
        margin: 0;
    }

    .slogan br{
        display: none;
    }

    .slogan_2 {
        font-size: 15px;
        margin-top: -20px;
        width: 320px;
    }

    .button-container {
        padding-top: 20px;
        padding-left: 10px;
    }
    
    .button_tg {
        padding: 12px 25px; /* Чуть меньше на экранах телефонов */
    }
    
    .button_tg p, .button_tg span {
        font-size: 16px;
    }

    .a_z_img {
        position: absolute;
        bottom: 10px;
        right: 0px;
        z-index: 10;
        top: 85%;
    }

    .a_z_img img {
        width: 250px;
        height: auto;
        display: block;
    }
    /*Миссия*/
    .mission-section{
        margin-bottom: 20px;
        margin-top: 40px;
    }

    .section-title {
        font-size: 23px;
        padding: 0 10px;
        margin-bottom: 0;
    }

    #mission-title {
        padding: 0;
    }

    .container{
        padding: 0 10px;
        display: flex;
        flex-direction: column;
    }

    .mission-description p{
        font-size: 15px;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .mission-stats {
        margin-top: 10px;
        padding-top: 0;
        margin-bottom: 10px;
    }
    .stat-number {
        font-size: 50px;
    }

    .stat-text {
        font-size: 12.45px;
    }

    .clients-section {
        padding-top: 30px;
        margin-bottom: 30px;
    }

    .clients-grid {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        grid-gap: 20px 20px; 
        padding-top: 20px;
    }

    .image-wrapper {
        margin-bottom: 10px;
    }

    .cases-section {
        padding-top: 20px;
        padding-bottom: 0px;
        padding-left: 10px;
        padding-right: 10px;
        margin-bottom: 50px;
    }

    #main-title {
        margin-bottom: 0px;
        padding-left: 0;
    }

    .case-name {
        font-size: 20px;
    }

    .case-card:nth-child(even) .case-name {
        margin-left: 0%;
    }
    
    .case-info p {
        font-size: 13px;
    }

    .case-info li {
        font-size: 13px;
    }

    .case-images {
        margin-top: 30px;
        gap: 10px;
        height: 300px;
        padding-top: 0px;
        height: 250px;
    }


    .img-wrapper {
        height: 100px;
        border-radius: 20px; 
    }

    .features {
        margin-top: 70px;
        margin-bottom: 40px;
    }

    .features__grid {
        margin-top: 20px;
    }

    .features__list {
        gap: 50px;
    }

    .feature-item {
        flex: 1 1 100%; 
    }

    .feature-item p{
        width: 250px;
    }

    .feature-item img {
        width: auto;         
        height: 60px;
        margin-bottom: 10px;   
    }

    .inst-pro {
        padding: 10px 0px;
        margin-top: 30px;
    }

    .insta-pro {
        padding-left: 10px;
        padding-right: 10px;
    }

    .pro-grid {
        padding: 15px 15px;
        margin-top: 20px;
    }

    .pro-grid p {
        width: 310px;
    }


    .price-inst{
        font-size: 20px;
    }
        
    .case-card {
        margin-bottom: 40px;
        padding-bottom: 0;
        gap: 0;
    }

    .object-inst {
        display: none;
    }

    .examples{
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .example{
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        margin-bottom: 50px;
    }

    .examples h2{
        font-size: 20px;
        margin-top: 30px;
        text-transform: lowercase;
    }

    .ex_img_phone img{
        width: 159px;
    }

    .ex_img img{
        width: 300px;
    }

    .feedback{
        margin-top: 30px;
        margin-bottom: 50px;
        text-align: center;
    }

    .feedback p{
        text-align: center;
        justify-content: center;
        align-items: center;
        width: 300px;
        margin-top: -30px;
    }

    .feedback img{
        width: 300px;
    }

    .quote-section {
        padding: 40px 10px;
        margin-bottom: 50px;
    }

    .custom-quote {
        gap: 5px; 
    }

    .custom-quote p {
        font-size: 18px;
        line-height: 1.2;
    }

    .custom-quote::before,
    .custom-quote::after {
        font-size: 70px; 
    }

    .backstage-section {
        padding: 0px;
        max-width: 1200px;
        margin: 0 auto;
        margin-bottom: 50px;
    }

    .backstage-section h2{
        padding-bottom: 20px;
    }

    .backstage-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr); 
        grid-gap: 10px;
    }

    .backstage-item {
        border-radius: 30px;   
    }

    .services-section {
        padding: 0 10px;
        margin-bottom: 50px;
    }

    .slider-btn {
        width: 32px;
        height: 32px;
        padding: 4px;
    }

    .slider-btn svg {
        width: 18px;
        height: 30px;
    }

    .services-section h2{
        padding-left: 0;
        padding-top: 20px;
    }

    .services-subtitle {
        margin: 0;
        margin-top: 10px;
        font-size: 25px;
        font-weight: lighter;
        padding-bottom: 10px;
    }

    .slider-container {
        position: relative;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0 5px;
    }

    .services-grid {
        display: flex;
        gap: 25px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 10px 0 20px;
        scrollbar-width: none;
    }

    .services-grid::-webkit-scrollbar {
        display: none;
    }

    .service-card {
        flex: 0 0 75%;           /* Основная карточка занимает ~78% ширины */
        min-width: 75%;
        height: 360px;
        border-radius: 10px;
        padding: 10px 20px;
    }

    .service-card h4 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .slider-btn {
        padding: 5px;
    }

    .tasks-section {
        padding: 0 10px;
        padding-bottom: 40px;
    }

    #tastk-title {
        margin-bottom: 10px;
        padding-top: 30px;
    }


    .tasks-section h2 {
        padding-left: 0;
        margin-left: 0;
        padding-top: 50px;
        padding-bottom: 10px;
    }

    .tasks-grid {
        gap: 20px; 
    }

    .task-item {
        display: flex;
        flex-direction: column;
        gap: 0px;
        margin-bottom: 10px;
    }

    .task-header h4 {
        font-size: 16px;
        margin-top: 0px;
        padding-bottom: 0;
    }

    .task-body p {
        font-size: 16px;
    }

    .task-item:nth-child(even) .task-header {
        text-align: left;
    }

    .task-item:nth-child(odd) .task-body {
        text-align: left;
    }

    .founder-section {
        padding: 20px 0 20px 0;
        margin-top: 30px;
    }

    #founder-section{
        gap: 0;
    }

    .founder-photo {
        width: 290px;
        height: 280px;
        margin: 0 auto;         
        overflow: hidden;
        border-radius: 49px;    
    }

    .founder-photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;        
        object-position: center; 
    }

    .founder-name { 
        font-size: 40px;
        text-align: center;
        padding-top: 15px;
    }

    .founder-status p {
        font-size: 15px !important;   

    }

    .founder-status .position {
        font-size: 15px !important;
    }

    .founder-status {
        padding-bottom: 10px;
    }

    .founder-info p {
        font-size: 15px;
    }

    .position p{
        font-size: 15px;    
    }

    .experience {
        font-size: 15px;
    }

    .team-section {
        padding: 0px 0;
        padding-bottom: 30px;
        margin-bottom: 20px;
    }

    .team-section h2{
        padding-bottom: 30px;
    }

    .team-grid {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        gap: 30px 30px;
    }

    .member-photo {
        width: 290px;
        height: 300px;
        margin: 0 auto;         
        overflow: hidden;
        border-radius: 49px;    
    }

    .member-photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;        
        object-position: center; 
    }

    .member-info p{
        text-align: center;
        margin: 0;
        padding: 2px;
    }

    .clients {
        padding: 20px 0px 20px 0px;
    }

    .table_clients {
        gap: 30px;                      
        padding: 30px 10px;
        justify-content: left;
    }

    .clint-card{
        gap: 5px;
        flex: 0 0 calc(50% - 20px);  
        max-width: calc(50% - 20px);
    }

    .clint-card img{
        width: 58px;
    }

    .clint-card h4{
        font-size: 16px;
        font-weight: 600;
    }

    .clint-card p{
        width: 100px;
        font-size: 10px;
    }

    .Review{
        margin: 10px 0 10px;
        padding: 20px 0px 20px 0px;
    }

    .Review h2{
        padding-bottom: 20px;
    }

    .Reviews_list{
        padding-left: 20px;
        font-size: 11px;
        width: 210px;
        height: auto;
        line-height: 16px;
    }

    .Reviews_list p{
        width: 210px;
    }

    /* стрелки поверх, слева/справа */
    .arrow_buttons.left,
    .arrow_buttons.right{
        top: 45%;
        width: 45px;
        height: 45px;
    }
    .arrow_buttons.left{ left: -10px; }
    .arrow_buttons.right{ right: 10px; }


    .contacts{
        margin: 20px 0 10px;
    }
    .contacts__title {
        font-size: 28px;
        margin-bottom: 28px;
        margin-top: 30px;
    }

    .contacts__details {
        font-size: 17px;
    }

    .contacts__logo img{
        display: none;
    }

    .contacts__wrapper{
        justify-content: left;
        height: 250px;
    }

    #button_contact{
       padding: 0px;
    }
    footer.hero {
        padding: 30px 0 30px;
    }

    .hero__nav {
        display: none;
    }

    .hero__title {
        font-size: 24px;
        margin: 0 0 5px 0;
    }

    .hero__subtitle {
        font-size: 12px;
        font-weight: lighter;
        margin: 0;
    }
    
    .menu__box a.menu__item {
        touch-action: manipulation; 
        -webkit-tap-highlight-color: transparent; 
        transition: color 0.1s ease !important; 
    }

    .menu__box a.menu__item:active {
        transition: none !important; 
    }

}