
/*
 * BestPropertyPlug — Developer Responsive Cards + Featured Swipe V9.7
 *
 * Requested behavior:
 *  - Desktop Featured Developments: keep 3-column grid
 *  - Tablet/Mobile Featured Developments: horizontal swipe carousel
 *  - Tablet/Mobile Available Units: 2-column grid
 *  - Preserve V9.2 pagination, V9.4 locations, V9.5 desktop 3-col,
 *    V9.6.1 View Details, global header/footer/bottom nav.
 */

/* =========================================================
   DESKTOP — PRESERVE CURRENT FEATURED 3-COLUMN DESIGN
   ========================================================= */
@media (min-width: 1200px) {
    .bpp54-developer #featured-developments .bpp54-development-grid {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 16px !important;
        overflow: visible !important;
        scroll-snap-type: none !important;
    }

    .bpp54-developer #featured-developments .bpp54-development-card {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }
}

/* =========================================================
   TABLET + MOBILE — FEATURED DEVELOPMENTS SWIPE CAROUSEL
   ========================================================= */
@media (max-width: 1199px) {
    .bpp54-developer #featured-developments {
        overflow: hidden !important;
    }

    .bpp54-developer #featured-developments .bpp54-development-grid {
        display: flex !important;
        grid-template-columns: none !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-x: contain !important;
        scroll-snap-type: x mandatory !important;
        scroll-behavior: smooth !important;
        scrollbar-width: none !important;
        padding: 2px 2px 12px !important;
        margin: 0 !important;
        touch-action: pan-x pan-y !important;
    }

    .bpp54-developer #featured-developments .bpp54-development-grid::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    .bpp54-developer #featured-developments .bpp54-development-card {
        flex: 0 0 auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        scroll-snap-align: start !important;
        scroll-snap-stop: always !important;
    }

    .bpp54-developer #featured-developments .bpp-dev-v97-swipe-track {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        margin: 7px 2px 0 !important;
        color: #7c8e84 !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        line-height: 1 !important;
    }

    .bpp54-developer #featured-developments .bpp-dev-v97-swipe-track__line {
        position: relative !important;
        flex: 1 1 auto !important;
        height: 4px !important;
        overflow: hidden !important;
        border-radius: 999px !important;
        background: #e4eee9 !important;
    }

    .bpp54-developer #featured-developments .bpp-dev-v97-swipe-track__thumb {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        height: 100% !important;
        min-width: 36px !important;
        border-radius: 999px !important;
        background: #65b18f !important;
        transform: translateX(0) !important;
    }
}

/* TABLET: 2 full-ish cards + visible next edge */
@media (min-width: 768px) and (max-width: 1199px) {
    .bpp54-developer #featured-developments .bpp54-development-card {
        flex-basis: calc((100% - 18px) / 2.15) !important;
        width: calc((100% - 18px) / 2.15) !important;
        max-width: calc((100% - 18px) / 2.15) !important;
    }

    .bpp54-developer #featured-developments .bpp54-development-card .media {
        height: 220px !important;
        min-height: 220px !important;
    }

    .bpp54-developer #featured-developments .bpp54-development-card .details {
        padding: 13px !important;
    }

    .bpp54-developer #featured-developments .bpp54-development-card h3 {
        font-size: 15px !important;
        line-height: 1.3 !important;
    }

    .bpp54-developer #featured-developments .bpp54-development-card .description {
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
}

/* MOBILE: one premium card + visible portion of next card */
@media (max-width: 767px) {
    .bpp54-developer #featured-developments .bpp54-development-grid {
        gap: 11px !important;
        width: calc(100% + 12px) !important;
        max-width: none !important;
        padding-right: 12px !important;
    }

    .bpp54-developer #featured-developments .bpp54-development-card {
        flex-basis: 84% !important;
        width: 84% !important;
        max-width: 84% !important;
    }

    .bpp54-developer #featured-developments .bpp54-development-card .media {
        height: 190px !important;
        min-height: 190px !important;
    }

    .bpp54-developer #featured-developments .bpp54-development-card .details {
        padding: 12px !important;
    }

    .bpp54-developer #featured-developments .bpp54-development-card h3 {
        font-size: 15px !important;
        line-height: 1.25 !important;
    }

    .bpp54-developer #featured-developments .bpp54-development-card .description {
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        min-height: 0 !important;
    }
}

/* =========================================================
   TABLET + MOBILE — AVAILABLE UNITS = 2 COLUMNS
   ========================================================= */
@media (max-width: 1199px) {
    .bpp54-developer #available-units .bpp54-property-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
        align-items: stretch !important;
        width: 100% !important;
    }

    .bpp54-developer #available-units .bpp54-property-card {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .media {
        width: 100% !important;
        overflow: hidden !important;
        border-radius: 0 !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .media img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .details {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .price {
        display: block !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .bpp54-developer #available-units .bpp54-property-card h3 {
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .location {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .property-meta {
        margin-top: auto !important;
        display: flex !important;
        align-items: center !important;
        flex-wrap: wrap !important;
    }
}

/* TABLET unit cards */
@media (min-width: 768px) and (max-width: 1199px) {
    .bpp54-developer #available-units .bpp54-property-grid {
        gap: 14px !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .media {
        height: 205px !important;
        min-height: 205px !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .details {
        padding: 13px !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .price {
        font-size: 14px !important;
        line-height: 1.25 !important;
        margin-bottom: 5px !important;
    }

    .bpp54-developer #available-units .bpp54-property-card h3 {
        font-size: 15px !important;
        line-height: 1.3 !important;
        -webkit-line-clamp: 2 !important;
        min-height: 39px !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .location {
        font-size: 12px !important;
        margin-top: 5px !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .property-meta {
        gap: 8px !important;
        font-size: 11px !important;
        margin-top: 8px !important;
    }
}

/* MOBILE unit cards — compact 2-column layout */
@media (max-width: 767px) {
    .bpp54-developer #available-units .bpp54-property-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .bpp54-developer #available-units .bpp54-property-card {
        border-radius: 12px !important;
        box-shadow: 0 6px 16px rgba(10, 62, 42, .055) !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .media {
        height: 142px !important;
        min-height: 142px !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .details {
        padding: 9px !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .price {
        font-size: 12px !important;
        line-height: 1.2 !important;
        margin-bottom: 4px !important;
    }

    .bpp54-developer #available-units .bpp54-property-card h3 {
        font-size: 12px !important;
        line-height: 1.28 !important;
        -webkit-line-clamp: 2 !important;
        min-height: 31px !important;
        margin: 0 !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .location {
        font-size: 10px !important;
        line-height: 1.25 !important;
        margin: 5px 0 0 !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .property-meta {
        gap: 5px !important;
        margin-top: 7px !important;
        font-size: 9.5px !important;
        line-height: 1.15 !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .property-meta span {
        white-space: nowrap !important;
    }

    /* Compact top-left sale/rent badge */
    .bpp54-developer #available-units .bpp54-property-card .status {
        top: 8px !important;
        left: 8px !important;
        padding: 6px 9px !important;
        font-size: 9px !important;
        line-height: 1 !important;
        border-radius: 999px !important;
    }

    /* Compact View Details pill from V9.6.1 */
    .bpp54-developer #available-units .bpp-dev-card-details-label-v961 {
        right: 7px !important;
        bottom: 7px !important;
        min-height: 29px !important;
        padding: 6px 8px !important;
        gap: 4px !important;
        font-size: 9px !important;
    }

    .bpp54-developer #available-units .bpp-dev-card-details-label-v961::after {
        font-size: 10px !important;
    }

    /* Keep the fixed global bottom navigation from covering last card row */
    .bpp54-developer #available-units {
        padding-bottom: 8px !important;
    }
}

/* Narrow phones: still 2 columns, with tighter spacing as explicitly requested. */
@media (max-width: 390px) {
    .bpp54-developer #available-units .bpp54-property-grid {
        gap: 7px !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .media {
        height: 126px !important;
        min-height: 126px !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .details {
        padding: 8px !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .price {
        font-size: 11px !important;
    }

    .bpp54-developer #available-units .bpp54-property-card h3 {
        font-size: 11px !important;
        min-height: 29px !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .location {
        font-size: 9.5px !important;
    }

    .bpp54-developer #available-units .bpp54-property-card .property-meta {
        gap: 4px !important;
        font-size: 9px !important;
    }

    .bpp54-developer #available-units .bpp-dev-card-details-label-v961 {
        min-height: 27px !important;
        padding: 5px 7px !important;
        font-size: 8.5px !important;
    }

    .bpp54-developer #featured-developments .bpp54-development-card {
        flex-basis: 88% !important;
        width: 88% !important;
        max-width: 88% !important;
    }
}
