/**
 * Property Map Section - Airbnb-style Interactive Map
 * 
 * Modern, responsive styling for the homepage map section.
 * Uses BEM naming convention and CSS custom properties.
 */

/* ==========================================================================
   SECTION CONTAINER
   ========================================================================== */

.property-map-section {
    position: relative;
    width: 100%;
    padding: var(--spacing-3xl, 3rem) 0;
    background: var(--color-background, #ffffff);
    /* Allow InfoWindow popup to overflow vertically; clip horizontal only */
    overflow-x: clip;
    overflow-y: visible;
}

.property-map-section__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg, 1.5rem);
}

/* ==========================================================================
   SECTION HEADER
   ========================================================================== */

.property-map-section__header {
    text-align: center;
    margin-bottom: var(--spacing-xl, 2rem);
    animation: fadeInUp 0.6s ease-out;
}

.property-map-section__title {
    font-family: var(--font-family-heading, 'Playfair Display', serif);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--color-text-primary, #1a1a1a);
    margin: 0 0 var(--spacing-sm, 0.5rem);
    line-height: 1.2;
}

.property-map-section__subtitle {
    font-family: var(--font-family-body, 'Poppins', sans-serif);
    font-size: var(--font-size-md, 1rem);
    color: var(--color-text-secondary, #666666);
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   FILTER PILLS
   ========================================================================== */

.property-map-section__filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-sm, 0.5rem);
    margin-bottom: var(--spacing-lg, 1.5rem);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.property-map-section__filter-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs, 0.25rem);
    padding: var(--spacing-sm, 0.5rem) var(--spacing-md, 1rem);
    font-family: var(--font-family-body, 'Poppins', sans-serif);
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 500;
    color: var(--color-text-primary, #1a1a1a);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: var(--radius-full, 9999px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.property-map-section__filter-pill:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--accent-color, #d4af37);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.property-map-section__filter-pill--active {
    background: var(--primary-color, #0c2340);
    color: #ffffff;
    border-color: var(--primary-color, #0c2340);
    box-shadow: 0 4px 12px rgba(12, 35, 64, 0.3);
}

.property-map-section__filter-pill--active:hover {
    background: var(--primary-color, #0c2340);
    border-color: var(--primary-color, #0c2340);
}

.property-map-section__filter-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.property-map-section__filter-icon svg {
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   MAP WRAPPER
   ========================================================================== */

.property-map-section__map-wrapper {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 500px;
    max-height: 800px;
    border-radius: var(--radius-lg, 1rem);
    overflow: visible;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.6s ease-out 0.2s both;
}

/* Prevent CSS transforms on the map container (breaks marker/popup positioning) */
.property-map-section__map-wrapper.reveal-item,
.property-map-section__map-wrapper.reveal-item--scale,
.property-map-section__map-wrapper.reveal-item--scale.revealed {
    transform: none !important;
    will-change: auto !important;
}

.property-map-section__map {
    width: 100%;
    height: 100%;
    background: var(--gray-200, #e9ecef);
    border-radius: var(--radius-lg, 1rem);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.property-map-section__loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-background, #ffffff);
    z-index: 10;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.property-map-section__loading--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.property-map-section__loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--gray-200, #e9ecef);
    border-top-color: var(--accent-color, #d4af37);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.property-map-section__loading-text {
    margin-top: var(--spacing-md, 1rem);
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--color-text-secondary, #666666);
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.property-map-section__empty {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-background, #ffffff);
    z-index: 10;
    text-align: center;
    padding: var(--spacing-xl, 2rem);
}

.property-map-section__empty svg {
    color: var(--gray-400, #ced4da);
    margin-bottom: var(--spacing-md, 1rem);
}

.property-map-section__empty-title {
    font-family: var(--font-family-heading, 'Playfair Display', serif);
    font-size: var(--font-size-xl, 1.25rem);
    font-weight: 600;
    color: var(--color-text-primary, #1a1a1a);
    margin: 0 0 var(--spacing-xs, 0.25rem);
}

.property-map-section__empty-text {
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--color-text-secondary, #666666);
    margin: 0;
}

/* ==========================================================================
   PROPERTY COUNT BADGE
   ========================================================================== */

.property-map-section__count {
    position: absolute;
    top: var(--spacing-md, 1rem);
    left: var(--spacing-md, 1rem);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs, 0.25rem);
    padding: var(--spacing-sm, 0.5rem) var(--spacing-md, 1rem);
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-full, 9999px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-size: var(--font-size-sm, 0.875rem);
    z-index: 5;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out 0.5s both;
}

.property-map-section__count-number {
    font-weight: 700;
    color: var(--primary-color, #0c2340);
}

.property-map-section__count-label {
    color: var(--color-text-secondary, #666666);
}

/* ==========================================================================
   MAP TYPE CONTROLS (Google Maps default)
   ========================================================================== */

/* Style the Google Maps map type control */
.gm-style .gm-style-mtc {
    margin: var(--spacing-md, 1rem) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
    border-radius: var(--radius-md, 0.5rem) !important;
    overflow: hidden !important;
}

.gm-style .gm-style-mtc button {
    background: rgba(255, 255, 255, 0.95) !important;
    color: var(--color-text-primary, #1a1a1a) !important;
    border: none !important;
    padding: 8px 12px !important;
    font-family: var(--font-family-body, 'Poppins', sans-serif) !important;
    font-size: var(--font-size-sm, 0.875rem) !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

.gm-style .gm-style-mtc button:hover {
    background: rgba(255, 255, 255, 1) !important;
    color: var(--accent-color, #d4af37) !important;
}

.gm-style .gm-style-mtc button[aria-pressed="true"] {
    background: var(--primary-color, #0c2340) !important;
    color: #ffffff !important;
}

/* Dark mode for map type controls */
[data-theme="dark"] .gm-style .gm-style-mtc button {
    background: rgba(30, 30, 30, 0.95) !important;
    color: var(--color-text-primary, #ffffff) !important;
}

[data-theme="dark"] .gm-style .gm-style-mtc button:hover {
    background: rgba(40, 40, 40, 1) !important;
    color: var(--accent-color, #d4af37) !important;
}

[data-theme="dark"] .gm-style .gm-style-mtc button[aria-pressed="true"] {
    background: var(--accent-color, #d4af37) !important;
    color: #000000 !important;
}

/* ==========================================================================
   ZOOM CONTROLS
   ========================================================================== */

.property-map-section__zoom-controls {
    position: absolute;
    bottom: var(--spacing-lg, 1.5rem);
    right: var(--spacing-md, 1rem);
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 5;
    animation: fadeIn 0.3s ease-out 0.5s both;
}

.property-map-section__zoom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text-primary, #1a1a1a);
}

.property-map-section__zoom-btn:first-child {
    border-radius: var(--radius-md, 0.5rem) var(--radius-md, 0.5rem) 0 0;
}

.property-map-section__zoom-btn:last-child {
    border-radius: 0 0 var(--radius-md, 0.5rem) var(--radius-md, 0.5rem);
}

.property-map-section__zoom-btn:hover {
    background: #ffffff;
    color: var(--accent-color, #d4af37);
}

.property-map-section__zoom-btn:active {
    transform: scale(0.95);
}

/* ==========================================================================
   PROPERTY POPUP CARD - Modern Full-Image Design
   ========================================================================== */

.property-map-popup {
    width: 320px;
    min-width: 280px;
    max-width: 100%;
    background: transparent;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.05),
        0 8px 16px rgba(0, 0, 0, 0.12),
        0 20px 40px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.08);
    animation: popupSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: var(--font-family-body, 'Poppins', sans-serif);
    transform-origin: center bottom;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    position: relative;
    /* Ensure consistent rendering across browsers */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Ensure border wraps entire popup including image */
    display: block;
    /* Ensure all children respect the border */
    isolation: isolate;
    /* Improve text rendering */
    text-rendering: optimizeLegibility;
}

.property-map-popup__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.property-map-popup__link:hover .property-map-popup {
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-4px);
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.2),
        0 12px 24px rgba(0, 0, 0, 0.15),
        0 28px 50px rgba(0, 0, 0, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.1),
        0 0 20px rgba(212, 175, 55, 0.1);
}

/* Full Image Container */
.property-map-popup__image-container {
    position: relative;
    width: 100%;
    height: 260px;
    min-height: 220px;
    overflow: hidden;
    /* Match parent border radius minus border width (16px - 1px = 15px) */
    border-radius: 15px 15px 0 0;
    /* Ensure image fills container properly */
    display: block;
    box-sizing: border-box;
    /* Ensure image container respects parent border - no margin/padding that would break border */
    margin: 0;
    padding: 0;
    /* Ensure it stays within parent border */
    z-index: 1;
    /* Add subtle background for loading state */
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.property-map-popup__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    display: block;
    /* Crisp image rendering */
    image-rendering: auto;
    /* Loading state */
    opacity: 0;
    background: linear-gradient(135deg, #f0f0f0 0%, #d0d0d0 100%);
}

.property-map-popup__image.loaded {
    opacity: 1;
}

.property-map-popup__link:hover .property-map-popup__image {
    transform: scale(1.1);
}

/* Gradient Overlay */
.property-map-popup__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.05) 0%,
        rgba(0, 0, 0, 0) 20%,
        rgba(0, 0, 0, 0) 40%,
        rgba(0, 0, 0, 0.5) 70%,
        rgba(0, 0, 0, 0.85) 100%
    );
    pointer-events: none;
    transition: background 0.3s ease;
    z-index: 1;
}

.property-map-popup__link:hover .property-map-popup__overlay {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0) 20%,
        rgba(0, 0, 0, 0) 40%,
        rgba(0, 0, 0, 0.6) 70%,
        rgba(0, 0, 0, 0.9) 100%
    );
}

/* Top Row - Badge & Favorite */
.property-map-popup__top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px;
    z-index: 3;
    gap: 8px;
}

.property-map-popup__badge {
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.98);
    color: var(--primary-color, #0c2340);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
}

.property-map-popup__badge--short_term {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow:
        0 4px 12px rgba(16, 185, 129, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.property-map-popup__badge--long_term {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow:
        0 4px 12px rgba(59, 130, 246, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.property-map-popup__badge--sale {
    background: linear-gradient(135deg, #d4af37 0%, #b49225 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow:
        0 4px 12px rgba(212, 175, 55, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.property-map-popup__link:hover .property-map-popup__badge {
    transform: translateY(-1px);
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.property-map-popup__favorite {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--gray-600, #6c757d);
    padding: 0;
    position: relative;
}

.property-map-popup__favorite:hover {
    background: rgba(255, 255, 255, 1);
    color: #ef4444;
    transform: scale(1.15);
    box-shadow:
        0 6px 16px rgba(239, 68, 68, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.property-map-popup__favorite:hover svg {
    fill: #ef4444;
    animation: heartBeat 0.6s ease-in-out;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1.1); }
    75% { transform: scale(1.15); }
}

/* Content Overlay (Bottom) */
.property-map-popup__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 2;
    color: #ffffff;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        transparent 100%
    );
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.property-map-popup__header {
    margin-bottom: 8px;
}

.property-map-popup__title {
    font-family: var(--font-family-heading, 'Playfair Display', serif);
    font-size: 1.375rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.6),
        0 4px 16px rgba(0, 0, 0, 0.4),
        0 1px 2px rgba(0, 0, 0, 0.8);
    letter-spacing: -0.3px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.property-map-popup__location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.98);
    margin: 0;
    font-weight: 500;
    text-shadow:
        0 1px 4px rgba(0, 0, 0, 0.5),
        0 2px 8px rgba(0, 0, 0, 0.3);
}

.property-map-popup__location svg {
    opacity: 0.85;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Divider */
.property-map-popup__divider {
    height: 1px;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 10%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0.2) 90%,
        transparent 100%
    );
    margin: 12px 0;
    position: relative;
}

/* Footer - Details & Price */
.property-map-popup__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
}

.property-map-popup__details {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.property-map-popup__detail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.98);
    line-height: 1.3;
    text-shadow:
        0 1px 3px rgba(0, 0, 0, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.2);
}

.property-map-popup__detail svg {
    width: 16px;
    height: 16px;
    opacity: 0.9;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Price */
.property-map-popup__price-container {
    text-align: right;
    flex-shrink: 0;
}

.property-map-popup__price {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1.2;
    text-shadow:
        0 2px 12px rgba(0, 0, 0, 0.6),
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 1px 3px rgba(0, 0, 0, 0.8);
}

.property-map-popup__price-suffix {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 3px;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* CTA Button (appears on hover) */
.property-map-popup__cta {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.98);
    color: var(--primary-color, #0c2340);
    border: 2px solid transparent;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.98)),
        linear-gradient(135deg, rgba(212, 175, 55, 0.4), rgba(212, 175, 55, 0.8));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    border-radius: 28px;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.2),
        0 1px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 10;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.property-map-popup__link:hover .property-map-popup__cta {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    transition-delay: 0.1s;
}

.property-map-popup__cta:hover {
    transform: translate(-50%, -50%) scale(1.05) !important;
    background: linear-gradient(135deg, #d4af37 0%, #b49225 100%);
    color: #ffffff;
    box-shadow:
        0 14px 40px rgba(212, 175, 55, 0.35),
        0 6px 16px rgba(0, 0, 0, 0.25),
        0 2px 6px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 30px rgba(212, 175, 55, 0.2);
}

.property-map-popup__cta svg {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.property-map-popup__cta:hover svg {
    transform: translateX(6px);
    animation: arrowSlide 0.6s ease-in-out infinite;
}

@keyframes arrowSlide {
    0%, 100% { transform: translateX(6px); }
    50% { transform: translateX(8px); }
}

/* Hide sqm detail if no value */
.property-map-popup__sqm:empty {
    display: none;
}

/* Google Maps InfoWindow overrides */
/* IMPORTANT: Do NOT override position - Google Maps uses inline styles to position InfoWindow */
/* Do NOT use pointer-events: none on wrapper - it breaks the close (X) button */
.property-map-section__map-wrapper .gm-style-iw,
.property-map-section__map-wrapper ~ .gm-style-iw {
    padding: 0 !important;
    background: transparent !important;
    border-radius: 12px !important;
    overflow: visible !important;
    box-shadow: none !important;
    max-width: 340px !important;
}

.property-map-section__map-wrapper .gm-style-iw-d {
    overflow: visible !important;
    max-height: none !important;
    padding: 0 !important;
    max-width: 340px !important;
}

.property-map-section__map-wrapper .gm-style-iw-c {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 12px !important;
    border: none !important;
    overflow: visible !important;
    max-width: 340px !important;
}

.property-map-section__map-wrapper .gm-style-iw-tc {
    display: none !important;
}

/* Ensure popup is not clipped by InfoWindow */
.property-map-section__map-wrapper .gm-style-iw-d > div {
    overflow: visible !important;
    max-width: 340px !important;
}

/* Global InfoWindow styles (fallback) */
/* IMPORTANT: Do NOT override position - let Google Maps control InfoWindow placement */
.gm-style-iw {
    padding: 0 !important;
    background: transparent !important;
    border-radius: 12px !important;
    overflow: visible !important;
    box-shadow: none !important;
    max-width: 340px !important;
}

.gm-style-iw-d {
    overflow: visible !important;
    max-height: none !important;
    padding: 0 !important;
    max-width: 340px !important;
}

.gm-style-iw-c {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 12px !important;
    border: none !important;
    overflow: visible !important;
    max-width: 340px !important;
}

.gm-style-iw-tc {
    display: none !important;
}

/* Close button - positioned inside the popup border, relative to InfoWindow */
.gm-ui-hover-effect {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 32px !important;
    height: 32px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50% !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    opacity: 1 !important;
    z-index: 10000 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    /* Position relative to InfoWindow container */
    transform: none !important;
    /* Ensure it's inside the border (accounting for 2px border) */
}

.gm-ui-hover-effect:hover {
    background: rgba(255, 255, 255, 1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    transform: scale(1.05) !important;
}

.gm-ui-hover-effect > span {
    background-color: var(--primary-color, #0c2340) !important;
    margin: 10px !important;
    width: 12px !important;
    height: 12px !important;
    display: block !important;
    position: relative !important;
}

/* ==========================================================================
   PRICE MARKER STYLES (for Google Maps markers)
   ========================================================================== */

.property-map-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid var(--gray-300, #dee2e6);
    border-radius: var(--radius-full, 9999px);
    font-family: var(--font-family-body, 'Poppins', sans-serif);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary, #1a1a1a);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center bottom;
}

.property-map-marker:hover,
.property-map-marker--active {
    background: var(--primary-color, #0c2340);
    color: #ffffff;
    border-color: var(--primary-color, #0c2340);
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(12, 35, 64, 0.3);
    z-index: 100 !important;
}

.property-map-marker--short_term:hover,
.property-map-marker--short_term.property-map-marker--active {
    background: #10b981;
    border-color: #10b981;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.property-map-marker--long_term:hover,
.property-map-marker--long_term.property-map-marker--active {
    background: #3b82f6;
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.property-map-marker--sale:hover,
.property-map-marker--sale.property-map-marker--active {
    background: var(--accent-color, #d4af37);
    border-color: var(--accent-color, #d4af37);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes popupSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.85);
    }
    60% {
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

/* Focus visible states for keyboard navigation */
.property-map-popup__link:focus-visible {
    outline: 3px solid var(--accent-color, #d4af37);
    outline-offset: 4px;
    border-radius: 16px;
}

.property-map-popup__favorite:focus-visible {
    outline: 2px solid var(--accent-color, #d4af37);
    outline-offset: 2px;
}

.property-map-popup__cta:focus-visible {
    outline: 2px solid var(--accent-color, #d4af37);
    outline-offset: 2px;
}

.property-map-section__filter-pill:focus-visible {
    outline: 2px solid var(--accent-color, #d4af37);
    outline-offset: 2px;
}

.property-map-section__zoom-btn:focus-visible {
    outline: 2px solid var(--accent-color, #d4af37);
    outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
    .property-map-popup {
        border: 2px solid currentColor;
    }

    .property-map-popup__overlay {
        background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.3) 0%,
            rgba(0, 0, 0, 0) 40%,
            rgba(0, 0, 0, 0.7) 70%,
            rgba(0, 0, 0, 0.95) 100%
        );
    }

    .property-map-popup__title,
    .property-map-popup__price {
        text-shadow:
            0 0 8px rgba(0, 0, 0, 1),
            0 0 16px rgba(0, 0, 0, 1),
            0 2px 4px rgba(0, 0, 0, 1);
    }

    .property-map-popup__badge {
        border-width: 2px;
    }

    .property-map-section__filter-pill {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .property-map-popup {
        animation: none;
        transition: opacity 0.2s ease;
    }

    .property-map-popup__link:hover .property-map-popup {
        transform: none;
        transition: opacity 0.2s ease, box-shadow 0.2s ease;
    }

    .property-map-popup__image {
        transition: opacity 0.2s ease;
    }

    .property-map-popup__link:hover .property-map-popup__image {
        transform: none;
    }

    .property-map-popup__cta {
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .property-map-popup__cta svg {
        animation: none !important;
    }

    .property-map-popup__favorite:hover svg {
        animation: none !important;
    }

    .property-map-popup__badge {
        transition: opacity 0.2s ease;
    }

    .property-map-section__map-wrapper {
        animation: none;
    }

    @keyframes fadeIn {
        from, to {
            opacity: 1;
        }
    }

    @keyframes fadeInUp {
        from, to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes popupSlideIn {
        from, to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    @keyframes heartBeat {
        from, to {
            transform: scale(1);
        }
    }

    @keyframes arrowSlide {
        from, to {
            transform: translateX(6px);
        }
    }
}

/* ==========================================================================
   DARK MODE
   ========================================================================== */

[data-theme="dark"] .property-map-section {
    background: var(--color-background, #000000);
}

[data-theme="dark"] .property-map-section__title {
    color: var(--color-text-primary, #ffffff);
}

[data-theme="dark"] .property-map-section__subtitle {
    color: var(--color-text-secondary, #e0e0e0);
}

[data-theme="dark"] .property-map-section__filter-pill {
    background: rgba(30, 30, 30, 0.8);
    border-color: var(--color-border, #2a2a2a);
    color: var(--color-text-primary, #ffffff);
}

[data-theme="dark"] .property-map-section__filter-pill:hover {
    background: rgba(40, 40, 40, 0.95);
    border-color: var(--accent-color, #d4af37);
}

[data-theme="dark"] .property-map-section__filter-pill--active {
    background: var(--accent-color, #d4af37);
    color: #000000;
    border-color: var(--accent-color, #d4af37);
}

[data-theme="dark"] .property-map-section__map-wrapper {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .property-map-section__map {
    background: #1a1a1a;
}

[data-theme="dark"] .property-map-section__loading {
    background: var(--color-background, #000000);
}

[data-theme="dark"] .property-map-section__loading-spinner {
    border-color: var(--color-border, #2a2a2a);
    border-top-color: var(--accent-color, #d4af37);
}

[data-theme="dark"] .property-map-section__loading-text {
    color: var(--color-text-secondary, #e0e0e0);
}

[data-theme="dark"] .property-map-section__empty {
    background: var(--color-background, #000000);
}

[data-theme="dark"] .property-map-section__empty svg {
    color: var(--gray-600, #6c757d);
}

[data-theme="dark"] .property-map-section__empty-title {
    color: var(--color-text-primary, #ffffff);
}

[data-theme="dark"] .property-map-section__empty-text {
    color: var(--color-text-secondary, #e0e0e0);
}

[data-theme="dark"] .property-map-section__count {
    background: rgba(30, 30, 30, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .property-map-section__count-number {
    color: var(--accent-color, #d4af37);
}

[data-theme="dark"] .property-map-section__count-label {
    color: var(--color-text-secondary, #e0e0e0);
}

[data-theme="dark"] .property-map-section__zoom-btn {
    background: rgba(30, 30, 30, 0.95);
    color: var(--color-text-primary, #ffffff);
}

[data-theme="dark"] .property-map-section__zoom-btn:hover {
    background: rgba(40, 40, 40, 1);
    color: var(--accent-color, #d4af37);
}

[data-theme="dark"] .property-map-popup {
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 8px 16px rgba(0, 0, 0, 0.6),
        0 20px 40px rgba(0, 0, 0, 0.8),
        0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .property-map-popup__link:hover .property-map-popup {
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.3),
        0 12px 24px rgba(0, 0, 0, 0.5),
        0 28px 50px rgba(0, 0, 0, 0.7),
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(212, 175, 55, 0.2);
}

[data-theme="dark"] .property-map-popup__overlay {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.2) 0%,
        rgba(0, 0, 0, 0) 30%,
        rgba(0, 0, 0, 0.7) 70%,
        rgba(0, 0, 0, 0.95) 100%
    );
}

[data-theme="dark"] .property-map-popup__badge {
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .property-map-popup__favorite {
    background: rgba(30, 30, 30, 0.95);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .property-map-popup__favorite:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .property-map-popup__cta {
    background: rgba(30, 30, 30, 0.95);
    color: #d4af37;
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 1px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .property-map-popup__cta:hover {
    background: linear-gradient(135deg, #d4af37 0%, #b49225 100%);
    color: #000000;
    border-color: #d4af37;
    box-shadow:
        0 14px 40px rgba(212, 175, 55, 0.5),
        0 6px 16px rgba(0, 0, 0, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 40px rgba(212, 175, 55, 0.3);
}

[data-theme="dark"] .property-map-popup__title {
    color: var(--color-text-primary, #ffffff);
}

[data-theme="dark"] .property-map-popup__location {
    color: var(--color-text-secondary, #e0e0e0);
}

[data-theme="dark"] .property-map-popup__detail {
    color: var(--color-text-secondary, #e0e0e0);
}

[data-theme="dark"] .property-map-popup__price {
    color: var(--accent-color, #d4af37);
}

[data-theme="dark"] .property-map-marker {
    background: #1a1a1a;
    border-color: #2a2a2a;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 991.98px) {
    .property-map-section {
        padding: var(--spacing-2xl, 2.5rem) 0;
    }

    .property-map-section__map-wrapper {
        height: 65vh;
        min-height: 450px;
    }
}

@media (max-width: 767.98px) {
    .property-map-section {
        padding: var(--spacing-xl, 2rem) 0;
    }
    
    .property-map-section__container {
        padding: 0 var(--spacing-md, 1rem);
    }
    
    .property-map-section__filters {
        gap: 6px;
    }
    
    .property-map-section__filter-pill {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .property-map-section__filter-icon {
        display: none;
    }
    
    .property-map-section__map-wrapper {
        height: 60vh;
        min-height: 400px;
        border-radius: var(--radius-md, 0.5rem);
    }
    
    .property-map-popup {
        width: 300px;
        min-width: 260px;
    }
    
    .property-map-popup__image-container {
        height: 240px;
        min-height: 200px;
    }
    
    .property-map-popup__content {
        padding: 14px;
    }
    
    .property-map-popup__title {
        font-size: 1.125rem;
        -webkit-line-clamp: 2;
    }
    
    .property-map-popup__details {
        gap: 10px;
    }
    
    .property-map-popup__detail {
        font-size: 0.8125rem;
    }
    
    .property-map-popup__price {
        font-size: 1.25rem;
    }
    
    .property-map-popup__cta {
        padding: 10px 20px;
        font-size: 0.8125rem;
    }
}

@media (max-width: 575.98px) {
    .property-map-section__map-wrapper {
        height: 55vh;
        min-height: 350px;
    }
    
    .property-map-section__count {
        top: var(--spacing-sm, 0.5rem);
        left: var(--spacing-sm, 0.5rem);
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .property-map-section__zoom-controls {
        bottom: var(--spacing-md, 1rem);
        right: var(--spacing-sm, 0.5rem);
    }
    
    .property-map-section__zoom-btn {
        width: 36px;
        height: 36px;
    }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .property-map-section__header,
    .property-map-section__filters,
    .property-map-section__map-wrapper,
    .property-map-section__count,
    .property-map-section__zoom-controls {
        animation: none;
    }
    
    .property-map-section__filter-pill,
    .property-map-marker,
    .property-map-popup__image,
    .property-map-section__zoom-btn {
        transition: none;
    }
    
    .property-map-section__loading-spinner {
        animation: none;
        border-top-color: var(--accent-color, #d4af37);
    }
    
    .property-map-popup {
        animation: none;
    }
}
