/* =========================================
   1. ZMIENNE I KONFIGURACJA PODSTAWOWA
   ========================================= */
:root {
    /* Fonty */
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Roboto', sans-serif;

    /* Kolorystyka Czerwono-Biała */
    --bg-color: #f9f9f9;
    --bg-card: #ffffff;
    --text-color: #333333;
    --heading-color: #111111;
    
    --primary-color: #792020; /* Czerwień firmowa */
    --primary-color-hover: #802a2a;
    
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.08);
}

/* Reset CSS */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
    font-family: var(--font-secondary); 
    background: var(--bg-color); 
    color: var(--text-color); 
    line-height: 1.6; 
}

.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* =========================================
   2. TYPOGRAFIA
   ========================================= */
h1, h2, h3, h4 { 
    font-family: var(--font-primary); 
    color: var(--heading-color); 
    margin-bottom: 1rem; 
    font-weight: 700; 
}

h2 { 
    text-align: center; 
    font-size: 2.2rem; 
    margin-bottom: 3rem; 
    position: relative; 
    text-transform: uppercase; 
}

/* Ozdobna linia pod nagłówkami H2 */
h2::after { 
    content: ''; 
    display: block; 
    width: 60px; 
    height: 4px; 
    background-color: var(--primary-color); 
    margin: 15px auto 0; 
}

.section-subtitle::after { 
    content: ''; 
    display: block; 
    width: 60px; 
    height: 4px; 
    background-color: var(--primary-color); 
    margin: 15px auto 0; 
}

a { color: var(--primary-color); text-decoration: none; transition: 0.3s; }
ul { list-style: none; }
section { padding: 60px 0; }
.text-center { text-align: center; }

/* =========================================
   3. KOMPONENTY (PRZYCISKI, INPUTY)
   ========================================= */
.btn {
    display: inline-block; 
    background-color: var(--primary-color); 
    color: #fff;
    padding: 14px 35px; 
    border-radius: 4px; 
    font-family: var(--font-primary);
    font-weight: 700; 
    text-transform: uppercase; 
    border: none; 
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); 
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    letter-spacing: 0.5px;
}

.btn:hover { 
    background-color: var(--primary-color-hover); 
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 20px rgba(211, 47, 47, 0.4);
    color: #fff;
}

.btn:active { transform: translateY(-1px); box-shadow: 0 5px 10px rgba(211, 47, 47, 0.3); }

/* Box informacyjny (np. o projektach indywidualnych) */
.info-box {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-color);
    padding: 20px 30px;
    margin-bottom: 30px;
    border-radius: 4px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.info-box i { font-size: 1.5rem; color: var(--primary-color); margin-bottom: 10px; display: block; }
.info-box h3 { margin: 0 0 5px 0; font-size: 1.1rem; color: #222; }
.info-box p { margin: 0; color: #555; font-size: 0.95rem; }

/* =========================================
   4. HEADER & NAWIGACJA
   ========================================= */
.header { 
    background: #fff; 
    padding: 10px 0; 
    border-bottom: 1px solid var(--border-color); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    box-shadow: 0 2px 10px var(--shadow-color); 
}

.header-container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 50px; 
    max-width: 1400px; 
    margin: 0 auto; 
    width: 100%; 
}

.logo-img { height: 100px; width: auto; display: block; }

.main-nav .nav-list { display: flex; gap: 40px; }

.main-nav a { 
    color: #444; 
    font-weight: 600; 
    font-family: var(--font-primary); 
    text-transform: uppercase; 
    font-size: 1.2rem; 
    position: relative; 
    padding: 10px 0; 
}

.main-nav a::after { 
    content: ''; 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 0; 
    height: 3px; 
    background-color: var(--primary-color); 
    transition: width 0.3s; 
}

.main-nav a.active::after, .main-nav a:hover::after { width: 100%; }
.main-nav a.active { color: var(--primary-color); }

.mobile-nav-toggle { display: none; }
.mobile-menu-logo { display: none; text-align: center; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid #eee; width: 100%; }
.mobile-menu-logo img { height: 80px; width: auto; }

/* =========================================
   5. SEKCJJA HERO (SLIDER)
   ========================================= */
.hero {
    background: transparent; 
    text-align: center; 
    padding: 80px 0; 
    position: relative; 
    border-bottom: 1px solid var(--border-color);
    overflow: hidden; 
    z-index: 1; 
}

/* Slider tła */
.hero-slider {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
}
.hero-slider::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.70), rgba(255, 255, 255, 0.70));
    z-index: 2;
}

.hero-slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center center;
    opacity: 0; transition: opacity 1.5s ease-in-out; z-index: 1;
}
.hero-slide.active { opacity: 1; }

/* Treść Hero */
.hero h1 { 
    font-size: 3.5rem; 
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.25); 
    color: #222; 
    line-height: 1.2; 
    margin-bottom: 20px; 
}
.hero h1 span { color: var(--primary-color); }

.hero-features {
    margin-top: 20px; margin-bottom: 30px;
    font-family: var(--font-primary);
    color: #222; font-size: 1.2rem; font-weight: 700; line-height: 1.6;
}
.hero-features p { margin: 5px 0; }

.hero-btn { 
    margin-top: 40px;
    padding: 18px 45px;
    font-size: 1.1rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center; justify-content: center; gap: 15px;
    box-shadow: 0 8px 25px rgba(121, 32, 32, 0.4);
    transition: all 0.3s ease;
    max-width: 100%; width: auto;
}
.hero-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(121, 32, 32, 0.6);
    background-color: var(--primary-color-hover);
}
.hero-btn i { animation: bounceArrow 2s infinite; }

@keyframes bounceArrow {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(3px); }
    60% { transform: translateY(1.5px); }
}

/* =========================================
   6. KATALOG I FILTRY
   ========================================= */
/* Filtry */
.filter-container {
    background: #fff; padding: 25px; border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05); margin-bottom: 40px;
    border: 1px solid var(--border-color);
}
.filter-form { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; justify-content: center; }
.filter-group { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.filter-group label { font-size: 0.9rem; font-weight: 700; margin-bottom: 8px; color: #555; text-transform: uppercase; }
.filter-group select, .filter-group input {
    padding: 12px; border: 1px solid #ddd; border-radius: 4px;
    font-family: var(--font-secondary); font-size: 1rem;
    background-color: #fcfcfc; width: 100%; transition: 0.3s;
}
.filter-group select:focus, .filter-group input:focus { border-color: var(--primary-color); outline: none; background-color: #fff; }
.range-inputs { display: flex; align-items: center; gap: 10px; }
.range-inputs span { font-weight: bold; color: #999; }
.filter-actions { display: flex; align-items: flex-end; min-width: 150px; }

.btn-outline {
    background-color: transparent; border: 2px solid var(--primary-color);
    color: var(--primary-color); width: 100%; padding: 11px 20px;
}
.btn-outline:hover { background-color: var(--primary-color); color: #fff; }
.results-count { text-align: center; margin-top: 15px; font-size: 0.9rem; color: #777; font-style: italic; }

/* Grid Katalogu */
.catalog-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 40px; }
.catalog-card {
    background: #fff; border-radius: 4px; overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color); cursor: pointer;
    flex: 1 1 340px; max-width: 400px; width: 100%;
}
.catalog-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.15); 
    border-color: var(--primary-color); 
}

.card-image { height: 250px; width: 100%; overflow: hidden; position: relative; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.catalog-card:hover .card-image img { transform: scale(1.1); }

.certificate-badge {
    position: absolute; top: 0; left: 0;
    width: 70px !important; height: auto !important; z-index: 10;
    background-color: rgba(255, 255, 255, 0.9); padding: 5px;
    border-bottom-right-radius: 5px; box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    transform: none !important; transition: none !important;
}
.card-info { padding: 15px; text-align: center; }
.card-info h3 { margin: 0; font-size: 1.1rem; color: #333; font-weight: 700; }

/* =========================================
   7. SEKCJA O NAS
   ========================================= */
.about-section { background-color: #fff; padding: 80px 0; }
.about-text, .cert-intro {
    font-family: var(--font-secondary); color: #444; line-height: 1.9;
    margin: 0 auto 25px auto; text-align: center; font-size: 1.15rem; max-width: 800px;
}
.certificates-section {
    margin-top: 60px; text-align: center; background-color: #fcfcfc;
    padding: 60px 20px; border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.single-cert-wrapper { margin-top: 40px; display: flex; justify-content: center; }
.cert-img-single { 
    background-color: #fff; border: 10px solid #fff; max-width: 550px; height: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12); border-radius: 4px; transition: 0.4s; 
}
.cert-img-single:hover { transform: scale(1.03); }

/* =========================================
   8. KONTAKT I FORMULARZ
   ========================================= */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.contact-form input, .contact-form textarea { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 4px; margin-bottom: 15px; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--primary-color); }
.map-container { height: 300px; background: #eee; margin-bottom: 25px; }
.map-container iframe { width: 100%; height: 100%; }

.contact-details-box { margin-top: 20px; }
.address { margin-bottom: 10px; }
.address i { color: var(--primary-color); margin-right: 12px; width: 20px; text-align: center; font-size: 1.1rem; }
.company-legal-info {
    margin-top: 25px; padding-top: 15px; border-top: 1px solid #ddd;
    font-size: 0.9rem; color: #666; line-height: 1.8;
}

/* =========================================
   9. FOOTER
   ========================================= */
.footer { background: #272626; color: #ccc; padding: 50px 0 20px; }
.footer-content {
    display: flex; justify-content: center; gap: 80px; margin-bottom: 40px;
    text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 30px; flex-wrap: wrap;
}
.footer-column { max-width: 400px; }
.footer-column h4 { 
    color: #fff; margin-bottom: 20px; font-size: 1.3rem; 
    border-bottom: 2px solid var(--primary-color); 
    display: inline-block; padding-bottom: 5px;
}
.footer-column p { margin-bottom: 8px; font-size: 0.95rem; }
.footer-column i { color: var(--primary-color); margin-right: 10px; width: 15px; }
.legal-small { margin-top: 15px; }
.legal-small p { font-size: 0.85rem; color: #999; margin-bottom: 4px; }
.footer-bottom { text-align: center; font-size: 0.9rem; color: #888; }

/* =========================================
   10. MODALE (POP-UPY)
   ========================================= */
/* Modal Ogólny (Dom) */
.modal {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0;
    width: 100%; height: 100%; overflow: auto;
    background-color: rgba(0, 0, 0, 0.77); animation: fadeIn 0.3s;
}
.modal-content {
    background-color: #fff; margin: 5% auto; width: 90%; max-width: 1200px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5); border-radius: 4px;
    overflow: hidden; position: relative; animation: slideIn 0.3s;
    border-top: 5px solid var(--primary-color);
}
.close-modal {
    color: #333; float: right; font-size: 35px; font-weight: bold;
    position: absolute; right: 25px; top: 15px; cursor: pointer;
    z-index: 2001; transition: 0.3s; line-height: 1;
}
.close-modal:hover { color: var(--primary-color); transform: rotate(90deg); }

.modal-header { background-color: #fff; color: #111; padding: 30px 40px 10px 40px; border-bottom: 1px solid #eee; }
.modal-header h2 {
    margin: 0; text-align: left; color: #111; font-size: 2.2rem;
    text-transform: uppercase; border-left: 5px solid var(--primary-color);
    padding-left: 20px;
}
.modal-header h2::after { display: none; }

.modal-body { display: grid; grid-template-columns: 1fr 1.2fr; gap: 0; min-height: 500px; }
.modal-info { 
    padding: 40px; 
    font-family: var(--font-secondary); 
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start; /* Zmiana z center na flex-start */
}

/* Prawa część - zdjęcie główne + rzuty */
.modal-image-container {
    background-color: #fcfcfc; 
    display: flex; 
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; 
    padding: 40px; 
    border-left: 1px solid #eee;
    overflow-y: auto;
}
.modal-image-container img#modal-img {
    width: 100%; height: auto; max-height: 500px; object-fit: contain;
    border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.house-description { font-size: 1.05rem; color: #555; margin-bottom: 30px; line-height: 1.8; text-align: justify; }

.spec-row { display: flex; justify-content: space-between; padding: 12px 15px; border-bottom: 1px solid #eee; font-size: 0.95rem; }
.spec-row:nth-child(odd) { background-color: #f9f9f9; }
.spec-row:hover { background-color: #eaeaea; }
.spec-row strong { color: #333; font-weight: 700; }

/* --- Sekcja rzutów w modalu (NOWOŚĆ) --- */
.floor-plans-section {
    width: 100%;
    margin-top: 30px;
    text-align: center;
}
.floor-plans-hint {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    font-weight: 500;
}
.floor-plans-hint i { margin-right: 6px; }

.floor-plans-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}
.floor-plans-gallery img {
    max-height: 220px;
    max-width: 100%;       /* Dodano: Zapobiega uciekaniu obrazka poza ekran */
    height: auto;          /* Dodano: Utrzymuje prawidłowe proporcje */
    object-fit: contain;   /* Dodano: Zapewnia poprawne skalowanie */
    cursor: zoom-in;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: transform 0.2s, border-color 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.floor-plans-gallery img:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

/* Lightbox ogólny (Powiększanie rzutów) */
.lightbox-modal {
    display: none; 
    position: fixed; 
    z-index: 9999; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.9); 
    align-items: center; 
    justify-content: center;
}
.lightbox-content {
    max-width: 100%; 
    max-height: 100%; 
    border-radius: 4px; 
    box-shadow: 0 0 20px rgba(0,0,0,0.5); 
    animation: zoomIn 0.3s ease;
    transition: transform 0.3s ease; /* Płynne przybliżenie */
}

.lightbox-content:hover {
    cursor: zoom-in;
}

/* Nowa klasa dodawana przez skrypt po kliknięciu */
.lightbox-content.zoomed {
    transform: scale(2.5); /* Powiększa obraz dwukrotnie (możesz zmienić np. na 2.5) */
    cursor: zoom-out; /* Zmienia lupę na taką z minusem */
}
.close-lightbox {
    position: absolute; 
    top: 20px; 
    right: 35px; 
    color: #f1f1f1; 
    font-size: 40px; 
    font-weight: bold; 
    cursor: pointer; 
    transition: 0.3s;
    z-index: 10000;
}
.close-lightbox:hover { color: var(--primary-color); }


/* Modal Certyfikatu (Lightbox O Nas) */
.cert-lightbox {
    display: none; justify-content: center; align-items: center;
    overflow: hidden !important; padding: 20px;
}
.cert-modal-content {
    position: relative; display: flex; justify-content: center; align-items: center;
    max-width: 95%; max-height: 95%; animation: zoomIn 0.3s ease;
}
.cert-modal-content img {
    max-width: 100%; max-height: 90vh; width: auto; height: auto;
    border: 6px solid #fff; border-radius: 4px; box-shadow: 0 0 40px rgba(0,0,0,0.6); display: block;
}
.close-cert-modal {
    position: fixed; top: 20px; right: 30px; color: #fff; font-size: 50px;
    font-weight: bold; cursor: pointer; z-index: 2100; transition: 0.3s;
    line-height: 1; text-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.close-cert-modal:hover { color: var(--primary-color); transform: scale(1.1); }

/* Animacje */
.fade-in-up { opacity: 0; transform: translateY(30px); transition: 0.8s; }
.fade-in-up.is-visible { opacity: 1; transform: translateY(0); }
@keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} }
@keyframes slideIn { from {transform: translateY(30px); opacity: 0;} to {transform: translateY(0); opacity: 1;} }
@keyframes zoomIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* =========================================
   11. RWD - MEDIA QUERIES
   ========================================= */
/* Tablety i małe laptopy */
@media (max-width: 992px) {
    .modal-body { grid-template-columns: 1fr; }
    .modal-content { margin: 0; width: 100%; height: 100%; border-radius: 0; overflow-y: scroll; border-top: none; }
    .modal-image-container { padding: 20px; order: -1; background: #fff; border-bottom: 1px solid #eee; overflow-y: visible; }
    .modal-header { padding: 20px; }
    .modal-header h2 { font-size: 1.5rem; }
    .close-modal { top: 15px; right: 15px; }
}

/* Telefony (Mobile) */
@media (max-width: 768px) {
    .header-container { padding: 0 20px; }
    .mobile-nav-toggle { display: block; background: none; border: none; font-size: 1.5rem; color: #333; cursor: pointer; }
    
    .main-nav { 
        position: fixed; top: 0; right: -100%; width: 100%; height: 100vh; 
        background: #fff; display: flex; flex-direction: column; transition: 0.3s; z-index: 999; 
    }
    .main-nav.active { right: 0; }
    .main-nav .nav-list { flex-direction: column; align-items: center; margin-top: 120px; gap: 30px; }
    
    .mobile-menu-logo { display: block; }

    .hero h1 { font-size: 2.2rem; }
    .logo-img { height: 50px; }
    
    .hero-btn { padding: 15px 30px; font-size: 0.95rem; width: 90%; }
    .hero-features { font-size: 0.95rem; padding: 0 10px; }

    .filter-form { flex-direction: column; }
    .filter-group, .filter-actions { width: 100%; }
    .info-box { padding: 15px; }

    .footer-content { flex-direction: column; gap: 40px; }
    .contact-grid { grid-template-columns: 1fr; }

    .about-text, .cert-intro { font-size: 1.1rem; padding: 0 10px; }
    .cert-img-single { width: 100%; max-width: 100%; border-width: 5px; }
    
    .close-cert-modal { top: 10px; right: 20px; font-size: 40px; }
    .cert-modal-content img { border-width: 4px; }
}
/* =========================================
   12. SEKCJA SYSTEM THREE (Technologia)
   ========================================= */
.system-tech-section {
    background-color: #f4f4f4; 
    padding: 80px 0;
    border-bottom: 1px solid var(--border-color);
}

.system-intro {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 50px auto;
    color: #555;
    line-height: 1.8;
}

.section-subtitle {
    text-align: center;
    font-size: 1.5rem;
    margin-top: 40px;
    margin-bottom: 30px;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Grid dla kafelków */
.system-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* Wygląd pojedynczego kafelka */
.system-card {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border-bottom: 4px solid transparent;
    height: 100%; 
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Ikony w kółeczkach */
.icon-box {
    width: 70px;
    height: 70px;
    background-color: rgba(121, 32, 32, 0.1); 
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
    transition: 0.3s;
}

.system-card h4 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #222;
}

.system-card p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
}

.highlight-card {
    border: 1px solid #eee;
}

/* Box Podsumowania i Funkcji */
.system-summary-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border-left: 6px solid var(--primary-color);
    margin-top: 60px;
}

.system-summary-box h3 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.system-list {
    list-style: none;
    margin: 20px 0;
    padding: 0;
}

.system-list li {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #444;
}

.system-list li i {
    color: var(--primary-color);
    margin-right: 10px;
}

.summary-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #555;
    font-size: 1.1rem;
}

/* Responsywność */
@media (max-width: 768px) {
    .system-grid {
        grid-template-columns: 1fr;
    }
    
    .system-summary-box {
        padding: 25px;
    }
}