/* Base styles for the room type popup */
#room-details-popup.popup-overlay {
    display: none;
    /* Hidden by default, JS changes to flex */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
}

#room-details-popup .popup-content {
    /* Base properties from merged rules */
    background-color: #ffffff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 1200px;
    height: auto;
    max-height: 90vh;
    /* Increased height */
    overflow-y: auto;
    position: relative;

    /* Grid properties */
    display: grid !important;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) !important;
    background-color: rgba(255, 255, 255, 0.95);
    /* Override with semi-transparent */
    grid-template-rows: auto 1fr;
    /* Corrected: Header row, Content row */
    grid-template-areas:
        "header header"
        "left-col right-col";
    /* Corrected: No footer area needed */
    gap: 15px;
    isolation: isolate;
    padding-bottom: 100px;
}

#room-details-popup .close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #E6007A;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}

#room-details-popup .close-button:hover {
    color: #000;
}

/* --- Room Details Popup Specific Styles --- */
#room-details-popup .popup-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    /* Match parent radius */
    background-image: url('../../images/himalayas-view.png');
    /* Corrected path */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.5;
    /* Make the background less prominent */
    z-index: -1;
}

#room-details-popup .popup-header-container {
    grid-area: header;
    padding-bottom: 0;
    margin-bottom: 0;
    text-align: center;
    /* Center the title */
}

#room-details-popup .popup-header-container .exp-popup-detail-item {
    text-align: left;
    /* Left-align description */
}

#room-details-popup #room-popup-title {
    margin-bottom: 5px;
    color: #333;
    /* Add space below the title */
}

#room-details-popup #roomtype-long-description {
    font-size: 1rem;
    color: #444;
    line-height: 1.6;
    margin-bottom: 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding: 9px 0;
    text-align: left;
    /* Keep description text left-aligned */
}

#room-details-popup .roomtype-popup-left-column {
    grid-area: left-col;
    /* Assign to the left grid area */
    display: flex;
    flex-direction: column;
    padding-right: 10px;
    border-right: 1px solid #eee;
    padding-top: 0;
}

#room-details-popup .exp-popup-right-column {
    grid-area: right-col;
    /* Assign to the right grid area */
    display: flex;
    flex-direction: column;
    padding-left: 0;
}

#room-details-popup .cta-button-small {
    position: absolute;
    bottom: 25px;
    /* Positioned 25px from the bottom */
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    /* Fixed width for the button */
    box-sizing: border-box;
    background-color: #FF007A;
    color: white !important;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

#room-details-popup .cta-button-small:hover {
    background-color: #e6006e;
}

#room-details-popup #room-popup-description-text {
    margin-bottom: 10px;
}

#room-details-popup .roomtype-popup-left-column .exp-popup-detail-item {
    color: #718096;
    font-size: 1rem;
}

#room-details-popup .room-details-row {
    display: flex;
    justify-content: flex-start;
    width: 100%;
}

#room-details-popup .room-capacity {
    margin-left: 60px;
}

#room-details-popup .swiper-slide {
    position: relative;
}

#room-details-popup .swiper-slide-caption {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 15px;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 500;
    z-index: 10;
    text-align: center;
    white-space: nowrap;
}

#room-details-popup .room-popup-slider {
    flex-grow: 1;
    height: 330px;
    max-height: 440px;
    position: relative;
    width: 100% !important;
    border-radius: 8px;
    overflow: hidden;
}

#room-details-popup .room-popup-slider .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#room-details-popup .room-popup-slider .swiper-button-next,
#room-details-popup .room-popup-slider .swiper-button-prev {
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent !important;
    color: #fff !important;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
    box-shadow: none !important;
}

#room-details-popup .room-popup-slider .swiper-button-next:hover,
#room-details-popup .room-popup-slider .swiper-button-prev:hover {
    background-color: transparent !important;
    transform: translateY(-50%) scale(1.1) !important;
}

#room-details-popup .room-popup-slider .swiper-button-next:after,
#room-details-popup .room-popup-slider .swiper-button-prev:after {
    font-size: 24px !important;
}

#room-details-popup .room-name-overlay,
#room-details-popup .image-counter-overlay {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    white-space: nowrap;
}

#room-details-popup .room-name-overlay {
    top: 10px;
    text-align: center;
    width: auto;
    max-width: 90%;
}

#room-details-popup .image-counter-overlay {
    bottom: 10px !important;
    top: auto !important;
    text-align: center;
    width: 70px;
}

#room-details-popup .popup-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px !important;
    list-style: none;
    padding: 0;
    margin-bottom: 10px; /* Halved from 20px */
}

#room-details-popup .popup-feature-grid .popup-feature-list {
    display: contents;
}

#room-details-popup .popup-feature-list li {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-size: 0.95em;
    color: #555;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding-left: 0;
}

#room-details-popup .popup-feature-list li:hover {
    background-color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    cursor: default;
}

#room-details-popup .popup-feature-list li .amenity-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Spacing adjustments for facility and amenity items */
#room-details-popup .facility-item,
#room-details-popup .amenity-item {
    margin-bottom: 0 !important; /* Remove bottom margin completely */
    padding-top: 4px !important; /* Halved from 8px */
    padding-bottom: 4px !important; /* Halved from 8px */
}

#room-details-popup .popup-section-title {
    text-align: center;
}

/* Mobile styles (768px and below) */
@media (max-width: 768px) {
    #room-details-popup.popup-overlay {
        padding: 10px 5px;
        /* Drastically reduce left/right padding for wider popup on mobile */
    }

    #room-details-popup .popup-content {
        display: flex !important;
        flex-direction: column !important;
        width: 100%;
        max-width: 100%;
        padding: 15px;
        padding-bottom: 20px;
        /* Normal bottom padding since button is inside */
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }

    #room-details-popup .popup-header-container {
        order: 1;
    }

    #room-details-popup .roomtype-popup-left-column {
        order: 2;
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding-bottom: 0; /* Removed bottom padding on mobile */
        margin-bottom: 0px;
    }

    #room-details-popup .exp-popup-right-column {
        order: 3;
        padding-left: 0;
    }

    #room-details-popup .room-popup-slider {
        height: 274px; /* Increased by 8% from 254px */
        max-height: 312px; /* Increased by 8% from 289px */
    }

    #room-details-popup .room-details-row {
        flex-direction: row;
        justify-content: space-between;
        gap: 10px;
    }

    #room-details-popup .room-capacity {
        margin-left: 0;
    }

    #room-details-popup .popup-feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #room-details-popup .cta-button-small {
        position: relative;
        /* Keep inside the popup content */
        bottom: auto;
        left: auto;
        transform: none;
        width: 50%;
        margin: 0 auto 0 auto;
        /* Push to bottom of content */
        order: 4;
        /* Ensure it appears after right column */
    }
}