/**
 * Solcasa - Style mapy ofert
 * Leaflet + MarkerCluster overrides + custom popup/marker design
 */

/* =====================================================================
   KONTENER MAPY
   ===================================================================== */
#offer-map {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border-radius: 0.75rem;
    z-index: 1;
}

.offer-map-wrapper {
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #DEA13D;
}

@media (min-width: 1024px) {
    .offer-map-wrapper {
        height: 700px;
    }
}

/* =====================================================================
   LOADING OVERLAY
   ===================================================================== */
#map-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
}

#map-loader .map-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3E1B0F;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =====================================================================
   CUSTOM MARKER
   ===================================================================== */
.solcasa-marker {
    background: none !important;
    border: none !important;
}

.solcasa-marker-pin {
    width: 30px;
    height: 42px;
    position: relative;
    background: #3E1B0F;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 6px rgba(62, 27, 15, 0.35);
    transition: transform 0.2s ease;
}

.solcasa-marker-pin::after {
    content: '';
    width: 14px;
    height: 14px;
    background: #DEA13D;
    position: absolute;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.solcasa-marker:hover .solcasa-marker-pin {
    transform: rotate(-45deg) scale(1.15);
}

/* =====================================================================
   CLUSTER MARKERS
   ===================================================================== */
.solcasa-cluster {
    background: none !important;
    border: none !important;
}

.solcasa-cluster-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    box-shadow: 0 3px 10px rgba(62, 27, 15, 0.3);
    transition: transform 0.2s ease;
}

.solcasa-cluster:hover .solcasa-cluster-inner {
    transform: scale(1.1);
}

.solcasa-cluster-small .solcasa-cluster-inner {
    background: #3E1B0F;
    width: 40px;
    height: 40px;
    font-size: 13px;
}

.solcasa-cluster-medium .solcasa-cluster-inner {
    background: #6B3A22;
    width: 48px;
    height: 48px;
    font-size: 15px;
}

.solcasa-cluster-large .solcasa-cluster-inner {
    background: #DEA13D;
    color: #3E1B0F;
    width: 56px;
    height: 56px;
    font-size: 16px;
}

/* =====================================================================
   POPUP
   ===================================================================== */
.solcasa-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(62, 27, 15, 0.1);
}

.solcasa-popup .leaflet-popup-content {
    margin: 0;
    width: 280px !important;
}

.solcasa-popup .leaflet-popup-tip {
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.solcasa-popup .leaflet-popup-close-button {
    color: #3E1B0F;
    font-size: 20px;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    top: 6px;
    right: 6px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    transition: background 0.2s;
}

.solcasa-popup .leaflet-popup-close-button:hover {
    background: rgba(255, 255, 255, 1);
    color: #3E1B0F;
}

/* Popup Card */
.solcasa-popup-card {
    display: block;
    text-decoration: none;
    color: #3E1B0F;
    transition: opacity 0.2s;
}

.solcasa-popup-card:hover {
    opacity: 0.92;
}

.solcasa-popup-img {
    width: 100%;
    height: 140px;
    overflow: hidden;
}

.solcasa-popup-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.solcasa-popup-card:hover .solcasa-popup-img img {
    transform: scale(1.05);
}

.solcasa-popup-body {
    padding: 12px 14px 14px;
}

.solcasa-popup-location {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 12px;
    color: #DEA13D;
    margin: 0 0 4px;
    line-height: 1.3;
}

.solcasa-popup-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.35;
    margin: 0 0 8px;
    color: #3E1B0F;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.solcasa-popup-details {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.solcasa-popup-detail {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #3E1B0F;
}

.solcasa-popup-detail svg {
    flex-shrink: 0;
}

.solcasa-popup-price {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #3E1B0F;
    margin: 0;
    line-height: 1.4;
}

/* =====================================================================
   LEAFLET OVERRIDES
   ===================================================================== */

/* Usunięcie domyślnych stylów MarkerCluster */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background: none !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background: none !important;
}

/* Leaflet attribution - mniejszy tekst */
.leaflet-control-attribution {
    font-size: 10px !important;
    opacity: 0.7;
}

/* Zoom control styling */
.leaflet-control-zoom a {
    font-family: 'DM Sans', sans-serif !important;
    color: #3E1B0F !important;
    border-color: rgba(62, 27, 15, 0.2) !important;
}

.leaflet-control-zoom a:hover {
    background-color: #f5f0eb !important;
}
