/* --- Advanced Filter Panel Grid --- */
.advanced-filter-panel {
    display: grid;
    max-width: 1300px;
    grid-template-columns: repeat(4, 1fr); /* Forces exactly 4 columns */
    gap: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group.facilities-filter-group {
    grid-column: 1 / -1;
    text-align: center; /* Centers the label/header if desired */
}

/* --- Side-by-Side Pill Badges --- */
.facilities-pills-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Centers the facility pills horizontally */
    gap: 8px;
    margin-top: 4px;
    width: 100%;
}

.filter-group label {
    margin-bottom: 0;
}

.facility-pill-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.facility-pill-label:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* Hide the native checkbox element */
.facility-pill-label input[type="checkbox"] {
    display: none;
}

/* Active/selected style */
.facility-pill-label:has(input[type="checkbox"]:checked) {
    background: #23496a;
    color: white;
    border-color: #2b6cb0;
}

/* --- Professional Stable Info Box Styling --- */
.stableInfoBoxContent {
    display: flex;
    flex-direction: column;
    padding: 16px;
    flex-grow: 1;
    gap: 6px;
}

.stable-main-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px; /* Tighter gap so the type hugs the title closely as a subtitle */
}

.stable-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

/* Elegant subtitle style */
.tallinTyyppi {
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b; /* Muted slate gray, subtle and balanced */
    letter-spacing: 0.2px;
    text-transform: none; /* Removes the aggressive all-caps shouting */
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.stable-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.85rem;
    color: #64748b;
    margin: 4px 0;
}

.stable-meta p {
    margin: 0;
}

.stable-slots-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.slot-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: #475569;
    background: #f8fafc;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.slot-badge img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin-right: 5px;
}

.stable-price-tier {
    font-weight: 800;
    font-size: 0.95rem;
    color: #047857;
    letter-spacing: 1px;
}

.price-tier-container {
    display: flex;
    flex-direction: column; /* Stack label on top, symbols below */
    align-items: flex-end;   /* Align to the right side of the footer */
    gap: 1px;
}

.price-tier-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8; /* Soft muted gray */
}

.price-tier-text {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #23496a;
}


.stableInfoBoxFooter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px solid #f1f5f9;
}

.stable-slots-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.slot-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.slot-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8; /* Soft muted gray label */
}

.slot-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #475569;
    background: #f8fafc;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.slot-badge img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.price-tier-text {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #23496a;
    padding: 2px 4px;
    line-height: 1.2;
}

@media screen and (max-width: 1070px) {
    .stableInfoBox {
        flex-direction: column;
    }

    .stableInfoBoxContent {
        width: 100%;
    }
}