/* Herravo — pines de mapa: foto circular + categoría. Premium más grande. */

.map-photo-pin {
    --category-color: #068C61;
    --pin-ring: var(--category-color);
    --pin-size: 42px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: var(--pin-size);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transform-origin: bottom center;
    transition: transform 0.16s ease, filter 0.16s ease;
    filter: drop-shadow(0 8px 14px rgba(15, 23, 42, 0.22));
}

.map-photo-pin--premium {
    --pin-ring: #e4b44c;
    --pin-size: 56px;
    z-index: 6;
    filter:
        drop-shadow(0 0 10px rgba(228, 180, 76, 0.42))
        drop-shadow(0 10px 18px rgba(15, 23, 42, 0.22));
}

.map-photo-pin__disc {
    position: relative;
    z-index: 1;
    width: var(--pin-size);
    height: var(--pin-size);
    border-radius: 50%;
    overflow: hidden;
    background: var(--category-color);
    color: #fff;
    border: 2.5px solid #fff;
    box-shadow: 0 0 0 2px var(--pin-ring);
    display: grid;
    place-items: center;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: calc(var(--pin-size) * 0.34);
    font-weight: 800;
    line-height: 1;
}

.map-photo-pin--premium .map-photo-pin__disc {
    border-width: 3px;
    box-shadow:
        0 0 0 2.5px var(--pin-ring),
        0 0 14px rgba(228, 180, 76, 0.5);
}

.map-photo-pin__disc .blur-image,
.map-photo-pin__disc img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.map-photo-pin__disc .blur-image__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-photo-pin__initial {
    display: block;
}

.map-photo-pin__tip {
    width: 10px;
    height: 10px;
    margin-top: -5px;
    background: #fff;
    border-right: 2px solid var(--pin-ring);
    border-bottom: 2px solid var(--pin-ring);
    transform: rotate(45deg);
    border-radius: 1px;
    z-index: 0;
}

.map-photo-pin__label {
    position: absolute;
    top: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    max-width: 5.6rem;
    padding: 0.16rem 0.42rem;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.map-photo-pin--premium .map-photo-pin__label {
    border-color: rgba(228, 180, 76, 0.55);
    color: #7a4e08;
}

.map-photo-pin__sparkle {
    position: absolute;
    top: -7px;
    left: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin-left: -9px;
    border-radius: 999px;
    background: linear-gradient(180deg, #f8e19a 0%, #e4b44c 100%);
    color: #7a4e08;
    box-shadow: 0 2px 6px rgba(122, 78, 8, 0.28);
    pointer-events: none;
}

.map-photo-pin.is-closed .map-photo-pin__disc {
    filter: grayscale(0.35);
    opacity: 0.92;
}

.map-photo-pin.category-cigarros-y-tabacos,
.map-photo-pin.category-cigars,
.map-photo-pin.category-tabaco {
    --category-color: #92400e;
}

.map-photo-pin.is-active {
    transform: scale(1.08);
    z-index: 20;
}

.map-photo-pin:hover,
.map-photo-pin.is-hover {
    transform: scale(1.05);
    z-index: 15;
}

.map-photo-pin--compact {
    --pin-size: 32px;
}

.map-photo-pin--premium.map-photo-pin--compact {
    --pin-size: 44px;
}

.mapboxgl-marker {
    z-index: 1;
}

.mapboxgl-marker:has(.map-photo-pin--premium) {
    z-index: 8;
}

.mapboxgl-marker:has(.map-photo-pin.is-active) {
    z-index: 20;
}

.mapboxgl-marker:has(.map-photo-pin.is-hover) {
    z-index: 15;
}

/* Pin draggable para editor de ubicación (vendedor) */
.ng-map-pin--picker {
    --pin-accent: #068C61;
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
    filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.22));
    transition: transform 0.16s ease;
}

.ng-map-pin--picker:active {
    cursor: grabbing;
    transform: scale(1.04);
}

.ng-map-pin--picker .ng-map-pin__bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 4px;
    border-radius: 999px;
    background: #ffffff;
    border: 2px solid var(--pin-accent);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
}

.ng-map-pin--picker .ng-map-pin__avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    overflow: hidden;
    background: #ffffff;
    color: #0f172a;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 800;
}

.ng-map-pin--picker .ng-map-pin__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ng-map-pin--picker .ng-map-pin__tip {
    width: 12px;
    height: 12px;
    margin-top: -3px;
    background: #ffffff;
    border-right: 2px solid var(--pin-accent);
    border-bottom: 2px solid var(--pin-accent);
    transform: rotate(45deg);
    border-radius: 2px;
}

@media (max-width: 640px) {
    .map-photo-pin {
        --pin-size: 38px;
    }

    .map-photo-pin--premium {
        --pin-size: 50px;
    }

    .map-photo-pin--compact {
        --pin-size: 30px;
    }

    .map-photo-pin--premium.map-photo-pin--compact {
        --pin-size: 40px;
    }

    .map-photo-pin__label {
        font-size: 9px;
        max-width: 4.8rem;
    }
}
