/* 
 * ALAIA MEILISEARCH PREMIUM UI
 * PIXEL PERFECT RECONSTRUCTION - VERSION 5
 */

:root {
    --alaia-pink: #FF385C;
    --alaia-turquoise: #4ebdd2;
    --alaia-text: #222222;
    --alaia-light: #717171;
    --alaia-border: #DDDDDD;
    --alaia-bg-gray: #F7F7F7;
}

/* --- Typo: Inherit Outfit from Theme --- */
body,
.alaia-meilisearch-main {
    color: var(--alaia-text);
    background: #fff;
    font-size: 15px;
}

/* --- Structural Containers --- */
.alaia-meilisearch-main .container-fluid {
    padding: 0 40px !important;
    max-width: 100%;
}

/* --- Search Header (Mega Pill) --- */
.alaia-search-header {
    background: #fff;
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    top: 0;
    z-index: 1;
}

.alaia-search-mega {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--alaia-border);
    border-radius: 40px;
    height: 66px;
    max-width: 850px;
    margin: 0 auto;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s;
    cursor: pointer;
}

.alaia-search-mega:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.search-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 24px;
    height: 100%;
    border-radius: 40px;
}

.search-item:hover {
    background: var(--alaia-bg-gray);
}

.search-item label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0 0 1px 0;
    display: block;
}

.search-item input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    font-size: 14px !important;
    width: 100% !important;
    height: auto !important;
    color: var(--alaia-light) !important;
    font-family: inherit !important;
}

.search-divider {
    width: 1px;
    height: 32px;
    background: #ddd;
}

.search-submit-btn {
    background: var(--alaia-turquoise);
    color: #fff;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    cursor: pointer;
}

/* --- Controls Bar --- */
.alaia-controls-bar {
    padding: 8px 0 8px;
    border-bottom: 1px solid #f9f9f9;
}

.controls-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-label {
    font-size: 16px;
    font-weight: 700;
    color: #222;
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

span.ais-Stats-text {
    font-size: 12px;
    line-height: 1.3;
    font-weight: 300;
    color: #626262;
}

.premium-btn {
    background: #fff;
    border: 0px solid var(--alaia-border);
    padding: 6px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.35s ease;
}

.premium-btn:hover {
    background-color: #f5f5f5;
    transition: all 0.35s ease;
}

.grid-switcher {
    display: flex;
    align-items: center;
    gap: 12px;
}

.grid-switcher-inner {
    display: flex;
    background: #f9f8f8;
    border-radius: 10px;
    padding: 0px;
}

.grid-btn {
    border: none;
    background: transparent;
    padding: 4px 12px;
    font-weight: 500;
    font-size: 12px;
    color: #717171;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.2s;
}

.grid-btn.active {
    background: #4ebdd2;
    color: white;
}

/* --- Layout Split (50/50 Map) --- */
.alaia-layout-container {
    display: flex;
    gap: 40px;
    width: 100%;
    min-height: 500px;
    padding: 20px 0;
    position: relative;
}

/* MAP OPEN STATE (DESKTOP) */
@media (min-width: 992px) {
    .alaia-layout-container.map-active {
        display: grid !important;
        grid-template: "results map" / 1fr 1fr !important;
        gap: 0 !important;
    }
    .alaia-layout-container.map-active .alaia-sidebar { 
        display: none !important; 
    }
    .alaia-results-area { grid-area: results; }
    .map-side-container { grid-area: map; display: block !important; }
}

#alaia-main-layout .alaia-sidebar {
    width: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 0 0 0;
}

/* SIDEBAR WHEN MAP IS ACTIVE */
.alaia-layout-container.map-active.sidebarActive .alaia-sidebar {
    position: fixed;
    top: 110px;
    left: 0;
    z-index: 1001;
    background: #fff;
    padding: 10px;
    opacity: 1 !important;
    width: 300px !important;
    display: flex !important;
    box-shadow: 1px 26px 20px rgba(0, 0, 0, .2);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.alaia-layout-container.map-active .alaia-sidebar {
    width: 0px;
    opacity: 0;
    left: -200px;
    pointer-events: auto;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* END SIDEBAR WHEN MAP IS ACTIVE */

#alaia-main-layout.sidebarActive .alaia-sidebar {
    width: 300px;
    opacity: 1;
    pointer-events: auto;
    flex: 0 0 300px;
    margin-right: 40px;
}

#alaia-main-layout {
    gap: 0;
}

/* OFF-CANVAS MOBILE DRAWER */
@media (max-width: 991px) {
    #alaia-main-layout .alaia-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -320px !important;
        height: 100vh !important;
        width: 300px !important;
        background: #fff !important;
        z-index: 9999 !important;
        padding: 30px 20px !important;
        margin: 0 !important;
        box-shadow: 10px 0 30px rgba(0,0,0,0.15) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        flex: none !important;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    #alaia-main-layout.sidebarActive .alaia-sidebar {
        left: 0 !important;
    }

    #sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(2px);
    }

    #alaia-main-layout.sidebarActive #sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }
}

.alaia-results-area {
    flex: 1;
    min-width: 0;
    transition: all 0.35s ease;
}

.map-side-container {
    display: none;
    height: calc(100vh - 120px);
    position: sticky;
    top: 110px;
    border-radius: 16px;
    overflow: hidden;
}

/* --- Sidebar Filters UI --- */
.sidebar-widget-premium {
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.ais-Header {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* USER REQUESTED FILTER STYLES */
div#alaia-category-filter ul,
div#alaia-region-filter ul,
div#alaia-features-filter ul {
    list-style: none !important;
    padding: 0 !important;
}

div#alaia-category-filter ul li,
div#alaia-region-filter ul li,
div#alaia-features-filter ul li {
    margin-bottom: 6px !important;
    padding: 0px 0px 0px 14px !important;
    border-radius: 12px !important;
    transition: all 0.25s ease !important;
    list-style: none !important;
}

div#alaia-category-filter ul li:hover,
div#alaia-region-filter ul li:hover,
div#alaia-features-filter ul li:hover {
    background-color: #f5f5f5 !important;
    transition: all 0.25s ease !important;
}

.ais-RefinementList-checkbox {
    height: 12px !important;
    width: 12px !important;
    margin: 0 !important;
    cursor: pointer;
}

.ais-RefinementList-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    padding: 0px 0;
}

.ais-RefinementList-count {
    margin-left: auto;
    font-size: 12px;
    color: #717171;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 10px;
}

.ais-RefinementList-searchBox input {
    width: 100%;
    padding: 10px 16px;
    border-radius: 30px;
    border: 1px solid var(--alaia-border);
    margin-bottom: 15px;
}

/* --- Hits Grid (PIXEL PERFECT) --- */
.ais-Hits-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: grid !important;
    gap: 40px 24px;
    grid-template-columns: repeat(1, 1fr) !important;
    /* Mobile */
}

@media (min-width: 768px) {
    .ais-Hits-list {
        grid-template-columns: repeat(2, 1fr) !important;
        /* Tablet */
    }
}

@media (min-width: 1200px) {
    .ais-Hits-list {
        grid-template-columns: repeat(4, 1fr) !important;
        /* Desktop Default */
    }

    /* Override classes for manual switching - ONLY ACTIVE ON DESKTOP */
    .grid-cols-2 .ais-Hits-list {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .grid-cols-3 .ais-Hits-list {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .grid-cols-4 .ais-Hits-list {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .grid-cols-5 .ais-Hits-list {
        grid-template-columns: repeat(5, 1fr) !important;
    }

    .grid-cols-6 .ais-Hits-list {
        grid-template-columns: repeat(6, 1fr) !important;
    }
}

/* Forced grid on map split */
.map-active .ais-Hits-list {
    grid-template-columns: repeat(2, 1fr) !important;
}

/* --- Property Card --- */
.alaia-premium-card {
    color: #333;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
    transition: all 0.25s ease;
}

/* .alaia-premium-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: all 0.25s ease;
} */

.alaia-premium-card a {
    color: #333;
}

/* FIXED HEIGHT IMAGE */
.card-media-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #eee;
    height: 0;
    padding-bottom: 83.33%;
    /* 1.2:1 Aspect Ratio -> 100/1.2 = 83.33 */
    margin-bottom: 8px;
    isolation: isolate;
}

.gallery-carousel-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.gallery-carousel {
    display: flex;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.gallery-carousel::-webkit-scrollbar {
    display: none;
}

.gallery-slide {
    flex: 0 0 100%;
    height: 100%;
    scroll-snap-align: start;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Carousel Navigation Overlay */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 12px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
    pointer-events: none;
}

.card-media-wrapper:hover .gallery-nav {
    opacity: 1;
}

.gallery-prev,
.gallery-next {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.25s ease;
    color: #222;
}

.gallery-prev:hover,
.gallery-next:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

/* Card Text Content */
.card-title-main {
    line-height: 1.2 !important;
    min-height: 35px;
}

.card-title-main h4 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    color: #222;
    text-decoration: none;
    margin: 4px 0;
}

/* .card-category-info {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--alaia-turquoise);
    letter-spacing: 0.1px;
}
 */
.card-excerpt {
    margin: 0;
    min-height: 40px;
}

.card-excerpt p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.5;
    color: #717171;
    margin: 0;
}

.card-rating-side {
    display: flex;
    align-items: center;
    gap: 2px;
    font-weight: 400;
    font-size: 12px;
    line-height: 1;
    background-color: #fff9e8;
    padding: 8px 12px;
    border-radius: 30em;
}

.card-rating-side i {
    font-size: 10px;
    color: #ffca08;
}

.card-subtitle-line {
    color: var(--alaia-light);
    font-size: 12px;
    margin-top: 0px;
}

.price-main,
.price-secondary {
    color: #717171;
    margin: 0;
    font-size: 14px;
    font-weight: 400;
}

.price-main .price-main-value,
.price-secondary .price-secondary-value {
    color: #333;
    font-weight: 600;
    text-decoration: underline;
}

.card-pricing-footer {
    display: flex;
    justify-content: space-between;
}

.card-category-info {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    width: fit-content;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 10px;
    color: #333;
    position: absolute;
    top: 10px;
    right: 10px;
    letter-spacing: 0.2px;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1;
    z-index: 10;
}

/* --- Pagination (Modern Circles) --- */
.ais-Pagination-list {
    display: flex;
    justify-content: center;
    gap: 10px;
    list-style: none;
    padding: 40px 0;
    margin: 0;
}

.ais-Pagination-link {
    display: flex;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #ddd;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #222;
    font-weight: 700;
    font-size: 14px;
    transition: 0.2s;
    cursor: pointer;
}

.ais-Pagination-item--selected .ais-Pagination-link {
    background: #222;
    border-color: #222;
    color: #fff;
}

.ais-Pagination-link:hover:not(.ais-Pagination-item--selected .ais-Pagination-link) {
    background: #f0f0f0;
    border-color: #222;
}

/* --- Map Switch --- */
.map-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-toggle-wrapper .switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.map-toggle-wrapper .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.map-toggle-wrapper .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.map-toggle-wrapper .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 50%;
    transform: translate(0px, 10px) !important;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.map-toggle-wrapper input:checked+.slider {
    background-color: #222;
}

.map-toggle-wrapper input:checked+.slider:before {
    transform: translate(22px, 10px) !important;
}

.map-toggle-wrapper input:checked+.slider {
    background-color: #4ebdd2;
}

.map-toggle-wrapper input:focus+.slider {
    box-shadow: 0 0 1px #4ebdd2;
}

.map-toggle-wrapper input:checked+.slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}


/* --- Guest Dropdown Premium --- */
.guest-selector-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 380px;
    background: #fff;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid #ddd;
    z-index: 2000;
}

.guest-selector-dropdown.hidden {
    display: none;
}

.guest-type {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.guest-type:last-child {
    border: none;
}

.cnt-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #717171;
}

.cnt-btn:hover {
    border-color: #222;
    color: #222;
}

input.ais-SearchBox-input {
    height: 45px;
    border-radius: 12px;
    padding: 12px 12px;
    width: 100%;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

input.ais-SearchBox-input {
    height: 45px;
    border-radius: 12px;
    padding: 12px 12px;
    width: 100%;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

form.ais-SearchBox-form {
    position: relative;
}

form.ais-SearchBox-form:hover button.ais-SearchBox-submit,
form.ais-SearchBox-form:hover button.ais-SearchBox-reset {
    opacity: 1;
    transform: translate(-100%, -50%);
    transform-origin: center;
    pointer-events: all;
}

form.ais-SearchBox-form button.ais-SearchBox-submit,
form.ais-SearchBox-form button.ais-SearchBox-reset {
    opacity: 0;
    transform: translate(-100%, -0%);
    transition: all 0.35s ease;
    pointer-events: none;
}

button.ais-SearchBox-submit {
    background-color: #4ebdd2;
    border: 0;
    padding: 0px;
    border-radius: 30em;
    width: fit-content;
    height: fit-content;
    position: absolute;
    top: 50%;
    left: 88%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all 0.35s ease;
    transform: translate(-100%, -50%);
}

button.ais-SearchBox-submit:hover {
    background-color: #4ebdd2;
    opacity: 1;
}

button.ais-SearchBox-submit svg {
    fill: #fff;
    width: 30px;
    height: 30px;
    padding: 9px;
}

button.ais-SearchBox-reset {
    background-color: #f91942;
    border: 0;
    padding: 0px;
    border-radius: 30em;
    width: fit-content;
    height: fit-content;
    position: absolute;
    top: 50%;
    left: 99%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all 0.35s ease;
    transform: translate(-100%, -50%);
}

button.ais-SearchBox-reset:hover {
    background-color: #f91942;
    opacity: 1;
}

button.ais-SearchBox-reset svg {
    fill: #fff;
    width: 30px;
    height: 30px;
    padding: 9px;
}

button#mobile-map-toggle {
    display: none;
}