/* Адаптивный дизайн */
@media (max-width: 1024px) {
    .hero-content,
    .blog-grid,
    .post-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        display: flex;
    }

    .hero-image {
        display: none;
    }

    .sidebar-cta,
    .post-sidebar,
    .blog-sidebar {
        display: none;
    }

    h4 {
        word-break: break-all;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-stats {
        justify-content: center;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .service-card.featured {
        transform: none;
    }

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

    .footer {
        padding: 3rem 0 1.5rem;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 2rem;
        border-top: 1px solid var(--border-light);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .hero-buttons button,
    .hero-buttons a {
        margin: auto;
    }

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

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

    .nav-toggle {
        display: flex;
    }

    .author-avatar {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .hero {
        padding: 6rem 0 2rem;
    }

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

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-stats {
        flex-direction: row;
        gap: 1rem;
        justify-content: space-between;
    }

    .hero-image {
        display: none;
    }


    .container {
        padding: 0 1rem;
    }

    section {
        padding: 2rem 0;
    }

    .process-steps {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .blog-sidebar {
        order: -1;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        text-align: center;
    }

    .footer-section {
        margin-bottom: 1.5rem;
    }

    .footer-section h4 {
        margin-bottom: 1rem;
        font-size: 1rem;
    }

    .footer-section ul li {
        margin-bottom: 0.5rem;
    }

    .footer-section .contact-info p {
        justify-content: center;
        font-size: 0.9rem;
    }

    .footer-brand p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

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

    .newsletter-form {
        flex-direction: column;
    }

    .footer {
        padding: 2rem 0 1rem;
    }

    .footer-bottom {
        padding-top: 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

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

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .more-posts-grid {
        grid-template-columns: 1fr;
    }

    .author-card {
        flex-direction: column;
        text-align: center;
    }

    .footer-content {
        gap: 1.5rem;
    }

    .footer-section h4 {
        font-size: 0.9rem;
    }

    .footer-section .contact-info p {
        font-size: 0.8rem;
    }

    .footer-brand p {
        font-size: 0.8rem;
    }

    .case-results {
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .result {
        flex: 1;
        min-width: 100%;
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 768px) {
    .privacy-content {
        padding: 2rem 1.5rem;
    }

    .privacy-meta {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .cases-grid,
    .reviews-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .case-results {
        justify-content: space-around;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .review-card {
        padding: 1.5rem;
        padding-top: 2.5rem;
    }
}

/* Адаптивность каруселей */
@media (max-width: 768px) {
    .cases-carousel .case-card,
    .reviews-carousel .review-card {
        flex: 0 0 280px;
        max-width: 280px;
        margin-right: 1.5rem;
    }

    .carousel-controls {
        margin-top: 1.5rem;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .cases-carousel .case-card,
    .reviews-carousel .review-card {
        flex: 0 0 calc(100vw - 4rem);
        max-width: calc(100vw - 4rem);
        margin-right: 10px;
    }

    .carousel-wrapper {
        padding: 10px;
    }

    .carousel-container {
        margin-top: 2rem;
        overflow: visible;
    }
}

@media (max-width: 991px) {
    .carousel-wrapper {
        flex-direction: column;
        overflow-x: visible; /* не прокрутка, а звичайний потік */
        gap: 20px; /* відстань між картками */
    }

    .cases-carousel {
        transform: none !important; /* прибираємо translateX */
    }

    .case-card {
        width: 100% !important; /* на всю ширину контейнера */
        margin: 10px !important; /* прибираємо правий margin */
    }

    /* Ховаємо кнопки навігації, якщо вони є */
    #nextBtn,
    #prevBtn {
        display: none;
    }
}