/* Responsive Styles */

/* Tablet */
@media (max-width: 1024px) {
    :root {
        --font-size-h1: 36px;
        --font-size-h2: 28px;
        --font-size-h3: 20px;
    }

    .header__top {
        flex-wrap: wrap;
    }

    .header__top-right {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .header__nav {
        width: 100%;
        display: none;
    }

    .header__nav.active {
        display: block;
    }

    .nav__list {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .header__burger {
        display: flex;
    }

    .hero__title {
        font-size: 36px;
    }

    .catalog__grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .advantages__grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Mobile */
@media (max-width: 767px) {
    :root {
        --font-size-h1: 28px;
        --font-size-h2: 24px;
        --font-size-h3: 18px;
        --spacing-xl: 32px;
        --spacing-xxl: 48px;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    .header__top {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: center !important;
        justify-content: center !important;
        position: relative;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .header__top-right {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
        width: 100%;
    }

    /* Первая строка: бургер-меню (слева) + логотип (по центру, увеличен в 2 раза) */
    .header__burger--mobile {
        display: flex !important;
        position: absolute;
        left: 12.5%;
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 10;
        flex-direction: column;
        gap: 4px;
        background: none;
        border: none;
        cursor: pointer;
        padding: var(--spacing-xs);
        align-items: center;
        justify-content: center;
    }

    .header__burger--mobile span {
        width: 25px;
        height: 3px;
        background-color: #FFFFFF;
        transition: all var(--transition);
    }

    .header__logo {
        order: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        position: relative;
        margin: 0;
        padding: 0;
    }

    .header__logo-label {
        padding: 16px 32px;
        font-size: 40px;
        margin: 0 auto !important;
        display: inline-flex !important;
        text-align: center;
        justify-content: center;
        align-items: center;
    }

    .header__logo-label .logo-label__pro,
    .header__logo-label .logo-label__text {
        font-size: 40px;
    }

    /* Скрыть бургер-меню из контактов (если осталось) */
    .header__contacts .header__burger {
        display: none !important;
    }

    /* Вторая строка: телефон и иконки соцсетей (по центру) */
    .header__contacts {
        flex-direction: column;
        gap: var(--spacing-xs);
        align-items: center !important;
        justify-content: center !important;
        width: 100%;
        order: 2;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box;
    }

    .header__contacts-main {
        width: 100%;
        align-items: center !important;
        justify-content: center !important;
        display: flex;
        flex-direction: column;
        gap: var(--spacing-xs);
        margin: 0;
        padding: 0;
    }

    .header__phone {
        font-size: var(--font-size-base);
        text-align: center !important;
        margin: 0 auto;
        display: block;
        width: auto;
    }

    .header__social-wrapper {
        display: flex;
        align-items: center;
        justify-content: center !important;
        gap: var(--spacing-xs);
        flex-wrap: nowrap !important;
        white-space: nowrap;
        margin: 0 auto;
        width: auto;
    }

    .header__social {
        display: flex !important;
        flex-wrap: nowrap !important;
        flex-shrink: 0;
        white-space: nowrap;
        justify-content: center !important;
        margin: 0;
        padding: 0;
    }

    /* Скрыть элементы, которые не нужны в мобильной версии */
    .header__about-text {
        display: none;
    }

    .header__nav {
        display: none;
    }

    .header__nav.active {
        display: block;
        order: 3;
        width: 100%;
    }

    .header__btn {
        display: block;
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-base);
        width: 100% !important;
        text-transform: uppercase !important;
        margin: var(--spacing-sm) auto 0 auto !important;
        text-align: center !important;
        box-sizing: border-box;
        letter-spacing: 0.5px;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
    }

    /* Scroll animation for header button - Mobile (circle) */
    .header__btn.scrolled {
        position: fixed !important;
        bottom: 20px !important;
        right: 20px !important;
        left: auto !important;
        top: auto !important;
        width: auto !important;
        min-width: 120px;
        height: 60px !important;
        padding: 0 14px 0 10px !important;
        border-radius: 30px !important;
        font-size: 0 !important;
        margin: 0 !important;
        z-index: 10000 !important;
        box-shadow: 0 4px 20px rgba(57, 255, 20, 0.3);
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 6px;
        pointer-events: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
        transform-origin: center;
        overflow: visible !important;
        animation: none;
        text-indent: -9999px;
        line-height: 0;
    }

    .header__btn.scrolled::before {
        content: '';
        width: 20px;
        height: 20px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'%3E%3C/path%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 20px 20px;
        flex-shrink: 0;
    }

    .header__btn.scrolled span {
        display: inline-block !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        color: #000000 !important;
        opacity: 1 !important;
        visibility: visible !important;
        white-space: nowrap;
        animation: none;
        transform: translateX(0);
    }

    /* Скрыть основной текст кнопки, показать только span */
    .header__btn.scrolled span {
        text-indent: 0 !important;
        line-height: normal !important;
    }
    
    .header__btn.scrolled::before {
        display: block !important;
    }

    .header__btn.scrolled::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-green-dark) 100%);
        border-radius: 50%;
        z-index: -1;
    }

    .hero {
        min-height: 60vh;
        padding: var(--spacing-xl) 0;
    }

    .hero__background {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .hero__bg-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    .hero__overlay {
        background: linear-gradient(
            to bottom,
            rgba(26, 26, 26, 0.4) 0%,
            rgba(26, 26, 26, 0.3) 50%,
            rgba(26, 26, 26, 0.5) 100%
        );
    }

    .hero__title {
        font-size: 28px;
        margin-bottom: var(--spacing-sm);
        color: #FFFFFF;
        text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.6);
    }

    .hero__subtitle {
        font-size: var(--font-size-base);
        color: #FFFFFF;
        text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.9);
    }

    .hero__usp {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .section__title {
        font-size: 24px;
    }

    section {
        padding: var(--spacing-xl) 0;
    }

    .about__content {
        flex-direction: column;
    }

    .header__about-text {
        display: none;
    }

    .about__advantages {
        grid-template-columns: 1fr;
    }

    .about__gallery {
        grid-template-columns: 1fr;
    }

    .about__stats {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .catalog__tabs {
        flex-direction: column;
    }

    .catalog__tab {
        width: 100%;
    }

    .catalog__grid {
        grid-template-columns: 1fr;
    }

    .catalog__cards-wrapper {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .product-card {
        width: 100%;
        max-width: 100%;
    }

    .portfolio__grid {
        grid-template-columns: 1fr;
    }

    .advantages__grid {
        grid-template-columns: 1fr;
    }

    .pricing__tabs {
        flex-direction: column;
    }

    .pricing__tab {
        width: 100%;
    }

    .special-offers {
        grid-template-columns: 1fr;
    }

    .footer__content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .modal__content {
        padding: var(--spacing-lg);
        width: 95%;
    }

    .table {
        font-size: var(--font-size-small);
    }

    .table th,
    .table td {
        padding: var(--spacing-sm);
    }

    .reviews__slider {
        gap: var(--spacing-sm);
    }

    .review-card {
        min-width: 280px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .hero {
        min-height: 50vh;
    }

    .hero__overlay {
        background: linear-gradient(
            to bottom,
            rgba(26, 26, 26, 0.45) 0%,
            rgba(26, 26, 26, 0.35) 50%,
            rgba(26, 26, 26, 0.55) 100%
        );
    }

    .hero__title {
        font-size: 24px;
        color: #FFFFFF;
        text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.6);
    }

    .hero__subtitle {
        color: #FFFFFF;
        text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.9);
    }

    .btn--large {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-base);
    }

    .stat-item__number {
        font-size: 36px;
    }

    .advantage-card__icon .icon-3d,
    .advantage-item__icon .icon-3d {
        width: 48px;
        height: 48px;
    }
    
    .footer__map-wrapper {
        grid-template-columns: 1fr;
    }
    
    .footer__map,
    .footer__video {
        height: 250px;
    }
    
    .map__background-left,
    .map__background-right {
        width: 20%;
        filter: blur(15px);
        opacity: 0.15;
    }
}

