/* --- Адаптация под мобильные устройства --- */
/* Максимальная ширина экрана 768px (планшеты и телефоны) */

@media (max-width: 768px) {

    .page,
    .page-about {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    /* Общий контейнер */
    .container {
        padding: 0 15px;
        max-width: 100%;
    }

    /* HERO: фон и текст */
    .hero-content {
        min-height: 100vh;
    }

    .hero-text-block {
        transform: translateX(0) translateY(0);
        max-width: 100%;
        text-align: center;
        margin-left: 15px;
    }

    .hero-text-block h1 {
        font-size: 32px;
    }

    .hero-text-block sub {
        font-size: 14px;
    }

    .hero-bg {
        top: env(safe-area-inset-top);
        height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }

    /* ХЕДЕР */
    .header {
        height: 20px;
    }

    .navbar {
        padding: 0 15px;
    }

    .logo {
        display: none;
    }

    .dropdown-button,
    .menu-button {
        padding: 8px 12px;
        font-size: 14px;
    }

    .left-section {
        gap: 15px;
    }

    /* Мобильное меню */
    .menu {
        right: 15px !important;
        width: calc(100% - 30px);
        top: 70px;
        border-radius: 12px;
    }

    .menu a {
        padding: 15px 20px;
    }

    /* УСЛУГИ */
    .services-grid {
        padding: 20px;
    }

    .grid-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .service-card {
        height: 200px;
        background-position: center 30%;
    }

    .card-content {
        padding: 15px;
    }

    .card-description {
        font-size: 13px;
    }

    .service-title {
        font-size: 14px;
        padding: 4px 6px;
    }

    /* ОБО МНЕ */
    .page-about {
        flex-direction: column;
        align-items: center;
        text-align: left;
    }


    .text-columns {
        grid-template-columns: repeat(2, 1fr);
        /* Две колонки на десктопе */
        gap: 20px;
        padding: 0;
    }

    .image-column,
    .text-section {
        order: initial;
        width: 100%;
        max-width: 500px;
    }

    .text-section h2 {
        margin: 0 0 20px 0;
    }

    .image-column img {
        width: 100%;
        height: auto;
        border-radius: 10px;
    }

    /* КАРТОЧКИ КОНТЕНТА */
    .page {
        flex-direction: column;
        padding: 20px;
    }

    .text-section {
        order: 2;
    }

    .image-section-1 {
        flex: none;
        order: 1;
        height: 300px;
        margin-bottom: 20px;
    }

    /* ПОЛОСА С НАДПИСЬЮ */
    .scroll-marquee {
        width: 100%;
        padding: 8px 0;
        /* Уменьшили */
        overflow: hidden;
    }

    .marquee-track {
        font-size: 14px;
        letter-spacing: 2px;
    }

    .marquee-container {
        padding: 0 15px;
        /* Отступы по краям */
        white-space: nowrap;
    }

    /* ГАЛЕРЕЯ */
    .gallery-header h2 {
        font-size: 28px;
    }

    .gallery-grid {
        grid-template-columns: repeat(4, 2fr);
        gap: 12px;
        padding: 15px;
    }

    .gallery-item {
        height: 180px;
    }

    .gallery-item::after {
        font-size: 14px;
        bottom: 15px;
        left: 15px;
    }

    /* ФУТЕР */
    .footer {
        padding: 40px 20px;
    }

    .contacts-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .form-container {
        max-width: 100% !important;
        min-width: auto !important;
        width: 100%;
        padding: 16px;
    }

    .form-container iframe {
        width: 100% !important;
        height: 600px !important;
        min-height: 370px;
    }

    .qr-code {
        max-width: 180px;
    }

    /* ХЛЕБНЫЕ КРОШКИ */
    .breadcrumbs {
        margin: 15px 0 0 0;
        font-size: 12px;
    }

    /* БЛОГ */
    #blog .page-about {
        flex-direction: column;
    }

    #blog .image-column {
        order: 1;
        margin-bottom: 20px;
    }

    #blog .text-section {
        order: 2;
    }

    /* Модальное окно */
    .modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.9);
        align-items: center;
        justify-content: center;
        z-index: 1000;
    }

    .modal.active {
        display: flex;
    }

    .modal-image-wrapper {
        /* НЕ растягивайте на весь экран! */
        display: flex;
        align-items: center;
        justify-content: center;
        /* Добавьте отступ, чтобы фон был виден по краям */
        padding: 20px;
        max-width: 100%;
        max-height: 100%;
    }

    .modal-content {
        max-width: 90vw;
        max-height: 80vh;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .modal-close {
        position: absolute;
        top: 20px;
        right: 30px;
        color: white;
        font-size: 40px;
        font-weight: bold;
        cursor: pointer;
        z-index: 1001;
    }

    .modal-close:hover {
        color: #ccc;
    }

    .modal-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.3);
        color: white;
        border: none;
        font-size: 24px;
        padding: 10px 15px;
        cursor: pointer;
        z-index: 1001;
        transition: background 0.3s;
    }

    .modal-prev {
        left: 20px;
    }

    .modal-next {
        right: 20px;
    }

    .modal-nav:hover {
        background: rgba(0, 0, 0, 0.8);
    }
}

/* --- Ещё меньшие экраны (до 480px) --- */
@media (max-width: 480px) {

    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
        font-size: 12px;
    }

    .container {
        padding: 0 15px;
    }

    /* Hero */
    .hero-content {
        min-height: 95vh;
    }

    .hero-text-block h1 {
        font-size: 32px;
    }

    .hero-text-block sub {
        font-size: 14px;
    }

    .hero-bg {
        width: 100%;
        height: 100%;
        transform: translateX(0) translateY(0);
    }

    /* Хедер */
    .logo {
        display: none;
    }

    .dropdown-button,
    .menu-button {
        padding: 6px 10px;
        font-size: 12px;
    }

    .left-section {
        margin-left: 0;
    }

    .navbar {
        justify-content: space-between;
    }

    .image-column,
    .image-column-blog {
        display: none;
    }

    .page-about,
    .page-about-blog {
        margin: auto;
        padding: 10px;
    }

    .about-section {
        margin: 0;
        padding: 10px 0;
    }

    /* Услуги */
    .grid-container {
        gap: 15px;
    }

    .services-grid {
        padding: 0;
    }

    .service-card {
        height: 180px;
    }

    /* Галерея */
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .gallery-item {
        height: auto;
        aspect-ratio: 3 / 4;
        max-height: 160px;
    }

    .gallery-header h2 {
        font-size: 24px;
    }

    /* Футер */
    .footer {
        padding: 10px;
    }

    .contacts-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .form-container {
        margin: 0 !important;
        padding: 15px;
        width: 100%;
        max-width: auto;
        box-sizing: border-box;
    }

    .form-container iframe {
        width: 100% !important;
        height: 660px !important;
        min-height: 400px;
        max-height: 800px;
        border: none;
        display: block;
        box-sizing: border-box;
        overflow: hidden;
    }

    /* Контакты */
    .socials p {
        font-size: 13px;
    }

    .qr-code {
        max-width: 150px;
    }

    /* Подписка на блог */
    #blog .text-section p {
        font-size: 13px;
    }

    /* Модальное окно */
    .modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.9);
        align-items: center;
        justify-content: center;
        z-index: 1000;
    }

    .modal.active {
        display: flex;
    }

    .modal-image-wrapper {
        /* НЕ растягивайте на весь экран! */
        display: flex;
        align-items: center;
        justify-content: center;
        /* Добавьте отступ, чтобы фон был виден по краям */
        padding: 20px;
        max-width: 100%;
        max-height: 100%;
    }

    .modal-content {
        max-width: 90vw;
        max-height: 80vh;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .modal-close {
        position: absolute;
        top: 20px;
        right: 30px;
        color: white;
        font-size: 40px;
        font-weight: bold;
        cursor: pointer;
        z-index: 1001;
    }

    .modal-close:hover {
        color: #ccc;
    }

    .modal-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.2);
        color: white;
        border: none;
        font-size: 24px;
        padding: 1px 4px;
        cursor: pointer;
        z-index: 1001;
        transition: background 0.3s;
    }

    .modal-prev {
        left: 20px;
    }

    .modal-next {
        right: 20px;
    }

    .modal-nav:hover {
        background: rgba(0, 0, 0, 0.4);
    }

    /* Хлебные крошки */
    .cookie-banner {
        bottom: 16px;
        left: 16px;
        right: 16px;
        padding: 14px;
    }

    .cookie-banner__content {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-banner__text {
        flex-direction: row;
        align-items: flex-start;
    }

    .cookie-icon {
        margin-top: 2px;
        /* выравнивание по тексту */
    }

    .cookie-banner__btn {
        width: 100%;
        padding: 10px;
    }


}