/* ============================================
   RESPONSIVE — TABLET (≤ 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* ============================================
   RESPONSIVE — TABLET (≤ 768px)
   ============================================ */
@media (max-width: 768px) {
    :root {
        --spacing-section: 50px;
    }

    /* Header */
    .site-header {
        padding-bottom: 0;
    }

    .header-inner {
        padding-top: 16px;
        gap: 8px;
        overflow: hidden;
    }

    .logo {
        width: 60px;
        height: 60px;
        margin-top: 0;
        flex-shrink: 0;
    }

    .logo img {
        width: 45px;
        height: 45px;
    }

    .header-phone {
        font-size: 0.8rem;
        font-weight: 700;
        color: var(--color-green-deep);
        white-space: nowrap;
        text-decoration: none;
        gap: 4px;
        flex-shrink: 0;
        overflow: hidden;
        margin-left: auto;
    }

    .header-phone-icon {
        width: 14px;
        height: 14px;
    }

    .mobile-menu-btn {
        margin-left: auto;
        display: flex;
    }

    .container {
        padding: 0 8px;
    }

    .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--color-white);
        flex-direction: column;
        padding: 24px 16px;
        gap: 16px;
        box-shadow: var(--shadow-md);
        transform: translateY(-120%);
        transition: transform var(--transition);
    }

    .main-nav.open {
        transform: translateY(0);
    }

    .main-nav a {
        font-size: 1.1rem;
        width: 100%;
        padding: 8px 0;
    }

    /* Hero — mobile: stack vertically */
    .hero {
        padding: 100px 0 50px;
        min-height: auto;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-content {
        padding: 0;
        text-align: center;
    }

    .hero-content h1 {
        text-align: center;
    }

    .hero-actions {
        flex-direction: column;
        justify-content: center;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-phone {
        align-items: center;
    }

    .hero-image-wrapper {
        height: 280px;
    }

    .hero-badge {
        bottom: 16px;
        left: 16px;
        padding: 12px 16px;
        max-width: 200px;
    }

    .hero-badge strong {
        font-size: 1.2rem;
    }

    .hero-badge span {
        font-size: 0.8rem;
    }

    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .about-stats {
        gap: 20px;
        flex-wrap: wrap;
    }

    .about-image iframe {
        height: 300px;
    }

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

    /* Portfolio */
    .portfolio {
        padding: var(--spacing-section-sm) 0;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .portfolio-card {
        min-width: 0;
    }

    .portfolio-card-actions {
        flex-direction: column;
    }

    .portfolio-card-actions .btn {
        width: 100%;
    }

    /* Portfolio Carousel */
    .portfolio-carousel {
        padding: 0 50px;
    }

    .portfolio-carousel-slide {
        flex: 0 0 calc((100% - 32px) / 2);
        max-width: calc((100% - 32px) / 2);
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
    }

    /* Stages */
    .stages-timeline {
        flex-direction: column;
        align-items: center;
    }

    .stage-item {
        max-width: 320px;
        width: 100%;
    }

    .stage-arrow {
        transform: rotate(90deg);
        flex: 0 0 30px;
    }

    /* Reviews */
    .reviews-carousel {
        padding: 0 50px;
    }

    .reviews-carousel-slide {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .reviews-carousel-controls .carousel-btn {
        width: 40px;
        height: 40px;
    }

    /* Footer */
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .footer-col {
        min-width: 0;
    }

    .modal {
        padding: 24px;
    }

    /* Prevent horizontal overflow on all sections */
    .about-grid,
    .stages-timeline,
    .advertising .container {
        min-width: 0;
    }
}

/* ============================================
   RESPONSIVE — MOBILE (≤ 480px)
   ============================================ */
@media (max-width: 480px) {
    .about-stats {
        flex-direction: column;
        gap: 16px;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }

    .portfolio-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-btn {
        text-align: center;
    }

    /* Advertising */
    .advertising .container {
        grid-template-columns: 1fr;
    }

    .advertising-card {
        padding: 32px 24px;
    }

    /* Hero mobile */
    .hero-image-wrapper {
        height: 220px;
    }

    .hero-badge {
        display: none;
    }

    /* Extra small screens (< 320px) */
    .container {
        padding: 0 8px;
    }

    .portfolio-card,
    .review-card,
    .stage-item,
    .stat,
    .footer-col {
        min-width: 0;
        max-width: 100%;
    }

    .portfolio-slider img,
    .portfolio-slide img {
        width: 100%;
        height: auto;
        max-height: 200px;
        object-fit: cover;
    }

    .about-grid,
    .stages-timeline,
    .advertising .container {
        min-width: 0;
        overflow: hidden;
    }

    .header-inner {
        gap: 8px;
        padding-top: 12px;
    }

    .logo {
        width: 50px;
        height: 50px;
        margin-top: 0;
    }

    .logo img {
        width: 40px;
        height: 40px;
    }

    .header-phone {
        font-size: 0.75rem;
        gap: 4px;
    }

    .header-phone-icon {
        width: 14px;
        height: 14px;
    }

    .mobile-menu-btn span {
        width: 20px;
        height: 2px;
    }
}
