.property-amenities ul,
.property-facilities ul,
.popup-feature-list {
    /* UNIFIED STYLING FOR BOTH AMENITIES AND FACILITIES LISTS */
    list-style: none;
    padding: 0;
    display: grid;
    /* Use grid for controlled layout */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    /* Responsive columns */
    gap: 15px 30px;
    /* Gap between grid items */
}

.property-amenities li,
.property-facilities li,
.popup-feature-list li {
    /* UNIFIED STYLING FOR INDIVIDUAL AMENITY AND FACILITY ITEMS */
    display: flex;
    /* Makes the li a flex container */
    align-items: center;
    /* Vertically centers the icon with the text */
}

.property-amenities li span,
.property-facilities li span,
.popup-feature-list li span {
    line-height: 1;
    /* Reduce extra space below text for precise alignment */
}

/* --- Icon Styling (Unified) --- */
.amenity-icon,
.facility-icon {
    /* UNIFIED STYLING FOR BOTH AMENITY AND FACILITY ICONS */
    width: 43px;
    /* Increased icon size slightly from 32px */
    height: 43px;
    /* Maintain aspect ratio */
    object-fit: contain;
    /* Ensures the icon scales correctly without distortion */
    margin-right: 6px;
    /* Space between the icon and the text (reduced from 12px) */
    flex-shrink: 0;
    /* Prevent icon from shrinking on smaller screens */
    object-position: center;
    /* Align image content to center */
}


/* NEW: Pop effect for amenity/facility icons and text on hover */
.pop-effect {
    transform: scale(1.05);
    /* Slightly enlarge */
    transition: transform 0.2s ease-out;
    /* Smooth transition */
}

/* Pulse animation keyframes */
@keyframes subtle-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    }
}

/* Base pulse animation for amenities and facilities - delays set by JS */
.property-facilities ul li,
.property-amenities ul li {
    animation: subtle-pulse 3s ease-in-out infinite;
}

/* Styling for Facility and Amenity List Items */
.property-facilities ul li,
.property-amenities ul li,
.popup-feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Space between icon and text */
    font-size: 1.1em;
    color: #4a5568;
    margin-bottom: 10px;
    padding: 8px 12px;
    /* Add some padding to make hover area larger */
    border-radius: 8px;
    cursor: pointer;
    /* Indicate it's clickable */
    transition: background-color 0.2s, transform 0.2s;
    background-color: #f7fafc;
    /* Light background for items */
    border: 1px solid #edf2f7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.property-facilities ul li:hover,
.property-amenities ul li:hover,
.popup-feature-list li:hover {
    background-color: #edf2f7;
    /* Slightly darker background on hover */
    transform: translateY(-2px);
    /* Lift effect on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.property-facilities ul li img,
.property-amenities ul li img,
.popup-feature-list li img {
    width: 28px;
    /* Slightly larger icons */
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    /* Prevent icon from shrinking */
}

/* Amenity Tooltip/Popup Styles */
.amenity-tooltip {
    position: absolute;
    /* Restore original positioning */
    background-color: #ffffff !important;
    color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    /* Enhanced shadow for more pop */
    z-index: 1000 !important;
    transition: opacity 0.2s ease-in-out;
    transform: translateY(-5px);
    box-sizing: border-box;
    /* Corrected typo */

    width: 450px !important;
    /* Keep width as requested */
    height: auto !important;
    /* Force a square shape */
    max-height: 250px !important;
    /* Ensure it doesn\'t grow beyond this */
    overflow: visible !important;
    /* Clip content that overflows */
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
}

.amenity-tooltip h4 {
    font-size: 1.1em;
    margin-top: 0;
    margin-bottom: 5px;
    color: #333 !important;
    /* Changed to black */
    white-space: normal;
    word-break: break-word;
    flex-shrink: 0 !important;
    /* Prevent shrinking */
    flex-grow: 0 !important;
    /* Prevent growing */
}

.amenity-tooltip p {
    font-size: 0.9em;
    line-height: 1.4;
    margin-bottom: 10px;
    white-space: normal;
    word-break: break-word;
    max-height: 60px;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    flex-shrink: 0 !important;
    /* Prevent shrinking */
    flex-grow: 0 !important;
    /* Prevent growing */
    color: #333 !important;
    /* Changed to black */
}

/* Hide scrollbar for webkit browsers */
.amenity-tooltip p::-webkit-scrollbar {
    display: none;
}

/* Style for the image slider within the tooltip */
.amenity-tooltip-image-slider {
    width: 100%;
    height: auto !important;
    /* Allow height to adjust */
    max-height: 165px !important;
    /* Ensure it doesn't grow beyond this */
    flex-grow: 0 !important;
    /* No longer a flexible item */
    flex-basis: auto !important;
    /* Reset flex-basis */
    margin-top: 10px;
    border-radius: 4px;
    overflow: visible !important;
    /* Clip content that overflows */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Added for absolute positioning of arrows */
}

/* Target the actual Swiper wrapper and slides inside the tooltip image slider */
.amenity-tooltip-image-slider .swiper-wrapper {
    width: 100%;
    height: auto !important;
    /* Ensure wrapper takes full height of its parent */
    display: flex;
    /* Make wrapper a flex container */
    align-items: center;
    /* Center slides vertically within wrapper */
    justify-content: center;
    /* Center slides horizontally within wrapper */
    min-width: 0;
}

.amenity-tooltip-image-slider .swiper-slide {
    width: 100%;
    height: auto !important;
    /* Ensure slide takes full height of its parent */
    /* Ensure the slide itself is a flex container to center its image */
    display: flex;
    align-items: center;
    /* Center image vertically within the slide */
    justify-content: center;
    /* Center image horizontally within the slide */
    min-width: 0;
}

.amenity-tooltip-image-slider .swiper-slide img {
    max-width: 100%;
    /* Constrain width to container */
    max-height: 100%;
    /* Constrain height to container */
    object-fit: contain !important;
    /* Force scaling down to fit entirely */
    display: block;
    /* Ensure block-level behavior */
    box-sizing: border-box;
    /* Re-adding box-sizing: border-box */
}

/* --- Mobile & Tablet: 2 items per row with smaller text --- */
@media (max-width: 1440px) and (min-width: 511px) {

    /* Tablet: 2 columns */
    .property-amenities ul,
    .property-facilities ul,
    .popup-feature-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px 15px;
    }

    .property-facilities ul li,
    .property-amenities ul li,
    .popup-feature-list li {
        font-size: 0.9em;
        padding: 6px 10px;
        gap: 8px;
    }

    .property-facilities ul li img,
    .property-amenities ul li img,
    .popup-feature-list li img {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 510px) {

    /* Mobile: 2 columns with even smaller text */
    .property-amenities ul,
    .property-facilities ul,
    .popup-feature-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px 10px;
    }

    .property-facilities ul li,
    .property-amenities ul li,
    .popup-feature-list li {
        font-size: 0.95em;
        padding: 8px 10px;
        gap: 8px;
        margin-bottom: 0;
    }

    .property-facilities ul li img,
    .property-amenities ul li img,
    .popup-feature-list li img {
        width: 24px;
        height: 24px;
    }
}