/* =========================================================
   EDYTOWANO: osobny layout strony mapy — ciaśniejszy pod 24 cale
   ========================================================= */

.map-page-app {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 230px;
    gap: 14px;
    max-width: 1320px;
    margin: 16px auto 26px;
    padding: 0 12px;
    box-sizing: border-box;
}

.map-page-app,
.map-page-app * {
    box-sizing: border-box;
}

.map-panel,
.map-main-panel {
    background: #ffffff;
    border: 1px solid #e0d6c8;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.map-panel {
    padding: 12px;
    align-self: start;
    position: sticky;
    top: 12px;
}

.map-main-panel {
    padding: 12px;
    min-width: 0;
    overflow: hidden;
}

.map-panel-box {
    padding: 10px;
    border: 1px solid #eee2d2;
    border-radius: 12px;
    background: #fffaf3;
    margin-bottom: 10px;
}

.map-panel-box h2,
.map-panel-box h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.map-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.map-header h1 {
    margin: 0 0 5px;
    font-size: 23px;
}

.map-header p {
    margin: 0;
    color: #475569;
    font-size: 14px;
}

.map-input,
.map-select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d6c9b8;
    border-radius: 10px;
    background: #ffffff;
    font-size: 13px;
    box-sizing: border-box;
}

.map-input:focus,
.map-select:focus {
    outline: none;
    border-color: #174985;
    box-shadow: 0 0 0 3px rgba(23, 73, 133, 0.14);
}

.map-check {
    display: flex;
    gap: 7px;
    align-items: center;
    margin: 7px 0;
    font-size: 13px;
    cursor: pointer;
}

.travel-map {
    width: 100%;
    height: 600px;
    max-width: 100%;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #d1d5db;
    background: #f8fafc;
}

.map-status {
    margin-top: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    font-size: 13px;
}

.map-results-section {
    margin-top: 14px;
}

.map-results-section h2 {
    margin: 0 0 10px;
    font-size: 20px;
}

.map-results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.map-result-card {
    display: flex;
    gap: 9px;
    align-items: center;
    text-align: left;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.map-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.10);
}

.map-result-card img,
.map-result-noimg {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    flex: 0 0 52px;
    object-fit: cover;
    background: #f1f5f9;
    display: grid;
    place-items: center;
    font-size: 22px;
}

.map-result-card strong {
    display: block;
    color: #0f172a;
    font-size: 13px;
    margin-bottom: 3px;
}

.map-result-card small {
    display: block;
    color: #64748b;
    font-size: 11px;
}

.map-side-list {
    display: grid;
    gap: 7px;
}

.map-side-item {
    width: 100%;
    text-align: left;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 10px;
    padding: 8px 9px;
    cursor: pointer;
    font-size: 13px;
}

.map-side-item:hover {
    background: #f1f5f9;
}

.map-empty {
    color: #64748b;
    font-size: 13px;
    margin: 0;
}

/* =========================================================
   EDYTOWANO: popup Leaflet
   ========================================================= */

.map-popup {
    min-width: 230px;
    max-width: 300px;
}

.map-popup-image {
    width: 100%;
    max-height: 135px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 9px;
    border: 1px solid #e5e7eb;
}

.map-popup h3 {
    margin: 0 0 7px;
    font-size: 17px;
}

.map-type {
    display: inline-block;
    margin-bottom: 7px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #f1f5f9;
    color: #334155;
}

.map-region,
.map-desc {
    margin: 0 0 7px;
    color: #475569;
    font-size: 13px;
}

.map-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.map-popup-actions a {
    display: inline-block;
    padding: 7px 9px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    background: #174985;
}

.map-popup-actions a.map-youtube {
    background: #dc2626;
}

.map-popup-actions a.map-place {
    background: #0f766e;
}

/* =========================================================
   EDYTOWANO: responsywność mapy
   ========================================================= */

@media (max-width: 1350px) {
    .map-page-app {
        grid-template-columns: 230px minmax(0, 1fr) 220px;
        max-width: 1220px;
        gap: 12px;
    }

    .travel-map {
        height: 560px;
    }
}

@media (max-width: 1150px) {
    .map-page-app {
        grid-template-columns: 230px minmax(0, 1fr);
    }

    .map-right-panel {
        grid-column: 1 / -1;
        position: static;
    }
}

@media (max-width: 850px) {
    .map-page-app {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }

    .map-panel {
        position: static;
    }

    .travel-map {
        height: 520px;
    }

    .map-results-list {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   DODANO: grupowanie cech w lewym panelu mapy
========================================================= */
.map-feature-filters {
    display: grid;
    gap: 10px;
}

.map-feature-group {
    padding: 8px 0 10px;
    border-bottom: 1px solid #eadfce;
}

.map-feature-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.map-feature-group-title {
    margin: 0 0 6px;
    font-weight: 800;
    font-size: 13px;
    color: #174985;
}

.map-feature-check {
    margin: 5px 0;
}

.map-feature-check span {
    line-height: 1.25;
}

/* =========================================================
   DODANO: adres i tagi cech w popupie mapy
========================================================= */
.map-address {
    margin: 0 0 7px;
    color: #334155;
    font-size: 13px;
}

.map-popup-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}

.map-feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    color: #334155;
}