/* ============================================================
   Home — buscador del banner (.home-search)
   Va dentro de .info-slider, sobre el video. Tipografía (Montserrat/Lora)
   y paleta (blue #253652 / gold #BAAA8F) vienen del tema global.
   Los campos replican el select de properties.mare-realty.com:
   etiqueta dorada 12px arriba, control blanco de 52px con texto 16px/500,
   borde inferior gris claro y caret de 7px rotado.
   Redirige a properties.mare-realty.com — ver inc/home-search.php
   ============================================================ */

/* ───── Título sobre el buscador ───── */
.home-search__head {
    margin-bottom: 20px;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.3);
}
.home-search__kicker {
    margin-bottom: 12px;
}
.home-search__title {
    margin: 0;
    font-size: 38px;
    line-height: 1.15;
}

/* ───── Tarjeta ───── */
.home-search {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    width: 100%;
    margin-top: 24px;
    padding: 18px 20px 20px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

.home-search__field {
    flex: 1 1 0;
    min-width: 0;
}
/* más aire para los nombres largos (ubicación, "Alquiler temporal") */
.home-search__field:nth-child(1) {
    flex-grow: 1.15;
}
.home-search__field:nth-child(3) {
    flex-grow: 1.6;
}

/* etiqueta: igual a .mare-locsel-label de properties */
.home-search__label {
    display: block;
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #BAAA8F;
}

/* control: igual a .form-control de properties (blanco, borde inferior, caret) */
.home-search__control {
    position: relative;
    background: #fff;
    border-bottom: 1px solid rgba(223, 228, 235, 0.8);
    transition: border-color ease-in .2s;
}
.home-search__control::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 18px;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid #253652;
    border-bottom: 1.5px solid #253652;
    opacity: 0.5;
    transform: translateY(-2px) rotate(45deg);
    transform-origin: 50% 50%;
    margin-top: -3px;
    pointer-events: none;
}
.home-search__control:focus-within {
    border-bottom-color: #BAAA8F;
}

.home-search__select {
    display: block;
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 0 36px 0 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 22px;
    letter-spacing: 0;
    color: #253652;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.home-search__select:focus {
    outline: none;
    box-shadow: none;
}
.home-search__select::-ms-expand {
    display: none;
}

/* botón: igual a .btn-tertiary de properties (navy 52px, 10px/500 mayúsculas) */
.home-search__submit {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    height: 52px;
    margin: 0;
    padding: 0 28px;
    border: 1px solid #294977;
    border-radius: 0;
    background: #294977;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color ease-in .2s, border-color ease-in .2s;
}
.home-search__submit::after {
    content: '';
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='21' viewBox='0 0 21 21' fill='none'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' fill='%23ffffff' d='m2.68164 9.68376c0 4.02704 3.26459 7.29164 7.29167 7.29164 4.02709 0 7.29169-3.2646 7.29169-7.29164 0-4.02708-3.2646-7.29167-7.29169-7.29167-4.02708 0-7.29167 3.26459-7.29167 7.29167zm7.29167 8.54164c-4.71743 0-8.54167-3.8242-8.54167-8.54164s3.82424-8.54167 8.54167-8.54167c4.71739 0 8.54169 3.82423 8.54169 8.54167 0 2.13374-.7824 4.08474-2.076 5.58184l2.7263 2.7262c.244.2441.244.6398 0 .8839-.2441.2441-.6399.2441-.8839 0l-2.7263-2.7262c-1.497 1.2935-3.448 2.0759-5.58179 2.0759z'/%3E%3C/svg%3E") no-repeat center;
    background-size: 100%;
}
.home-search__submit:hover,
.home-search__submit:focus {
    background: #253652;
    border-color: #253652;
    color: #fff;
    outline: none;
}

/* ============================================================
   Selector de ubicación (.mare-locsel-*)
   Portado 1:1 de properties.mare-realty.com (CSS relevado el 2026-10-09;
   las variables --dark/--tertiary/--primary van como colores literales).
   Adaptaciones para el banner al final del bloque.
   ============================================================ */
.mare-locsel { position: relative; }
.mare-locsel.is-enhanced .home-search__control { display: none; }

/* trigger: mismo aspecto que el control de los otros campos */
.mare-locsel .mare-locsel-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 0 18px;
    background: #fff;
    border: 0;
    border-bottom: 1px solid rgba(223, 228, 235, 0.8);
    border-radius: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.375;
    color: #253652;
    text-align: left;
    cursor: pointer;
    transition: border-color ease-in .2s;
}
.mare-locsel .mare-locsel-trigger:focus {
    outline: none;
    box-shadow: none;
    border-bottom-color: #BAAA8F;
}
.mare-locsel-value { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mare-locsel-caret {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    margin-right: 2px;
    border-right: 1.5px solid;
    border-bottom: 1.5px solid;
    opacity: 0.5;
    transition: transform 0.15s;
    transform: translateY(-2px) rotate(45deg);
}
.mare-locsel-trigger[aria-expanded="true"] .mare-locsel-caret { transform: translateY(1px) rotate(-135deg); }

.mare-locsel-panel {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1050;
    flex-direction: column;
    min-width: 260px;
    background: #fff;
    border: 1px solid rgba(223, 228, 235, 0.9);
    box-shadow: 0 12px 28px rgba(37, 54, 82, 0.14);
}
.mare-locsel-panel.is-open { display: flex; }
.mare-locsel-panel-head { display: none; }
.mare-locsel-search { padding: 10px; border-bottom: 1px solid rgba(223, 228, 235, 0.8); }
.mare-locsel-input {
    width: 100%;
    padding: 9px 12px;
    background: rgba(223, 228, 235, 0.22);
    border: 1px solid transparent;
    border-radius: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #253652;
}
.mare-locsel-input::placeholder { color: rgba(37, 54, 82, 0.45); }
.mare-locsel-input:focus { outline: none; background: #fff; border-color: #294977; box-shadow: none; }
.mare-locsel-list {
    max-height: 320px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.mare-locsel-list li { margin: 0; padding: 0; }
.mare-locsel-option {
    display: block;
    position: relative;
    width: 100%;
    padding: 8px 12px 8px calc(12px + var(--mare-depth, 0) * 16px);
    background: none;
    border: 0;
    border-radius: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
    color: #253652;
    text-align: left;
    cursor: pointer;
    transition: none;
}
.mare-locsel-option.has-guide::before {
    content: '';
    position: absolute;
    top: 50%;
    left: calc(var(--mare-depth, 0) * 16px);
    width: 7px;
    height: 1px;
    background: rgba(37, 54, 82, 0.25);
}
.mare-locsel-option.is-all {
    margin-bottom: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(223, 228, 235, 0.8);
    font-weight: 500;
}
.mare-locsel-option.is-active { background: rgba(41, 73, 119, 0.07); }
.mare-locsel-option.is-selected { color: #294977; font-weight: 600; }
.mare-locsel-option-name { display: block; }
.mare-locsel-option-path {
    display: block;
    margin-top: 1px;
    font-size: 11px;
    letter-spacing: 0.2px;
    color: rgba(37, 54, 82, 0.5);
}
.mare-locsel-mark { padding: 0; color: inherit; background: rgba(186, 170, 143, 0.35); }
.mare-locsel-empty {
    padding: 16px 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: rgba(37, 54, 82, 0.6);
    text-align: center;
}
.mare-locsel-backdrop { display: none; }

/* adaptación al banner: el buscador está al pie del video, el panel abre hacia arriba */
@media (min-width: 768px) {
    .mare-locsel-panel {
        top: auto;
        bottom: calc(100% + 2px);
        max-width: 420px;
        box-shadow: 0 -12px 28px rgba(37, 54, 82, 0.14);
    }
}

/* móvil: hoja inferior, igual que producción */
@media (max-width: 767.98px) {
    /* en móvil el JS cuelga panel y backdrop de <body> (ver mount() en home-search.js) */
    .mare-locsel-backdrop.is-open {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1049;
        background: rgba(37, 54, 82, 0.45);
    }
    .mare-locsel-panel {
        position: fixed;
        inset: auto 0 0;
        z-index: 1050;
        max-height: 85vh;
        padding-bottom: env(safe-area-inset-bottom);
        border: 0;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -8px 30px rgba(37, 54, 82, 0.25);
    }
    .mare-locsel-panel-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 14px 16px 10px;
        border-bottom: 1px solid rgba(223, 228, 235, 0.8);
    }
    .mare-locsel-panel-title {
        font-family: 'Montserrat', sans-serif;
        font-size: 12px;
        font-weight: 400;
        letter-spacing: 1px;
        text-transform: uppercase;
        color: #BAAA8F;
    }
    .mare-locsel-close {
        padding: 0 4px;
        background: none;
        border: 0;
        font-size: 26px;
        line-height: 1;
        color: #253652;
    }
    .mare-locsel-search { padding: 12px 16px; }
    .mare-locsel-input { padding: 12px 14px; font-size: 16px; }
    .mare-locsel-list { flex: 1 1 auto; max-height: none; padding: 4px 0 12px; }
    .mare-locsel-option {
        padding-top: 13px;
        padding-bottom: 13px;
        padding-right: 16px;
        padding-left: calc(16px + var(--mare-depth, 0) * 16px);
        font-size: 15px;
    }
    .mare-locsel-option.has-guide::before { left: calc(4px + var(--mare-depth, 0) * 16px); }
}

/* ───── Responsive ─────
   Por debajo de 1200px los 5 campos no entran en una fila:
   pasa a 2 columnas, con Ubicación a ancho completo. */
@media (max-width: 1199px) {
    .home-search {
        flex-wrap: wrap;
        align-items: stretch;
    }
    .home-search__field {
        flex: 1 1 calc(50% - 6px);
        max-width: calc(50% - 6px);
    }
    .home-search__field:nth-child(3) {
        flex-basis: 100%;
        max-width: 100%;
    }
    .home-search__submit {
        flex: 1 1 100%;
        margin-top: 4px;
    }
}

@media (max-width: 768px) {
    .home-search__title {
        font-size: 28px;
    }
    .home-search__head {
        margin-bottom: 14px;
    }
    /* .info-slider ancla al fondo del banner (100vh); con 80px el botón
       queda por encima del pliegue también con la barra del navegador móvil */
    .home .info-slider {
        padding-bottom: 80px;
    }
    .home-search {
        margin-top: 12px;
        padding: 12px 14px 14px;
        gap: 10px;
    }
    .home-search__field {
        flex-basis: calc(50% - 5px);
        max-width: calc(50% - 5px);
    }
    .home-search__select {
        height: 46px;
        padding: 0 30px 0 12px;
        font-size: 14px;
    }
    .mare-locsel .mare-locsel-trigger {
        height: 46px;
        padding: 0 14px 0 12px;
        font-size: 14px;
    }
    .home-search__control::after {
        right: 14px;
    }
    .home-search__submit {
        height: 48px;
    }
}
