/* ============================================
   БЛОК: АДАПТИВ ДЛЯ ПЛАНШЕТОВ (1024px - 768px)
   ============================================ */

@media (max-width: 1200px) {
    .container {
        max-width: 1200px;
        padding: 0 30px;
    }

    .hero-title {
        font-size: 2.75rem;
    }

    .hero-content {
        padding: 3rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .project-card {
        flex: 0 0 calc(50% - 1rem);
    }

    .review-card {
        flex: 0 0 calc(50% - 1rem);
        height: 500px;
    }

    .review-text {
        -webkit-line-clamp: 5;
    }

    .project-modal-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .gallery-main {
        height: 300px;
    }

    .contact-banner-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .footer-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .quiz-title {
        font-size: 42px;
    }

    .quiz-container {
        padding: 50px 40px;
    }
}

/* ============================================
   БЛОК: АДАПТИВ ДЛЯ ПЛАНШЕТОВ (768px и меньше)
   ============================================ */

@media (max-width: 768px) {
    /* Общие стили */
    .container {
        padding: 0 15px;
    }

    h1 {
        font-size: 2.75rem;
    }

    h2 {
        font-size: 2rem;
    }

    .section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 1.75rem;
    }

    /* Header */
    .header-container {
        padding: 0 15px;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 2rem;
        box-shadow: var(--shadow-lg);
        opacity: 0;
        transform: translateY(-20px);
        transition: all 0.3s ease;
        z-index: 999;
    }

    .nav-menu.active {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }

    .nav-list {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-link {
        display: block;
        padding: 0.75rem 0;
        font-size: 1.125rem;
    }

    .header-contacts {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* Hero Section */
    .hero-card {
        height: 400px;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.125rem;
        margin-bottom: 4rem;
    }

    .hero-content {
        padding: 2rem 1rem;
    }

    .price-badge {
        font-size: 1.5rem;
        padding: 0.75rem 1.5rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .stat-label {
        font-size: 1.5rem;
    }

    /* Services Section */
    .services-grid {
        grid-template-columns: 1fr;
    }

    /* Projects Carousel */
    .projects-carousel {
        position: relative;
        display: block;
        overflow: hidden;
        padding: 0;
    }

    .carousel-wrapper {
        overflow: hidden;
        position: relative;
        touch-action: pan-y;
        padding: 20px 15px;
        margin: -20px -15px;
    }

    .projects-grid {
        display: flex;
        gap: 0;
        transition: transform 0.3s ease;
        width: 100%;
        padding: 0;
        margin: 0;
        cursor: grab;
        user-select: none;
    }

    .projects-grid:active {
        cursor: grabbing;
    }

    .project-card {
        flex: 0 0 100%;
        margin: 0 15px;
        min-width: calc(100% - 30px);
    }

    .carousel-btn {
        display: none;
    }

    /* Свайп индикатор для мобильных */
    .swipe-indicator {
        display: flex;
        animation: fadeInUp 0.5s ease 0.5s forwards;
    }

    .swipe-icon {
        animation: swipeHint 2s ease-in-out infinite;
    }

    /* Project Modal */
    .project-modal {
        padding: 1rem;
        width: 98%;
    }

    .mobile-project-header {
        display: block;
        text-align: center;
        margin-bottom: 1rem;
    }

    .mobile-project-header h3 {
        font-size: 1.5rem;
    }

    .desktop-project-header {
        display: none;
    }

    .gallery-main {
        height: 250px;
    }

    .gallery-prev,
    .gallery-next {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .specs-grid {
        grid-template-columns: 1fr;
    }

    /* Reviews Carousel */
    .reviews-carousel {
        position: relative;
        display: block;
        overflow: hidden;
        padding: 0;
        margin-bottom: 1.5rem;
    }

    .reviews-carousel-wrapper {
        overflow: hidden;
        position: relative;
        touch-action: pan-y;
        padding: 20px 15px;
        margin: -20px -15px;
    }

    .reviews-grid {
        display: flex;
        gap: 0;
        transition: transform 0.3s ease;
        width: 100%;
        padding: 0;
        margin: 0;
        cursor: grab;
        user-select: none;
    }

    .reviews-grid:active {
        cursor: grabbing;
    }

    .review-card {
        flex: 0 0 100%;
        margin: 0 15px;
        min-width: calc(100% - 30px);
        height: auto;
        min-height: 450px;
    }

    .review-text {
        -webkit-line-clamp: 6;
        max-height: 144px;
    }

    .reviews-carousel-btn {
        display: none;
    }

    .reviews-swipe-indicator {
        display: flex;
        animation: fadeInUp 0.5s ease 0.5s forwards;
    }

    .reviews-swipe-icon {
        animation: swipeHint 2s ease-in-out infinite;
    }

    .reviews-more-btn {
        width: 100%;
        max-width: 300px;
    }

    /* Quiz Section */
    .quiz-section {
        padding: 60px 20px;
    }

    .quiz-container {
        padding: 40px 25px;
        border-radius: 30px;
    }

    .quiz-title {
        font-size: 32px;
        margin-bottom: 30px;
    }

    .quiz-question {
        font-size: 20px;
        margin-bottom: 30px;
    }

    .quiz-option {
        padding: 18px 25px;
        font-size: 16px;
    }

    .quiz-navigation {
        flex-direction: column;
        gap: 15px;
    }

    .quiz-nav-btn {
        width: 100%;
        min-width: auto;
    }

    /* Banner Section */
    .banner-container {
        height: 300px;
    }

    .banner-text {
        font-size: 24px;
    }

    /* Contact Banner */
    .contact-banner-content {
        padding: 2rem 1rem;
    }

    .contact-banner-title {
        font-size: 1.5rem;
    }

    /* Footer */
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    /* Modals */
    #callbackModal .modal-container,
    #thankYouModal .modal-container {
        padding: 1.5rem;
        width: 95%;
    }

    .modal-content h3 {
        font-size: 1.5rem;
    }

    /* Notifications */
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }

    @keyframes slideInRight {
        from {
            opacity: 0;
            transform: translateY(-100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes slideOutRight {
        from {
            opacity: 1;
            transform: translateY(0);
        }
        to {
            opacity: 0;
            transform: translateY(-100%);
        }
    }
}

/* ============================================
   БЛОК: АДАПТИВ ДЛЯ МОБИЛЬНЫХ (480px и меньше)
   ============================================ */

@media (max-width: 480px) {
    /* Общие стили */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .section {
        padding: 40px 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    /* Hero Section */
    .hero-card {
        height: 400px;
    }

    .hero-title {
        font-size: 1.4rem;
    }

    .hero-content {
        padding: 1.5rem 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-glow {
      background: #262626;
    }

    .project-image {
        height: auto;
        overflow: hidden;
    }

    .project-image img {
        width: 100%;
        height: auto;
        border-radius: 12px;
        object-fit: cover;
        margin-top: 0;
        display: block;
    }

    /* НА ПОТОМ (ШИРИНА 0) */
/*    !* Projects Carousel *!*/
/*.projects-carousel {*/
/*    position: relative;*/
/*    display: block;*/
/*    overflow: hidden;*/
/*    padding: 0 15px; !* Отступы по бокам *!*/
/*}*/

/*.carousel-wrapper {*/
/*    padding: 20px 0;*/
/*    margin: -20px 0;*/
/*}*/

/*.projects-grid {*/
/*    display: flex;*/
/*    gap: 0; !* Нулевой отступ между карточками *!*/
/*    transition: transform 0.3s ease;*/
/*    width: 100%;*/
/*    padding: 0;*/
/*    margin: 0;*/
/*    cursor: grab;*/
/*    user-select: none;*/
/*}*/

/*.project-card {*/
/*    flex: 0 0 calc(100% - 0px); !* Карточка занимает всю доступную ширину минус нулевые отступы *!*/
/*    margin: 0;*/
/*    border-radius: 12px;*/
/*    overflow: hidden;*/
/*}*/

/*!* Reviews Carousel *!*/
/*.reviews-carousel {*/
/*    position: relative;*/
/*    display: block;*/
/*    overflow: hidden;*/
/*    padding: 0 15px; !* Отступы по бокам *!*/
/*}*/

/*.reviews-carousel-wrapper {*/
/*    padding: 20px 0;*/
/*    margin: -20px 0;*/
/*}*/

/*.reviews-grid {*/
/*    display: flex;*/
/*    gap: 0; !* Нулевой отступ между карточками *!*/
/*    transition: transform 0.3s ease;*/
/*    width: 100%;*/
/*    padding: 0;*/
/*    margin: 0;*/
/*    cursor: grab;*/
/*    user-select: none;*/
/*}*/

/*.review-card {*/
/*    flex: 0 0 calc(100% - 0px); !* Карточка занимает всю доступную ширину *!*/
/*    margin: 0;*/
/*    border-radius: 12px;*/
/*    overflow: hidden;*/
/*}*/

    /* Cards */
    .service-card,
    .project-card,
    .review-card,
    .journal-card {
        padding: 1.5rem;
    }

    /* Project Modal */
    .gallery-main {
        height: 200px;
    }

    .gallery-thumb {
        width: 80px;
        height: 60px;
    }

    .spec-item {
        padding: 0.75rem;
    }

    /* Reviews */
    .review-card {
        padding: 1.5rem;
        min-height: 420px;
    }

    .review-header {
        gap: 0.75rem;
    }

    .reviewer-avatar {
        width: 50px;
        height: 50px;
    }

    .reviewer-name {
        font-size: 1.125rem;
    }

    .review-text {
        font-size: 0.9375rem;
        -webkit-line-clamp: 5;
        max-height: 120px;
    }

    .review-project-image {
        height: 140px;
    }

    .star {
        font-size: 1.125rem;
    }

    .reviews-more-btn {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }

    /* Quiz */
    .quiz-section {
        padding: 40px 15px;
    }

    .quiz-container {
        padding: 30px 20px;
        border-radius: 20px;
    }

    .quiz-title {
        font-size: 28px;
        margin-bottom: 25px;
    }

    .quiz-question {
        font-size: 18px;
        margin-bottom: 25px;
    }

    .quiz-option {
        padding: 15px 20px;
        font-size: 15px;
    }

    .quiz-input {
        width: 100%;
        font-size: 15px;
        padding: 14px 16px;
    }


    /* Banner */
    .banner-container {
        height: 400px;
    }

    .banner-text {
        font-size: 18px;
    }

.banner-buttons {
    flex-direction: row;
    margin-bottom: 0;
    row-gap: 10px;
    align-items: flex-start;
}

    /* Footer */
    .footer-info {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-logo img {
        height: 50px;
    }

    /* Forms */
    .contact-input,
    .contact-textarea,
    .form-group input {
        padding: 0.875rem;
        font-size: 0.9375rem;
    }

    .contact-project-btn,
    .submit-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

/* ============================================
   БЛОК: АДАПТИВ ДЛЯ ОЧЕНЬ МАЛЕНЬКИХ ЭКРАНОВ (360px и меньше)
   ============================================ */

@media (max-width: 360px) {
    /* Общие стили */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    /* Hero */
    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .price-badge {
        font-size: 1.25rem;
        padding: 0.5rem 1rem;
    }

    /* Cards */
    .service-card,
    .project-card,
    .review-card {
        padding: 1.25rem;
    }

    .project-title {
        font-size: 1.25rem;
        min-height: 3rem;
    }

    .service-title {
        font-size: 1.5rem;
    }

    /* Quiz */
    .quiz-title {
        font-size: 24px;
    }

    .quiz-question {
        font-size: 16px;
    }

    .quiz-option {
        padding: 12px 15px;
        font-size: 14px;
    }

    .quiz-nav-btn {
        padding: 12px 20px;
        font-size: 16px;
    }

    /* Banner */
    .banner-text {
        font-size: 16px;
        line-height: 1.4;
    }

    /* Footer */
    .footer-phone {
        font-size: 1.125rem;
    }

    .social-icon {
        width: 35px;
        height: 35px;
        font-size: 0.75rem;
    }
}

/* ============================================
   БЛОК: АДАПТИВ ДЛЯ ЛАНДШАФТНОЙ ОРИЕНТАЦИИ
   ============================================ */

@media (max-height: 600px) and (orientation: landscape) {
    .hero-card {
        height: 300px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
        margin-bottom: 3rem;
    }

    .modal-container {
        max-height: 80vh;
    }

    .project-modal-content {
        max-height: 60vh;
    }

    .gallery-main {
        height: 200px;
    }
}

/* ============================================
   БЛОК: АДАПТИВ ДЛЯ ВЫСОКИХ ЭКРАНОВ
   ============================================ */

@media (min-height: 900px) and (min-width: 768px) {
    .hero-card {
        height: 700px;
    }

    .review-card {
        height: 560px;
    }
}

/* ============================================
   БЛОК: АДАПТИВ ДЛЯ ОГРАНИЧЕНИЯ ДВИЖЕНИЯ
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .animate-in,
    .service-card,
    .project-card,
    .review-card {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .notification {
        animation: none !important;
    }
}

/* ============================================
   БЛОК: АДАПТИВ ДЛЯ ВЫСОКОКОНТРАСТНОГО РЕЖИМА
   ============================================ */

@media (prefers-contrast: high) {
    :root {
        --brand-primary: #008000;
        --brand-secondary: #006600;
        --brand-light: #e6ffe6;
        --brand-dark: #004d00;
    }

    .notification-success .notification-content {
        background: var(--brand-primary);
    }

    .notification-error .notification-content {
        background: #990000;
    }
}

/* ============================================
   БЛОК: АДАПТИВ ДЛЯ ОГРАНИЧЕНИЯ ПРОЗРАЧНОСТИ
   ============================================ */

@media (prefers-reduced-transparency: reduce) {
    .modal-overlay,
    .hero-overlay-dark,
    .hero-overlay-gradient,
    .gallery-overlay,
    .gallery-counter,
    .stat-glow {
        opacity: 1;
        background: rgba(0, 0, 0, 0.9);
    }

    .notification-content {
        background: var(--brand-primary);
    }

    .notification-error .notification-content {
        background: #ff3860;
    }
}

/* ============================================
   БЛОК: АДАПТИВ ДЛЯ ОГРАНИЧЕНИЯ ДАННЫХ
   ============================================ */

@media (prefers-reduced-data: reduce) {
    .hero-bg-image,
    .project-image img,
    .review-project-image img,
    .journal-image img,
    .gallery-thumb img,
    .gallery-main img,
    .banner-container {
        background-image: none !important;
    }

    .hero-bg-image::before,
    .project-image::before,
    .review-project-image::before,
    .journal-image::before {
        content: '';
        position: absolute;
        inset: 0;
        background: var(--light-bg-1);
    }

    .banner-container::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand-primary) 100%);
    }
}
