/* =================================================================
   Property Map - Frontend Styles v4.2 (Mobile + Button Override Fix)
   ================================================================= */

/* ---------------------------------------------------------------
 * Page Heading
 * ------------------------------------------------------------- */

.pm-heading {
    max-width: 1200px;
    margin: -8px auto 16px;
    padding: 0 24px;
    text-align: center;
}

.pm-heading-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

.pm-heading-subtitle {
    font-family: Inter, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #c9a96e;
    margin: 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ---------------------------------------------------------------
 * Layout: Sidebar + Map
 * ------------------------------------------------------------- */

.pm-outer {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    gap: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
    border-radius: 8px;
}

.pm-sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px 0 0 8px;
    box-sizing: border-box;
}

.pm-sb-properties,
.pm-sb-home,
.pm-sb-catcontent {
    scrollbar-width: thin;
    scrollbar-color: #d4cfc7 transparent;
}

.pm-sb-properties::-webkit-scrollbar,
.pm-sb-home::-webkit-scrollbar,
.pm-sb-catcontent::-webkit-scrollbar {
    width: 4px;
}

.pm-sb-properties::-webkit-scrollbar-track,
.pm-sb-home::-webkit-scrollbar-track,
.pm-sb-catcontent::-webkit-scrollbar-track {
    background: transparent;
}

.pm-sb-properties::-webkit-scrollbar-thumb,
.pm-sb-home::-webkit-scrollbar-thumb,
.pm-sb-catcontent::-webkit-scrollbar-thumb {
    background: #d4cfc7;
    border-radius: 2px;
}

.pm-sb-properties::-webkit-scrollbar-thumb:hover,
.pm-sb-home::-webkit-scrollbar-thumb:hover,
.pm-sb-catcontent::-webkit-scrollbar-thumb:hover {
    background: #C9A96E;
}

.pm-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: 0 8px 8px 0;
    min-width: 0;
}

#property-map {
    width: 100%;
    min-height: 300px;
    z-index: 1;
}

.pm-map-card-icon,
.pm-poi-teardrop-icon {
    background: none !important;
    border: none !important;
}

/* ---------------------------------------------------------------
 * Section Title
 * ------------------------------------------------------------- */

.pm-sb-section-title {
    font-family: Inter, -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #999;
    padding: 16px 16px 10px;
    border-bottom: 1px solid #f0ede8;
}

/* ---------------------------------------------------------------
 * Properties Section (always visible, elevated)
 * ------------------------------------------------------------- */

.pm-sb-properties {
    background: #faf9f7;
    border-bottom: 2px solid #e8e4df;
    flex-shrink: 0;
    overflow-y: auto;
}

.pm-sb-home {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.pm-sb-property {
    padding: 12px 16px;
    gap: 12px;
    transition: background 0.15s, transform 0.15s;
}

.pm-sb-property:hover {
    transform: translateX(2px);
    border-left-color: #C9A96E !important;
}

.pm-sb-property .pm-sb-thumb {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    transition: transform 0.2s;
}

.pm-sb-property:hover .pm-sb-thumb {
    transform: scale(1.03);
}

/* ---------------------------------------------------------------
 * Price Hierarchy
 * ------------------------------------------------------------- */

.pm-sb-price {
    font-size: 12px;
    font-weight: 600;
    color: #C9A96E;
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
}

.pm-sb-price-value {
    font-size: 13px;
    font-weight: 700;
    color: #C9A96E;
}

.pm-sb-price-unit {
    font-size: 10px;
    font-weight: 400;
    color: #999;
}

.pm-price-value {
    font-weight: 700;
}

.pm-price-unit {
    font-weight: 400;
    font-size: 0.85em;
    color: #999;
}

/* ---------------------------------------------------------------
 * Home - Category Index
 * ------------------------------------------------------------- */

.pm-sb-cat-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    border-bottom: 1px solid #f0ede8;
}

.pm-sb-cat-link:last-child {
    border-bottom: none;
}

.pm-sb-cat-link:hover {
    background: #f8f6f3;
    transform: translateX(2px);
}

.pm-sb-cat-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
}

.pm-sb-cat-link:hover .pm-sb-cat-icon {
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.pm-sb-cat-icon svg {
    display: block;
}

.pm-sb-cat-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    font-family: 'Playfair Display', Georgia, serif;
}

.pm-sb-cat-count {
    font-family: Inter, -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 600;
    background: rgba(0,0,0,0.08);
    color: #666;
    padding: 1px 7px;
    border-radius: 10px;
}

.pm-sb-cat-chevron {
    font-size: 18px;
    color: #ccc;
    transition: transform 0.2s, color 0.2s;
    line-height: 1;
}

.pm-sb-cat-link:hover .pm-sb-cat-chevron {
    transform: translateX(3px);
    color: #C9A96E;
}

/* ---------------------------------------------------------------
 * Category View (tabs + content)
 * ------------------------------------------------------------- */

.pm-sb-catview {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.pm-sb-tabs {
    position: absolute;
    left: -52px;
    top: 0;
    bottom: 0;
    width: 44px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
    align-items: center;
    background: transparent;
}

.pm-outer .pm-sb-tab {
    width: 36px;
    height: 36px;
    border-radius: 50% !important;
    border: none !important;
    background: transparent !important;
    background-color: transparent !important;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0;
    outline: none;
    font-size: inherit;
    line-height: 1;
    letter-spacing: normal;
    word-spacing: normal;
    text-transform: none;
    -webkit-appearance: none;
    appearance: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.pm-outer .pm-sb-tab:hover,
.pm-outer .pm-sb-tab:focus-visible {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px #C9A96E, 0 2px 8px rgba(0,0,0,0.12);
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
}

.pm-sb-tab-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pm-sb-tab-icon svg {
    display: block;
}

.pm-sb-catcontent {
    flex: 1;
    overflow-y: auto;
    min-width: 0;
    min-height: 0;
}

/* ---------------------------------------------------------------
 * Back Button (hardened against Elementor kit overrides)
 * ------------------------------------------------------------- */

.pm-outer .pm-sb-back {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 12px 14px !important;
    border: none !important;
    border-bottom: 1px solid #e8e4df !important;
    border-radius: 0 !important;
    background: #f8f6f3 !important;
    -webkit-appearance: none;
    appearance: none;
    font-family: Inter, -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: left;
}

.pm-outer .pm-sb-back:hover {
    background: #f0ede8 !important;
    color: #C9A96E;
}

.pm-sb-back-arrow {
    font-size: 16px;
    line-height: 1;
    transition: transform 0.15s;
}

.pm-outer .pm-sb-back:hover .pm-sb-back-arrow {
    transform: translateX(-2px);
}

/* ---------------------------------------------------------------
 * Category Header (inside catview)
 * ------------------------------------------------------------- */

.pm-sb-cat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #f0ede8;
}

.pm-sb-cat-header-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 15px;
    font-weight: 700;
    flex: 1;
}

/* ---------------------------------------------------------------
 * Sidebar Items
 * ------------------------------------------------------------- */

.pm-sb-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    border-bottom: 1px solid #f0ede8;
}

.pm-sb-item:last-child {
    border-bottom: none;
}

.pm-sb-item:hover {
    background: #f8f6f3;
}

.pm-sb-item.pm-sb-active {
    background: #f0ede8;
}

.pm-sb-thumb {
    width: 44px;
    height: 44px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.pm-sb-no-img {
    background: #e8e4df;
}

.pm-sb-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.pm-sb-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-sb-meta {
    font-size: 11px;
    color: #666;
}

.pm-sb-ratings {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pm-sb-stars {
    font-size: 11px;
    color: #C9A96E;
    letter-spacing: -1px;
}

.pm-sb-rating-num {
    font-size: 11px;
    font-weight: 600;
    color: #888;
}

.pm-sb-dollars {
    font-size: 11px;
    font-weight: 600;
    color: #5a8a5a;
}

/* ---------------------------------------------------------------
 * Property Mini-Card Markers (on the map) - Premium style
 * ------------------------------------------------------------- */

.pm-map-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    padding: 6px 10px 6px 6px;
    width: 180px;
    box-sizing: border-box;
    position: relative;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}

.pm-map-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    transform: translateY(-1px);
}

.pm-map-card .pm-map-card-img {
    width: 48px !important;
    height: 48px !important;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.pm-map-card-no-img {
    background: #e8e4df;
}

.pm-map-card-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.pm-map-card-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pm-map-card-price {
    font-size: 11px;
    font-weight: 600;
    color: #C9A96E;
}

.pm-map-card-pointer {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.08));
}

/* ---------------------------------------------------------------
 * POI Teardrop Markers
 * ------------------------------------------------------------- */

.pm-poi-teardrop-icon svg {
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
    transition: opacity 0.3s;
}

/* ---------------------------------------------------------------
 * Fullscreen control - Premium style
 * ------------------------------------------------------------- */

.pm-wrap .leaflet-control-zoom a,
.pm-wrap .leaflet-control-fullscreen a {
    border-radius: 6px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.pm-wrap .leaflet-control-zoom {
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
}

/* ---------------------------------------------------------------
 * Popups
 * ------------------------------------------------------------- */

.pm-popup {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.45;
}

.pm-popup-img {
    margin: -14px -20px 10px;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
    max-height: 180px;
}

.pm-popup-img img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.pm-popup-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    font-family: 'Playfair Display', Georgia, serif;
    color: #1a1a1a;
}

.pm-popup-address {
    margin: 0 0 4px;
    font-size: 13px;
    color: #555;
}

.pm-popup-price {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: #C9A96E;
}

.pm-popup-details {
    margin: 0 0 8px;
    font-size: 13px;
    color: #444;
}

.pm-popup-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    margin-bottom: 10px;
}

.pm-amenity-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    background: #f8f6f3;
    color: #2d2d2d;
    white-space: nowrap;
    border: 1px solid #e8e4df;
}

.pm-popup-link {
    display: inline-block;
    padding: 8px 16px;
    background: #C9A96E;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    transition: background 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.pm-popup-link:hover {
    background: #b8954f;
}

.pm-wrap .leaflet-popup-content-wrapper {
    border-radius: 10px;
    padding: 14px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.pm-wrap .leaflet-popup-content {
    margin: 0;
    min-width: 220px;
}

/* ---------------------------------------------------------------
 * POI Popup extras (rating, price)
 * ------------------------------------------------------------- */

.pm-popup-cat-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 3px;
    margin-bottom: 6px;
}

.pm-popup-rating-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 6px;
    font-size: 13px;
}

.pm-popup-stars {
    color: #C9A96E;
    letter-spacing: -1px;
}

.pm-popup-rating-num {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    letter-spacing: 0;
}

.pm-popup-dollars {
    font-weight: 600;
    color: #5a8a5a;
}

.pm-popup-notes {
    margin: 6px 0 10px;
    font-size: 13px;
    color: #444;
    line-height: 1.45;
}

.pm-popup-directions {
    display: inline-block;
    padding: 7px 14px;
    border: 2px solid #C9A96E;
    color: #C9A96E !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    transition: background 0.15s, color 0.15s;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
}

.pm-popup-directions:hover {
    background: #C9A96E;
    color: #fff !important;
}

/* ---------------------------------------------------------------
 * Empty State
 * ------------------------------------------------------------- */

.pm-no-pins {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 15px;
}

/* ---------------------------------------------------------------
 * Responsive - Tablet
 * ------------------------------------------------------------- */

@media (max-width: 1024px) {
    .pm-sidebar {
        width: 260px;
    }

    .pm-sb-tabs {
        left: -44px;
        width: 36px;
    }

    .pm-outer .pm-sb-tab {
        width: 30px;
        height: 30px;
    }

    .pm-sb-property .pm-sb-thumb {
        width: 48px;
        height: 48px;
    }

    .pm-map-card {
        width: 150px;
    }

    .pm-map-card .pm-map-card-img {
        width: 40px !important;
        height: 40px !important;
    }

    .pm-map-card-name {
        font-size: 12px;
    }
}

/* ---------------------------------------------------------------
 * Responsive - Mobile
 * ------------------------------------------------------------- */

@media (max-width: 768px) {
    .pm-heading {
        margin: -4px auto 10px;
        padding: 0 12px;
    }

    .pm-heading-title {
        font-size: 22px;
    }

    .pm-heading-subtitle {
        font-size: 12px;
    }

    .pm-outer {
        flex-direction: column;
        border-radius: 8px;
    }

    .pm-sidebar {
        display: contents;
    }

    .pm-sb-properties {
        order: 1;
        width: 100%;
        border-radius: 8px 8px 0 0;
        max-height: none;
        overflow-y: visible;
    }

    .pm-wrap {
        order: 2;
        border-radius: 0;
        overflow: visible;
        z-index: 2;
    }

    .pm-wrap .leaflet-popup {
        z-index: 1000;
    }

    #property-map {
        height: 55vh !important;
    }

    .pm-sb-home {
        order: 3;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0 12px 8px;
        gap: 0;
        background: #fff;
        border-top: 1px solid #f0ede8;
    }

    .pm-sb-home > .pm-sb-section-title {
        flex: 0 0 100%;
        text-align: center;
        padding: 10px 0 6px;
        border-bottom: none;
        font-size: 10px;
        letter-spacing: 2px;
    }

    .pm-sb-cat-link {
        flex: 1 0 0;
        flex-direction: column;
        gap: 4px;
        padding: 8px 4px;
        border-bottom: none;
        align-items: center;
        border-radius: 8px;
        min-width: 0;
    }

    .pm-sb-cat-link:hover {
        transform: none;
    }

    .pm-sb-cat-icon {
        width: 38px;
        height: 38px;
    }

    .pm-sb-cat-name {
        font-size: 9px;
        font-family: Inter, -apple-system, sans-serif;
        font-weight: 500;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .pm-sb-cat-count,
    .pm-sb-cat-chevron {
        display: none;
    }

    .pm-sb-catview {
        order: 4;
        width: 100%;
        position: static;
        background: #fff;
        border-radius: 0 0 8px 8px;
    }

    .pm-sb-tabs {
        display: none;
    }

    .pm-sb-catcontent {
        max-height: 35vh;
    }

    .pm-sb-property .pm-sb-thumb {
        width: 44px;
        height: 44px;
    }

    .pm-sb-item {
        padding: 8px 12px;
        gap: 10px;
    }

    .pm-sb-thumb {
        width: 38px;
        height: 38px;
    }

    .pm-sb-name {
        font-size: 12px;
    }

    .pm-sb-price {
        font-size: 11px;
    }

    .pm-map-card {
        width: 130px;
        padding: 4px 8px 4px 4px;
        gap: 6px;
    }

    .pm-map-card .pm-map-card-img {
        width: 32px !important;
        height: 32px !important;
    }

    .pm-map-card-name {
        font-size: 11px;
    }

    .pm-wrap .leaflet-popup-content {
        min-width: 180px;
    }

    .pm-wrap .leaflet-popup-content-wrapper {
        padding: 10px 14px;
    }

    .pm-popup-img {
        margin: -10px -14px 8px;
    }

    .pm-popup-img img {
        height: 110px;
    }

    .pm-popup-notes {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .pm-popup-title {
        font-size: 15px;
    }
}

/* ---------------------------------------------------------------
 * Responsive - Small Mobile
 * ------------------------------------------------------------- */

@media (max-width: 480px) {
    #property-map {
        height: 50vh !important;
    }

    .pm-sb-cat-link {
        padding: 6px 2px;
    }

    .pm-sb-cat-icon {
        width: 34px;
        height: 34px;
    }

    .pm-sb-cat-name {
        font-size: 8px;
    }

    .pm-map-card {
        width: 110px;
        padding: 3px 6px 3px 3px;
    }

    .pm-map-card .pm-map-card-img {
        width: 28px !important;
        height: 28px !important;
    }

    .pm-map-card-name {
        font-size: 10px;
    }
}
