/* ============================================
   PREVENT FOUC FOR SELECT2 DROPDOWNS
   ============================================ */

/* Hide native dropdowns until Select2 initializes */
.facetwp-dropdown:not(.select2-hidden-accessible) {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Show Select2 container immediately */
.select2-container {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Smooth transition when Select2 initializes */
.select2-container {
    animation: fadeIn 0.2s ease-in;
}

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



/* Hotel Grouping Styles */

/* Two Column Layout - Desktop Only */
.hotels-two-column-wrapper {
    display: flex !important;
    gap: 40px !important;
    align-items: flex-start !important;
}

.hotels-left-column {
    flex: 1 1 50% !important;
    min-width: 0 !important;
}

.hotels-right-column {
    flex: 0 0 50% !important;
    position: sticky !important;
    top: 100px !important;
    padding-left: 140px;
}

/* Hide image column by default */
.hotels-right-column {
    display: none !important;
}

/* Show when region OR search is active */
.hotels-right-column.show-image {
    display: block !important;
}

.region-image-container {
    width: 100% !important;
    overflow: hidden !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
    position: relative !important;
    justify-self: right;
}

.region-image {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    transition: transform 0.3s ease !important;
}

.region-name-overlay {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent) !important;
    color: white !important;
    padding: 40px 20px 20px !important;
    font-size: 25px !important;
    font-weight: 400 !important;
    font-family: 'DM Sans';
}

/* Template Loading States */
.facetwp-template {
    visibility: hidden !important;
}

.facetwp-template.hotels-ready {
    visibility: visible !important;
    margin-top: -14px;
}

/* Grouped Results */
.hotel-group {
    margin-bottom: 35px !important;
    padding: 0px !important;
}

.hotel-group-header {
    font-size: 36px !important;
    font-weight: 400 !important;
    color: #404040 !important;
    margin-bottom: 20px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid #404F50 !important;
    text-transform: capitalize !important;
    line-height: 1.5;
}

.group-count {
    font-size: 25px !important;
    font-weight: 400 !important;
    color: #7f8c8d !important;
}

/* Hotel Items */
.hotel-item {
    margin-bottom: 5px !important;
}

.hotel-item h3.hotel-title {
    margin: 0 !important;
    font-size: 20px !important;
    color: #2c3e50 !important;
    font-family: 'DM Sans' !important;
}

.hotel-code {
    display: inline-block !important;
    color: #7f8c8d !important;
    font-size: 14px !important;
    margin-bottom: 10px !important;
}

body.reorganizing-hotels .facetwp-template {
    visibility: hidden !important;
}

/* Custom Pagination */
.hotels-pagination {
    display: flex !important;
    justify-content: left !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 30px 0 !important;
    flex-wrap: wrap !important;
}

.hotels-page-btn {
    padding: 0px !important;
    background: none;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-size: 24px !important;
    color: #2c3e50 !important;
    font-weight: 500 !important;
}

.hotels-page-btn:hover:not(:disabled) {
    background: none !important;
    color: #DCD8CA !important;
    border-color: #3498db !important;
}

.hotels-page-btn.active {
    color: #7f8c8d !important;
}

.hotels-page-btn:disabled {
    opacity: 0 !important;
    visibility: hidden !important;
}

.facetwp-pager {
    display: none !important;
}

button.facetwp-reset.facetwp-hide-empty {
    background-color: unset;
    border: none;
    color: rgba(64, 78, 80, 0.8) !important;
    text-decoration: underline;
}


/* ============================================
   FACETWP DROPDOWN STYLING WITH SELECT2
   ============================================ */

/* Select2 Container */
.select2-container {
    width: 100% !important;
    min-width: 250px;
    font-size: 17px;
    font-weight: 400 !important;
    font-family: 'DM Sans';
}

/* Select2 Selection Box (the main dropdown button) */
.select2-container--default .select2-selection--single {
    height: auto !important;
    border: 1px solid #404F50 !important;
    border-radius: 0 !important;
    background-color: #ffffff !important;
    padding: 10px 30px 10px 12px !important;
    transition: all 0.3s ease !important;
}

/* Selected text */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: rgba(64, 78, 80, 0.8) !important;
    line-height: normal !important;
    padding: 0 !important;
    font-size: inherit !important;
}

/* Placeholder text */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: rgba(64, 78, 80, 0.8) !important;
}

/* Arrow */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    right: 12px !important;
    width: 24px !important;
}

/* Hide default triangle */
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    display: none !important;
}

/* Add angle-down icon using SVG */
.select2-container--default .select2-selection--single .select2-selection__arrow::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 18px !important;
    height: 18px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath fill='%23404F50' d='M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
    background-position: center !important;
    transition: transform 0.3s ease !important;
}

/* Rotate arrow when dropdown is open */
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow::after {
    transform: translate(-50%, -50%) rotate(180deg) !important;
}

/* Focus State */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border: 1px solid #404F50 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Arrow when open */
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #404F50 transparent !important;
}

/* Dropdown Menu */
.select2-dropdown.facetwp-select2-dropdown {
    margin-top: 3px !important;
    border: 1px solid #404F50 !important;
    border-radius: 0 !important;
    background-color: #ffffff !important;
}

/* Dropdown Results Container */
.select2-results {
    background-color: #ffffff !important;
}

/* Individual Options */
.select2-results__option {
    padding: 6px 7px !important;
    color: rgba(64, 78, 80, 0.8) !important;
    background-color: #ffffff !important;
    transition: all 0.2s ease !important;
    
}

/* Hover State */
.select2-results__option--highlighted {
    background-color: #91AAAF !important;
    color: #ffffff !important;
}

/* Selected Option */
.select2-results__option[aria-selected="true"] {
    background-color: #91AAAF !important;
    color: #ffffff !important;
}

/* Hide Search */
.select2-search--dropdown {
    display: none !important;
}

.select2-search__field {
    display: none !important;
}

/* Original FacetWP Search Input */
input.facetwp-search {
    border: 1px solid #404F50 !important;
    color: rgba(64, 78, 80, 0.8);
    min-width: 250px !important;
    font-size: 17px !important;
    font-weight: 400 !important;
    font-family: 'DM Sans';
}

input.facetwp-search:focus {
    color: rgba(64, 78, 80, 0.8) !important;
    background-color: rgba(250, 250, 250, 1) !important;
}

/* ============================================
   HIDE EMPTY DROPDOWN COLUMNS
   ============================================ */

/* Hide the column completely when it contains a hidden facet */
.column.mcb-column.fwp-hidden-column,
.mcb-wrap .column.mcb-column.fwp-hidden-column,
.mcb-wrap-inner .column.mcb-column.fwp-hidden-column {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    flex: 0 0 0 !important;
    flex-basis: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
    opacity: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    height: 0 !important;
}

/* Ensure the wrap doesn't have extra gap for hidden columns */
.mcb-wrap-z8xpaeji .mcb-wrap-inner {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}

/* Override any inline-flex from mfn-item-inline */
.mcb-wrap-z8xpaeji .column.mcb-column.mfn-item-inline:not(.fwp-hidden-column) {
    display: inline-flex !important;
}

/* ============================================
   NO RESULTS MESSAGE
   ============================================ */

.no-results-message {
    text-align: center;
    padding: 80px 40px;
    background: #DCD8CA;
    margin: 0;
}

.no-results-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results-message h3 {
    font-size: 36px;
    margin-bottom: 15px;
    color: #404F50;
	font-weight: 400;
}

.no-results-message p {
    font-size: 20px;
    color: #000000;
    max-width: 570px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Mobile responsive */
@media (max-width: 767px) {
    .no-results-message {
        padding: 60px 20px;
        margin: 20px 0;
    }
    
    .no-results-icon {
        font-size: 48px;
    }
    
    .no-results-message h3 {
        font-size: 22px;
    }
    
    .no-results-message p {
        font-size: 16px;
    }
}

/* Tablet (768px - 959px) - Single Column, Hide Image */
@media (max-width: 959px) {
    .hotels-two-column-wrapper {
        flex-direction: column !important;
    }
    
    .hotels-right-column {
        display: none !important;
    }
    
    .hotels-right-column.show-image {
        display: none !important;
    }
    
    .hotels-left-column {
        flex: 1 1 100% !important;
    }
	
	.hotel-group {
        justify-content: center !important;
    }
    
    .hotels-pagination {
        justify-content: center !important;
    }
}

/* Mobile (<768px) - Single Column, Hide Image */
@media (max-width: 767px) {
    .hotels-two-column-wrapper {
        flex-direction: column !important;
    }
    
    .hotels-right-column {
        display: none !important;
    }
    
    .hotels-right-column.show-image {
        display: none !important;
    }
    
    .hotels-left-column {
        flex: 1 1 100% !important;
    }
    
    .hotel-group {
        padding: 15px !important;
    }
    
    .hotel-group-header {
        font-size: 22px !important;
    }
    
    .hotel-item {
        padding: 15px !important;
    }
    
}