.magenest-map-points {
    --mmp-accent: #D33791;
    --mmp-marker-size: 64px;
    position: relative;
    width: 100%;
}

.mmp-stage {
    position: relative;
    width: 100%;
    line-height: 0;
    background: linear-gradient(180deg, rgba(245, 172, 222, 0.25) 0%, rgba(220, 231, 253, 0.25) 100%);
    border-radius: 16px;
    -webkit-border-radius: 16px;
    -moz-border-radius: 16px;
    -o-border-radius: 16px;
    padding: 16px;
}

.mmp-base {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px !important;
    -webkit-border-radius: 12px !important;
    -moz-border-radius: 12px !important;
    -o-border-radius: 12px !important;
}

/* --------------------------------------------------------------------------
 * Fixed corner label (top-right of the map)
 * ----------------------------------------------------------------------- */
.mmp-label {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 20;
    max-width: 185px;
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #E19DC5;
    border-radius: 8px;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    -o-border-radius: 8px;
    text-align: center;
    color: rgba(38, 38, 38, 1);
    font-size: 14px;
    text-transform: uppercase;
    line-height: 20px;
    letter-spacing: 0.1px;
    pointer-events: none;
    font-family: 'gilroy-bold';
}

/* --------------------------------------------------------------------------
 * Marker
 * ----------------------------------------------------------------------- */
.mmp-point {
    position: absolute;
    transform: translate(-50%, -50%);
    max-width: 40px;
    height: auto;
    z-index: 2;
    line-height: 1;
}

.mmp-point.is-open,
.mmp-point:hover {
    z-index: 5;
}

.mmp-marker {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Never exceed the point box (max-width 40px), but honour a smaller
       "Kích thước marker" control value. */
    width: min(var(--mmp-marker-size), 100%);
    height: auto;
    aspect-ratio: 1 / 1;
    font-size: min(var(--mmp-marker-size), 40px);
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--mmp-accent);
    cursor: pointer;
    line-height: 1;
}

.mmp-marker-icon {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.mmp-marker-icon svg,
.mmp-marker-icon i {
    width: 100%;
    height: 100%;
    font-size: 1em;
    fill: currentColor;
    color: currentColor;
}

/* Pulsing highlight so visitors notice the marker is interactive. */
.mmp-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 70%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--mmp-accent);
    opacity: 0.6;
    z-index: 1;
    animation: mmp-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
    pointer-events: none;
}

@keyframes mmp-ping {
    0% {
        transform: translate(-50%, -50%) scale(0.6);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.6);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mmp-pulse {
        animation: none;
    }
}

/* --------------------------------------------------------------------------
 * Tooltip card
 * ----------------------------------------------------------------------- */
.mmp-card {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(calc(-50% + var(--mmp-shift, 0px)));
    display: flex;
    gap: 12px;
    width: 360px;
    max-width: 70vw;
    padding: 8px;
    background: #fff;
    box-shadow: 0px 6px 16px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12), 0px 0px 28px 8px rgba(0, 0, 0, 0.05);
    -webkit-box-shadow: 0px 6px 16px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12), 0px 0px 28px 8px rgba(0, 0, 0, 0.05);
    -o-box-shadow: 0px 6px 16px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12), 0px 0px 28px 8px rgba(0, 0, 0, 0.05);
    -moz-box-shadow: 0px 6px 16px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12), 0px 0px 28px 8px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    -o-border-radius: 8px;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;
}

.mmp-point.is-open .mmp-card {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@media (hover: hover) {
    .mmp-point:hover .mmp-card {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

/* Down-pointing caret centered over the marker. */
.mmp-card::after {
    content: "";
    position: absolute;
    top: 100%;
    left: calc(50% - var(--mmp-shift, 0px));
    transform: translateX(-50%);
    border: 9px solid transparent;
    border-top-color: #fff;
    filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.06));
}

/* Not enough room above: drop the card below and flip the caret up. */
.mmp-point.mmp-flip-down .mmp-card {
    bottom: auto;
    top: calc(100% + 12px);
}

.mmp-point.mmp-flip-down .mmp-card::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #fff;
    filter: drop-shadow(0 -3px 2px rgba(0, 0, 0, 0.06));
}

.mmp-card-media {
    flex: 0 0 130px;
    width: 130px;
}

.mmp-card-media img {
    display: block;
    width: 130px;
    height: 130px;
    object-fit: cover;
    border-radius: 4px;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    -o-border-radius: 4px;
}

.mmp-card-body {
    flex: 1 1 auto;
    min-width: 0;
}

.mmp-card-title {
    margin: 0;
    color: var(--mmp-accent);
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    letter-spacing: 0.1px;
}

.mmp-card-hours {
    margin: 0 0 8px;
    font-size: 14px;
    color: rgba(38, 38, 38, 1);
    line-height: 20px;
    letter-spacing: 0.15px;
}

.mmp-hours-time {
    color: var(--mmp-accent);
}

.mmp-card-gifts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mmp-card-gifts li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(38, 38, 38, 1);
    line-height: 20px;
    letter-spacing: 0.15px;
}

.mmp-gift-icon {
    display: inline-flex;
    color: var(--mmp-accent);
    flex: 0 0 auto;
}

.mmp-gift-icon svg,
.mmp-gift-icon i {
    width: 16px;
    height: 16px;
    font-size: 16px;
    fill: currentColor;
}

.mmp-gift-icon .mmp-gift-img {
    display: block;
    width: 20px;
    height: 20px;
}

/* --------------------------------------------------------------------------
 * Mobile preview + popup (hidden on desktop)
 * ----------------------------------------------------------------------- */
.mmp-preview,
.mmp-modal {
    display: none;
}

.mmp-no-scroll {
    overflow: hidden;
}

@media (max-width: 1024px) {
    .mmp-card {
        width: 260px;
    }

    .mmp-card-media,
    .mmp-card-media img {
        flex-basis: 91px;
        width: 91px;
        height: 91px;
    }

    /* Inline interactive stage is replaced by the tap-to-open preview. */
    .magenest-map-points > .mmp-stage {
        display: none;
    }

    .mmp-preview {
        display: block;
        width: 100%;
        padding: 16px;
        background: linear-gradient(180deg, rgba(245, 172, 222, 0.25) 0%, rgba(220, 231, 253, 0.25) 100%);
        border: 1px solid rgba(211, 55, 145, 0.4);
        border-radius: 16px;
        -webkit-border-radius: 16px;
        -moz-border-radius: 16px;
        -o-border-radius: 16px;
        cursor: pointer;
    }

    .mmp-preview-img {
        display: block;
        width: 100%;
        height: auto;
        border-radius: 16px !important;
        -webkit-border-radius: 16px !important;
        -moz-border-radius: 16px !important;
        -o-border-radius: 16px !important;
    }

    .mmp-preview-hint {
        display: block;
        margin-top: 16px;
        text-align: center;
        color: rgba(79, 79, 79, 1);
        font-size: 16px;
        line-height: 24px;
        letter-spacing: 0.1px;
    }

    /* Popup */
    .magenest-map-points.mmp-open .mmp-modal {
        display: block;
    }

    .mmp-modal {
        position: fixed;
        inset: 0;
        z-index: 99999;
    }

    .mmp-modal-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
    }

    .mmp-modal-dialog {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 92vw;
        height: 85vh;
        background-color: transparent;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .mmp-modal-close {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 3;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background-color: #fff;
        box-shadow: 0px 4px 12px rgba(17, 17, 17, 0.08);
        line-height: 0;
        cursor: pointer;
    }

    .mmp-modal-close img {
        display: block;
        width: 24px;
        height: 24px;
    }

    .mmp-modal-body {
        position: relative;
        flex: 1 1 auto;
        overflow: hidden;
        touch-action: none;
        border-radius: 12px;
        -webkit-border-radius: 12px;
        -moz-border-radius: 12px;
        -o-border-radius: 12px;
    }

    .mmp-modal-body .mmp-stage {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        transform-origin: 0 0;
        will-change: transform;
        /* Reset ALL padding: JS sizes the stage to cover the viewport, so any
           leftover side padding shows as an empty strip when panned to the edge
           (most visible in landscape). */
        padding: 0;
    }

    .mmp-modal-body .mmp-base {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 0;
    }

    /* Floating tooltip cards are unused inside the popup. */
    .mmp-modal-body .mmp-card {
        display: none !important;
    }

    .mmp-modal-hint {
        flex: 0 0 auto;
        padding: 16px 0 0;
        text-align: center;
        font-size: 16px;
        line-height: 24px;
        color: rgba(255, 255, 255, 1);
    }

    /* Bottom detail card (content cloned from the tapped point). */
    .mmp-modal-card {
        position: absolute;
        left: 12px;
        right: 12px;
        bottom: 52px;
        z-index: 4;
        display: none;
        gap: 12px;
        padding: 8px;
        background-color: #fff;
        border-radius: 8px;
        -webkit-border-radius: 8px;
        -moz-border-radius: 8px;
        -o-border-radius: 8px;
        box-shadow: 0px 6px 16px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12), 0px 0px 28px 8px rgba(0, 0, 0, 0.05);
    }

    .mmp-modal-card.is-visible {
        display: flex;
    }

    /* ----------------------------------------------------------------------
     * Inline mode: render the map straight into the page (no popup)
     * ------------------------------------------------------------------- */
    .mmp-mobile-inline {
        background: linear-gradient(90deg, rgba(245, 172, 222, 0.25) 0%, rgba(220, 231, 253, 0.25) 100%);
        backdrop-filter: blur(10px);
        border-radius: 24px;
        -webkit-border-radius: 24px;
        -moz-border-radius: 24px;
        -o-border-radius: 24px;
        padding: 8px;
        border: 2px solid rgba(220, 231, 253, 0.25);
    }

    .mmp-mobile-inline .mmp-preview {
        display: none;
    }

    .mmp-mobile-inline .mmp-modal {
        position: static;
        z-index: auto;
    }

    .mmp-mobile-inline .mmp-modal-backdrop,
    .mmp-mobile-inline .mmp-modal-close {
        display: none;
    }

    .mmp-mobile-inline .mmp-modal-dialog {
        position: static;
        transform: none;
        width: 100%;
        height: 90vh;
        max-height: none;
    }

    .mmp-mobile-inline .mmp-modal-card {
        border-radius: 16px;
        -webkit-border-radius: 16px;
        -moz-border-radius: 16px;
        -o-border-radius: 16px;
        bottom: 12px;
    }
}
