/* Responsywność - Media Queries */

/* Tablety (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .about-grid, 
    .contact-grid {
        gap: 40px;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 50px;
    }
    
    .nav-menu-container {
        margin-left: 15px;
    }
    
    .nav-menu {
        gap: 15px;
    }
    
    .nav-actions {
        flex-direction: column;
        gap: 10px;
        margin: 0 10px;
    }
    
    .nav-actions .btn-primary,
    .nav-actions .btn-secondary {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* Tablety małe (576px - 768px) */
@media screen and (max-width: 768px) {
    .navbar {
        position: relative;
    }
    
    .menu-toggle {
        display: flex;
        z-index: 1001;
    }
    
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .nav-menu-container {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        background-color: #1a1a1a;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 100px 40px 40px;
        gap: 30px;
        transition: all 0.3s ease;
        z-index: 1000;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        margin-left: 0;
        overflow-y: auto;
    }
    
    .nav-menu-container.active {
        right: 0;
    }
    
    .nav-menu {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 25px;
    }
    
    .nav-link {
        font-size: 1.2rem;
        padding: 10px 0;
        color: #ffffff;
    }
    
    .nav-actions {
        flex-direction: column;
        width: 100%;
        margin: 20px 0;
    }
    
    .nav-actions .btn-primary,
    .nav-actions .btn-secondary {
        width: 100%;
        text-align: center;
        padding: 15px 20px;
        font-size: 1rem;
    }
    
    .nav-actions .btn-primary {
        background-color: #ffffff;
        color: #1a1a1a;
        border: 2px solid #ffffff;
    }
    
    .nav-actions .btn-secondary {
        background-color: transparent;
        color: #ffffff;
        border: 2px solid #ffffff;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons a {
        width: 100%;
        text-align: center;
    }
    
    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    .contact-form-container,
    .contact-details,
    .map-container {
        padding: 30px;
    }
    
    .realizations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .categories-carousel {
        padding: 0 40px;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .carousel-btn i {
        font-size: 1.2rem;
    }
    
    .carousel-track {
        gap: 20px;
    }
}

/* Telefony (do 576px) */
@media screen and (max-width: 576px) {
    .hero {
        min-height: 600px;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-left: 0;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-content {
        margin-left: 0;
        padding: 0 20px;
        text-align: center;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .realizations-grid,
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .feature {
        flex-direction: column;
        text-align: center;
    }
    
    .feature-icon {
        margin: 0 auto;
    }
    
    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .contact-icon {
        margin: 0 auto;
    }
    
    .realization-meta {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .nav-menu-container {
        width: 100%;
        max-width: 100%;
        padding: 100px 20px 40px;
    }
    
    .logo img {
        height: 40px;
    }
    
    .hero-overlay {
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 30%, transparent);
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    .categories,
    .realizations,
    .about,
    .contact-section {
        padding: 60px 0;
    }
    
    .category-content,
    .realization-content {
        padding: 20px;
    }
    
    .contact-grid {
        gap: 30px;
    }
    
    .categories-carousel {
        padding: 0 30px;
    }
    
    .carousel-btn {
        width: 35px;
        height: 35px;
    }
    
    .carousel-track {
        gap: 15px;
    }
}

/* Bardzo małe telefony (do 400px) */
@media screen and (max-width: 400px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .btn-large {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    .contact-form-container,
    .contact-details,
    .map-container {
        padding: 20px;
    }
    
    .footer {
        padding: 60px 0 20px;
    }
    
    .footer-bottom-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .categories-carousel {
        padding: 0 15px;
    }
}

/* Realizacje na stronie głównej */
@media screen and (max-width: 1024px) {
    .realizations-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media screen and (max-width: 768px) {
    .realizations-grid {
        grid-template-columns: 1fr !important;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .hero-buttons a {
        width: 100%;
        text-align: center;
    }
}

/* Strona wszystkich projektów */
@media screen and (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr !important;
    }
    
    .project-layout {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    
    .project-info {
        position: static !important;
    }
}

/* Strona szczegółów projektu */
@media screen and (max-width: 992px) {
    .project-details-page .container {
        padding: 0 15px !important;
    }
    
    .gallery-container {
        padding: 20px !important;
    }
    
    .project-info {
        padding: 20px !important;
    }
}


@media screen and (max-width: 1200px) {
    .category-card {
        width: 250px;
    }
}

@media screen and (max-width: 992px) {
    .category-card {
        width: 300px;
    }
}

@media screen and (max-width: 768px) {
    .categories-carousel {
        padding: 0 40px;
    }
    
    .category-card {
        width: 280px;
    }
}

@media screen and (max-width: 576px) {
    .categories-carousel {
        padding: 0 30px;
    }
    
    .category-card {
        width: 100%;
        max-width: 350px;
        margin: 0 auto;
    }
}

/* Poprawki dla formularza i kontaktu na małych ekranach (do 576px) */
@media screen and (max-width: 576px) {
    /* Pola imię i nazwisko jedno pod drugim */
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    /* Wyśrodkowanie danych kontaktowych */
    .contact-item {
        flex-direction: column;
        align-items: center;    /* Wyśrodkowanie w pionie */
        text-align: center;      /* Dla bezpieczeństwa */
    }
    .contact-icon {
        margin: 0 auto 10px;
    }
    /* Wymuszenie wyśrodkowania tekstu */
    .contact-text,
    .contact-text h4,
    .contact-text p {
        text-align: center;
        width: 100%;            /* Zapobiega zawijaniu */
    }
}


@media screen and (min-width: 768px) and (max-width: 1299px) {
    .features-grid,
    .realizations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 767px) {
    .realizations-grid .realization-card-link:nth-child(4) {
        display: none;
    }
}

/* Ukryj 4 projekt na bardzo dużych ekranach (powyżej 1366px) */
@media screen and (min-width: 1300px) {
    .realizations-grid .realization-card-link:nth-child(4) {
        display: none;
    }
}

@media screen and (min-width: 577px) {
    .category-card-link {
        width: calc(50% - 15px);  /* 2 kolumny z odstępem 30px */
    }
}

/* Desktop (od 992px) – 3 karty */
@media screen and (min-width: 992px) {
    .category-card-link {
        width: calc(33.333% - 20px);
    }
}

/* Duży desktop (od 1200px) – 4 karty */
@media screen and (min-width: 1200px) {
    .category-card-link {
        width: calc(25% - 22.5px); /* 4 kolumny z odstępem 30px */
    }
}