/* 2026-09-23 fixes: property popup on phones + video player */

@media (max-width: 768px) {
    /* 1. The whole popup scrolls, so photos scroll away instead of staying pinned */
    .property-modal .modal-content {
        margin: 0 auto !important;
        width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        min-height: 0 !important;
        border-radius: 0 !important;
        padding: 10px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        display: block !important;
    }
    .property-modal .modal-header,
    .property-listings-modal-wrapper,
    .property-listings-gallery-container,
    .property-listings-details-wrapper,
    .property-listings-details-content,
    .property-modal .modal-details-wrapper,
    .property-modal .modal-details-content,
    .property-modal .modal-image-container {
        display: block !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        overflow: visible !important;
        margin-bottom: 0 !important;
    }
    .property-listings-gallery-main {
        height: 300px !important;
    }
    .property-listings-details-content {
        padding: 0 4px 12px !important;
    }

    /* 2. Smaller Book / Contact buttons, side by side */
    .modal-actions {
        position: sticky !important;
        bottom: -10px !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        padding: 8px !important;
        margin: 0 -10px -10px !important;
    }
    .modal-actions .btn {
        min-height: 38px !important;
        padding: 8px 6px !important;
        font-size: 0.8rem !important;
        gap: 5px !important;
        white-space: nowrap;
    }
    .modal-actions .btn i { font-size: 0.85rem !important; }

    /* Hide the floating "Need help?" bar while a popup is open (it covered the buttons) */
    body:has(#property-modal[style*="display: block"]) .floating-text,
    body:has(#video-modal[style*="display: block"]) .floating-text {
        display: none !important;
    }
}

/* 3. Video player: header + player stack properly so controls are never cut off */
.video-modal-content {
    display: flex !important;
    flex-direction: column !important;
}
.video-modal-header { flex: 0 0 auto; }
.video-player-container {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    background: #000;
}
@media (max-width: 768px) {
    .video-modal-content {
        width: 100% !important;
        height: 85dvh !important;
        margin: 7.5dvh auto !important;
    }
}

/* 4. Drive videos use the browser's own player: fit the box, bar at the bottom */
#video-native {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}
