/* =========================================================
   Development Plot Map – Frontend styles  v1.3.6
   ========================================================= */

/* ── Block wrapper ────────────────────────────────────────── */
.wpm-map-block {
    --wpm-available:    #22c55e;
    --wpm-reserved:     #f59e0b;
    --wpm-sold:         #ef4444;
    --wpm-unavailable:  #6b7280;
    --wpm-coming-soon:  #3b82f6;
    --wpm-brand:        #C5601A;   /* Woodhall orange (overridden per-site by inline style) */
    --wpm-brand-hover:  #a04d15;
    --wpm-text:         #1d2327;
    --wpm-ms:           18px;
    font-family: 'Poppins', sans-serif;
    /* Break out of narrow Bootstrap column — fill most of the page */
    width: min(calc(100vw - 60px), 1500px);
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
    isolation: isolate;
}

/* ── Legend ───────────────────────────────────────────────── */
.wpm-frontend-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 13px;
    color: inherit;
}
.wpm-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    vertical-align: middle;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    margin-right: 2px;
}
.wpm-available   { background: var(--wpm-available);   }
.wpm-reserved    { background: var(--wpm-reserved);    }
.wpm-sold        { background: var(--wpm-sold);        }
.wpm-unavailable { background: var(--wpm-unavailable); }
.wpm-coming-soon { background: var(--wpm-coming-soon); }

/* ── Map outer ────────────────────────────────────────────── */
.wpm-map-outer {
    width: 100%;
    position: relative;
    overflow: visible;
    border-radius: 0;
    -webkit-user-select: none;
    user-select: none;
    background: #f3f4f6;
}
.wpm-map-outer.wpm-is-zoomed { overflow: hidden; cursor: grab; }
.wpm-map-outer.wpm-is-zoomed:active { cursor: grabbing; }

/* ── Map inner ────────────────────────────────────────────── */
.wpm-map-inner {
    position: relative;
    display: inline-block;
    line-height: 0;
    width: 100%;
    transform-origin: 0 0;
}
.wpm-site-map {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    border-radius: 0;
}

/* ── Plot marker — simple square ──────────────────────────── */
.wpm-hs {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* True square: equal width & height, no horizontal padding */
    width:  calc(var(--wpm-ms, 18px) * 1.5);
    height: calc(var(--wpm-ms, 18px) * 1.5);
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 0;
    border: 1.5px solid rgba(0,0,0,0.40);
    box-shadow: 0 1px 3px rgba(0,0,0,.22);
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
    transition: transform .12s ease, box-shadow .12s ease;
    box-sizing: border-box;
}
.wpm-hs.wpm-available   { background: var(--wpm-available);   }
.wpm-hs.wpm-reserved    { background: var(--wpm-reserved);    }
.wpm-hs.wpm-sold        { background: var(--wpm-sold);        }
.wpm-hs.wpm-unavailable { background: var(--wpm-unavailable); }
.wpm-hs.wpm-coming-soon { background: var(--wpm-coming-soon); }

.wpm-hs:hover,
.wpm-hs:focus,
.wpm-hs:focus-visible,
.wpm-hs.wpm-hs--active {
    transform: translate(-50%, -50%) scale(1.25);
    box-shadow: 0 4px 14px rgba(0,0,0,.45);
    z-index: 50;
    outline: none;
}

/* ── Current-plot highlight ───────────────────────────────── */
.wpm-hs.wpm-current {
    z-index: 40;
    box-shadow: 0 4px 14px rgba(0,0,0,.45);
}
.wpm-hs.wpm-current::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: calc(var(--wpm-ms, 18px) * 2.4);
    height: calc(var(--wpm-ms, 18px) * 2.4);
    transform: translate(-50%, -50%);
    border: 2px solid var(--wpm-brand);
    border-radius: 0;
    opacity: .85;
    pointer-events: none;
    animation: wpm-current-pulse 1.6s ease-out infinite;
    box-sizing: border-box;
}
@keyframes wpm-current-pulse {
    0%   { transform: translate(-50%, -50%) scale(0.55); opacity: .9; }
    70%  { transform: translate(-50%, -50%) scale(1.25); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1.25); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .wpm-hs.wpm-current::before { animation: none; opacity: .9; }
}

/* Plot number text */
.wpm-hs-num {
    display: block;
    font-size: calc(var(--wpm-ms, 18px) * 0.52);
    font-weight: 700;
    color: #fff;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    letter-spacing: -.2px;
    text-shadow: 0 1px 2px rgba(0,0,0,.35);
}

/* ── Shared hover tooltip ─────────────────────────────────── */
.wpm-hs-tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(15,15,15,.82);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 0;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .12s ease;
    z-index: 500;
    transform: translateX(-50%);
    letter-spacing: .1px;
    font-family: 'Poppins', sans-serif;
}
.wpm-hs-tooltip::after {
    content: '';
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(15,15,15,.82);
}
.wpm-hs-tooltip.wpm-tt-visible { opacity: 1; }
@media (pointer: coarse) { .wpm-hs-tooltip { display: none !important; } }

/* ── Slide-in plot panel ──────────────────────────────────── */
.wpm-plot-panel {
    position: absolute;
    top: 0; right: 0;
    width: 250px;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0,0,0,.14);
    border-radius: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transform: translateX(101%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .28s cubic-bezier(.4,0,.2,1),
                visibility 0s linear .28s;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
}
.wpm-plot-panel.wpm-panel--open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform .28s cubic-bezier(.4,0,.2,1),
                visibility 0s linear 0s;
}

/* Close button */
.wpm-panel-close {
    position: absolute;
    top: 10px; right: 10px;
    width: 28px; height: 28px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: rgba(0,0,0,.12);
    color: #39354f;
    font-size: 15px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background .15s;
    -webkit-user-select: none;
    user-select: none;
}
.wpm-panel-close:hover { background: rgba(0,0,0,.22); }

/* Thumbnail */
.wpm-panel-thumb {
    width: 100%;
    height: 150px;
    flex-shrink: 0;
    overflow: hidden;
    background: #e5e7eb;
}
.wpm-panel-thumb-inner {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.wpm-panel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Panel body */
.wpm-panel-body {
    padding: 16px 16px 20px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wpm-panel-plot-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--wpm-text, #39354f);
    margin: 0;
    line-height: 1.2;
}
.wpm-panel-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #fff !important;
    width: fit-content;
}
.wpm-panel-badge.wpm-available   { background: var(--wpm-available);   }
.wpm-panel-badge.wpm-reserved    { background: var(--wpm-reserved);    }
.wpm-panel-badge.wpm-sold        { background: var(--wpm-sold);        }
.wpm-panel-badge.wpm-unavailable { background: var(--wpm-unavailable); }
.wpm-panel-badge.wpm-coming-soon { background: var(--wpm-coming-soon); }

.wpm-panel-type {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    display: none;
}
.wpm-panel-type.wpm-visible { display: block; }

.wpm-panel-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--wpm-text, #39354f);
    margin: 4px 0 0;
    display: none;
}
.wpm-panel-price.wpm-visible { display: block; }

/* Beds / Baths */
.wpm-panel-features {
    display: none;
    flex-direction: row;
    gap: 14px;
    margin: 2px 0 4px;
}
.wpm-panel-features.wpm-visible { display: flex; }

.wpm-pf-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--wpm-text, #39354f);
}
.wpm-pf-icon {
    width: 17px; height: 17px;
    flex-shrink: 0;
    color: var(--wpm-brand);
    stroke: var(--wpm-brand);
}

.wpm-panel-promo {
    font-size: 12px;
    color: #39354f;
    font-weight: 600;
    background: #e8f6fd;
    padding: 6px 10px;
    border-radius: 0;
    margin: 4px 0 0;
    display: none;
}
.wpm-panel-promo.wpm-visible { display: block; }

/* CTA button — Sky-House square style */
.wpm-panel-cta {
    display: block !important;
    margin-top: 12px !important;
    padding: 12px 16px !important;
    background: var(--wpm-brand) !important;
    color: #fff !important;
    text-align: center !important;
    border-radius: 0 !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    font-family: 'Poppins', sans-serif !important;
    text-decoration: none !important;
    transition: background .15s !important;
    border: none !important;
    letter-spacing: .2px !important;
}
.wpm-panel-cta:hover { background: var(--wpm-brand-hover) !important; color: #fff !important; }

/* ── Zoom controls ────────────────────────────────────────── */
.wpm-zoom-controls {
    position: absolute;
    top: 10px; right: 10px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: all;
}
.wpm-zoom-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border: 1px solid rgba(0,0,0,.18) !important;
    background: rgba(255,255,255,.92) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.2) !important;
    color: #39354f !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    transition: background .12s ease !important;
    -webkit-user-select: none;
    user-select: none;
}
.wpm-zoom-btn:hover { background: #fff !important; }
.wpm-zoom-btn:disabled,
.wpm-zoom-btn[disabled] { opacity: .3 !important; cursor: default !important; pointer-events: none; }

/* ── Mobile hint ──────────────────────────────────────────── */
.wpm-mobile-hint {
    display: none;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    margin: 6px 0 0;
    letter-spacing: .2px;
    transition: opacity .4s ease;
}
@media (max-width: 768px) and (pointer: coarse) {
    .wpm-mobile-hint { display: block; }
    .wpm-mobile-hint.wpm-hint-hidden { opacity: 0; pointer-events: none; }
}

/* ── Download button — Sky-House square style ─────────────── */
.wpm-map-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-start;
}
.wpm-download-map-pdf {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: var(--wpm-brand) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 12px 26px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: 'Poppins', sans-serif !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: background .15s ease !important;
    letter-spacing: .2px !important;
}
.wpm-download-map-pdf:hover  { background: var(--wpm-brand-hover) !important; }
.wpm-download-map-pdf:disabled,
.wpm-download-map-pdf.wpm-loading { background: #9ca3af !important; cursor: wait !important; }

/* ── House type key ───────────────────────────────────────── */
.wpm-house-key {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}
.wpm-house-key-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px 20px;
    margin-top: 8px;
}
.wpm-house-key-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--wpm-text, #39354f);
    line-height: 1.3;
}
.wpm-house-key-swatch {
    width: 22px;
    height: 16px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,.18);
    display: inline-block;
}
.wpm-house-key-label {
    display: flex;
    flex-direction: column;
}
.wpm-house-key-name {
    font-weight: 600;
    font-size: 12px;
}
.wpm-house-key-beds {
    font-size: 10px;
    color: #6b7280;
}

/* ── Mobile: bottom sheet ─────────────────────────────────── */
@media (max-width: 640px) {
    .wpm-plot-panel {
        position: fixed;
        top: auto; bottom: 0;
        left: 0; right: 0;
        width: 100%;
        height: auto;
        max-height: 82vh;
        border-radius: 0;
        box-shadow: 0 -6px 30px rgba(0,0,0,.22);
        transform: translateY(105%);
        flex-direction: row;
        overflow: hidden;
    }
    .wpm-plot-panel.wpm-panel--open { transform: translateY(0); }
    .wpm-panel-thumb {
        width: 130px;
        height: auto;
        flex-shrink: 0;
    }
    .wpm-panel-body { padding: 14px 14px 18px; }
    .wpm-panel-plot-num { font-size: 17px; }
    .wpm-panel-price    { font-size: 18px; }
}

/* ── Mobile: dots at overview, squares when zoomed ─────────── */
@media (max-width: 768px) {
    .wpm-map-outer:not(.wpm-is-zoomed) .wpm-hs {
        width: 9px;
        height: 9px;
        min-width: 9px;
        padding: 0;
        border-radius: 0;
        border-width: 1px;
        box-shadow: 0 1px 3px rgba(0,0,0,.32);
    }
    .wpm-map-outer:not(.wpm-is-zoomed) .wpm-hs-num { display: none; }

    .wpm-map-outer.wpm-is-zoomed .wpm-hs {
        width: calc(var(--wpm-ms, 18px) * 1.1);
        height: calc(var(--wpm-ms, 18px) * 1.1);
        padding: 0;
        border-radius: 0;
    }
    .wpm-map-outer.wpm-is-zoomed .wpm-hs-num {
        display: block;
        font-size: calc(var(--wpm-ms, 18px) * 0.38);
    }
    .wpm-mobile-hint { font-size: 11px; }
}
