/**
 * Mapbox Frontend CSS
 */

.rm-listings-map-shortcode {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.rm-listings-marker {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rm-listings-marker--with-card {
    position: relative;
    color: #00012F;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.22));
    pointer-events: auto;
}

.rm-listings-marker-pin {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rm-listings-marker-card {
    position: absolute;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%);
    width: max-content;
    max-width: 220px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 12px;
    padding: 8px 10px;
    box-shadow: 0 10px 22px rgba(0,0,0,0.16);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.rm-listings-marker-card::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 12px;
    height: 12px;
    transform: translateX(-50%) rotate(45deg);
    background: rgba(255,255,255,0.95);
    border-right: 1px solid rgba(0,0,0,0.10);
    border-bottom: 1px solid rgba(0,0,0,0.10);
}

.rm-listings-marker-card-price {
    font-size: 12px;
    font-weight: 800;
    color: #0b1020;
    line-height: 1.1;
    margin-bottom: 4px;
    white-space: nowrap;
}

.rm-listings-marker-card-title {
    font-size: 12px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rm-listings-marker-card-subtitle {
    margin-top: 2px;
    font-size: 11px;
    color: #646970;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rm-listings-marker svg {
    width: 100%;
    height: 100%;
    display: block;
}

.rm-listings-marker svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Popup Styles */
.rm-listings-popup {
    max-width: 380px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #fff;
}

/* Header Section - Image and Title */
.rm-listings-popup-header {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #e5e5e5;
}

.rm-listings-popup-image-wrapper {
    width: 80px;
    height: 120px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.rm-listings-popup-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rm-listings-popup-header-content {
    flex: 1;
    min-width: 0;
}

.rm-listings-popup-title {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.3;
}

.rm-listings-popup-description {
    font-size: 13px;
    color: #646970;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Details Section */
.rm-listings-popup-details {
    position: relative;
    /* necesario para el ::after */
    overflow: hidden;
    /* evita que el overlay se salga */
    padding: 16px;
    border-bottom: 1px solid #e5e5e5;
}

.rm-listings-popup-details::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 10%;

    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    pointer-events: none;
    z-index: 10;
}

.rm-listings-popup-details-row {
    display: flex;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.rm-listings-popup-details-row:last-child {
    margin-bottom: 0;
}

.rm-listings-popup-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #1d2327;
}

.rm-listings-popup-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #646970;
}

.rm-listings-popup-detail-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Actions Section */
.rm-listings-popup-actions {
    padding: 16px;
}

.rm-listings-popup-button {
    display: block;
    width: 80%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #00012F 0%, #001a5c 50%, #002d8f 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.rm-listings-popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 1, 47, 0.4);
    color: #fff;
}

/* Mapbox Popup Customization */
.mapboxgl-popup-content {
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.mapboxgl-popup-close-button {
    font-size: 20px;
    padding: 4px 8px;
    color: #646970;
}

button.mapboxgl-popup-close-button {
    cursor: pointer;
    background-color: transparent;
    color: #fff;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    text-align: inherit;
    width: 15px;
    padding: 5px
}

.mapboxgl-popup-close-button:hover {
    color: #fff;
    background-color: #00012F
}

/* Single Listing Map Styles */
.rm-listing-map-single {
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Bouncing Pin Animation */
@keyframes rmListingPinBounce {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    25% {
        transform: translateY(-10px) scale(1.1);
    }

    50% {
        transform: translateY(-5px) scale(1.05);
    }

    75% {
        transform: translateY(-8px) scale(1.08);
    }
}

.rm-listing-pin-bouncing {
    display: block;
    position: relative;
    width: 40px;
    height: 50px;
    animation: rmListingPinBounce 1.5s ease-in-out infinite;
    transform-origin: bottom center;
    transition: transform 0.2s ease;
    pointer-events: none;
}

.rm-listing-pin-bouncing:hover {
    animation-play-state: paused;
    transform: translateY(-5px) scale(1.15);
}

.rm-listing-pin-bouncing svg {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}