/* ============================================
   Catalogue Map Styles
   Extracted from catalogueMapInterop.js and mapStripInterop.js
   to ensure styles are always available before JS renders markers.
   ============================================ */

/* === Marker Styles (scoped under .rental-marker) === */
.rental-marker {
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #35a0ae;
}

.rental-marker.highlighted {
    background: #35a0ae;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(53, 160, 174, 0.4);
    z-index: 1000 !important;
}

.rental-marker.highlighted .price-tag {
    color: white;
}

.rental-marker .marker-content {
    padding: 4px 8px;
    white-space: nowrap;
}

.rental-marker .price-tag {
    font-size: 12px;
    font-weight: 600;
    color: #35a0ae;
}

/* === Cluster Styles (scoped under .rental-cluster) === */
.rental-cluster {
    background: rgba(53, 160, 174, 0.9);
    color: white;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
    padding: 8px 12px;
}

.rental-cluster .cluster-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rental-cluster .cluster-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

.rental-cluster .cluster-count {
    font-size: 20px;
    line-height: 1;
}

.rental-cluster.cluster-medium {
    background: rgba(53, 160, 174, 0.88);
}

.rental-cluster.cluster-large {
    background: rgba(53, 160, 174, 0.82);
}

.rental-cluster:hover {
    transform: scale(1.04) translateY(-2px);
    box-shadow: 0 10px 24px rgba(53, 160, 174, 0.35);
}

/* === User Location Marker (Catalogue Map) === */
.user-location-marker {
    position: relative;
    width: 20px;
    height: 20px;
}

.user-location-marker .dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #4285F4;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.user-location-marker .pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: rgba(66, 133, 244, 0.3);
    border-radius: 50%;
    animation: catalogue-map-pulse 2s infinite;
}

@keyframes catalogue-map-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
}

/* === Leaflet Popup Overrides (must be global - targets Leaflet elements) === */
.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    padding: 0 !important;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
}

.leaflet-popup-tip {
    background: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.rental-popup-wrapper {
    padding: 0 !important;
}

.rental-popup-wrapper .leaflet-popup-content {
    margin: 0 !important;
    width: 280px !important;
}

/* === Popup Content Styles (all scoped under .rental-popup) === */
.rental-popup {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.rental-popup .popup-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
    position: relative;
}

.rental-popup .popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rental-popup .popup-content {
    padding: 12px;
}

.rental-popup .popup-title {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.rental-popup .popup-price {
    margin: 0 0 12px 0;
    color: #35a0ae;
    font-weight: 600;
    font-size: 14px;
}

.rental-popup .popup-actions {
    display: flex;
    gap: 8px;
}

.rental-popup .popup-btn {
    flex: 1;
    padding: 8px 16px;
    background: #35a0ae;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.rental-popup .popup-btn:hover {
    background: #2a8490;
}

/* Store Info Styles (scoped under .rental-popup to prevent collision with RentalCard) */
.rental-popup .popup-store-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 0;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
}

.rental-popup .store-logo-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.rental-popup .store-details {
    flex: 1;
}

.rental-popup .store-name {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rental-popup .verified-badge {
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.rental-popup .store-slogan {
    font-size: 11px;
    color: #666;
    font-style: italic;
}

.rental-popup .store-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    margin-top: 2px;
}

.rental-popup .store-rating .stars {
    color: #FFB400;
}

/* Review Summary Styles (scoped under .rental-popup) */
.rental-popup .popup-review-summary {
    margin: 12px 0;
    padding: 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.rental-popup .overall-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.rental-popup .rating-value {
    font-size: 20px;
    font-weight: bold;
    color: #35a0ae;
}

.rental-popup .overall-rating .stars {
    color: #FFB400;
    font-size: 14px;
    letter-spacing: 2px;
}

.rental-popup .review-count {
    font-size: 11px;
    color: #666;
}

.rental-popup .rating-breakdown {
    margin-top: 8px;
}

.rental-popup .rating-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
}

.rental-popup .rating-label {
    font-size: 11px;
    color: #666;
    min-width: 60px;
}

.rental-popup .rating-bar {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.rental-popup .rating-fill {
    height: 100%;
    background: linear-gradient(90deg, #35a0ae, #4db8c4);
    border-radius: 3px;
    transition: width 0.3s;
}

.rental-popup .rating-score {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    min-width: 20px;
    text-align: right;
}

/* Options Badges (scoped under .rental-popup) */
.rental-popup .popup-options {
    display: flex;
    gap: 6px;
    margin: 8px 0;
}

.rental-popup .option-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* === Map Strip User Location Marker === */
.strip-user-marker {
    position: relative;
    width: 16px;
    height: 16px;
}

.strip-user-marker .strip-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #4285F4;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.strip-user-marker .strip-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: rgba(66, 133, 244, 0.3);
    border-radius: 50%;
    animation: map-strip-pulse 2s infinite;
}

@keyframes map-strip-pulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.8); opacity: 0.4; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
}
