.space-section {
    padding: 60px 20px;
    max-width: 1250px;
    margin: 0 auto;
    background-color: #000000;
}

.space-section h2 {
    font-family: 'Playfair Display', serif;
    color: #a4b2a4;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.space-lead {
    font-family: 'Lora', serif;
    font-size: 1.15rem;
    color: #cccccc;
    line-height: 1.7;
    text-align: center;
    max-width: 900px;
    margin: 0 auto 40px auto;
}

/* Przycisk Główny Spaceru */
.main-spacer-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
}

.btn-main-spacer {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #0a0f0f;
    color: #ffffff;
    font-family: 'Lora', serif;
    text-decoration: none;
    padding: 15px 30px;
    border: 1px solid #a4b2a4;
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 1px;
    font-weight: 600;
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}

.btn-main-spacer:hover {
    background: #a4b2a4;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(164, 178, 164, 0.3);
}

.btn-main-spacer:hover .icon-map {
    fill: #000000;
}

.icon-map {
    width: 20px;
    height: 20px;
    fill: #a4b2a4;
    transition: fill 0.3s;
}

/* Filtry */
.space-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    border-bottom: 1px solid rgba(164, 178, 164, 0.15);
    padding-bottom: 20px;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(164, 178, 164, 0.3);
    color: #a4b2a4;
    padding: 10px 24px;
    font-family: 'Lora', serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
    background: #a4b2a4;
    color: #000000;
    border-color: #a4b2a4;
}

/* Nagłówki Pięter */
.floor-title {
    font-family: 'Playfair Display', serif;
    color: #ffffff;
    font-size: 1.8rem;
    margin-bottom: 30px;
    border-left: 3px solid #a4b2a4;
    padding-left: 15px;
}

.floor-group {
    margin-bottom: 60px;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* --- REWOLUCJA W SIATCE (CSS GRID) --- */
.space-grid {
    display: grid;
    gap: 30px;
    justify-content: center; /* Centruje cały układ siatki */
    width: 100%;
}

/* Kafelki - teraz mają jedną, stałą szerokość bazową */
.space-card {
    background: #0a0f0f;
    border: 1px solid rgba(164, 178, 164, 0.1);
    width: 100%;
    max-width: 360px; /* Wszystkie kafelki będą dokładnie tej samej wielkości */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* SZTYWNE WYMUSZENIE UKŁADU DLA DUŻYCH EKRANÓW (DESKTOP) */
@media (min-width: 1150px) {
    /* Parter: Dokładnie 3 kolumny po 360px każda */
    [data-floor="parter"] .space-grid {
        grid-template-columns: repeat(3, 360px);
        max-width: 1140px;
        margin: 0 auto;
    }

    /* Piętro: Dokładnie 2 kolumny po 360px każda (wylądują 2 w pierwszej i 2 w drugiej linii) */
    [data-floor="pietro"] .space-grid {
        grid-template-columns: repeat(2, 360px);
        max-width: 750px;
        margin: 0 auto;
    }
}

/* --- EMULACJA HOVER I RESZTA STYLÓW --- */
.space-card:hover {
    transform: translateY(-5px);
    border-color: rgba(164, 178, 164, 0.3);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.space-img-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #111;
}

.space-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(15%) contrast(1.05);
    transition: transform 0.5s ease;
}

.space-card:hover .space-img-wrapper img {
    transform: scale(1.04);
    filter: grayscale(0%) contrast(1.05);
}

.space-info {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.space-info h3 {
    font-family: 'Playfair Display', serif;
    color: #ffffff;
    font-size: 1.5rem;
    margin: 0 0 10px 0;
}

.space-capacity {
    font-family: 'Lora', serif;
    font-size: 1.05rem;
    color: #cccccc;
    margin-bottom: 25px;
    flex-grow: 1;
}

.space-capacity span {
    color: #a4b2a4;
    font-size: 0.85rem;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
}

.btn-card-spacer {
    display: block;
    text-align: center;
    background: #141a1a;
    color: #a4b2a4;
    border: 1px solid rgba(164, 178, 164, 0.2);
    padding: 12px 20px;
    text-decoration: none;
    font-family: 'Lora', serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.space-card:hover .btn-card-spacer {
    background: rgba(164, 178, 164, 0.1);
    border-color: #a4b2a4;
    color: #ffffff;
}

/* --- RESPONSYWNOŚĆ (TABLETY I SMARTFONY) --- */
/* --- RESPONSYWNOŚĆ (TABLETY I SMARTFONY) --- */
@media (max-width: 1149px) and (min-width: 768px) {
    /* Na tabletach wyświetlamy po 2 kafelki w linii, idealnie pośrodku ekranu */
    .space-grid {
        grid-template-columns: repeat(2, minmax(290px, 360px));
        justify-content: center; /* Centrowanie rzędu z dwoma kafelkami */
        max-width: 750px;        /* Dopasowanie kontenera do szerokości dwóch kolumn */
        margin: 0 auto;
    }
}

@media (max-width: 767px) {
    /* Na telefonach kafelki lądują jeden pod drugim i są centrowane */
    .space-grid {
        grid-template-columns: repeat(1, minmax(290px, 360px));
        justify-content: center; /* Centrowanie pojedynczego kafelka na ekranie telefonu */
        max-width: 360px;
        margin: 0 auto;
    }
    
    .space-card {
        max-width: 100%; /* Zabezpieczenie przed wyjechaniem na bardzo małych smartfonach */
    }

    .space-section h2 {
        font-size: 2rem;
    }
    
    .space-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-btn {
        width: 100%;
    }
}
