/* =============================================
   BOOKING MASK - Modal de Huéspedes
   Estilos para el selector de huéspedes estilo inline/dropdown
   ============================================= */

/* ===========================================
   1. VARIABLES DE COLOR - Colores corporativos Can Salia
   =========================================== */
:root {
    --guests-bg-color: #f4f1ec;
    --guests-button-bg-color: #DED9D4;
    --guests-button-color: #606060;
    --guests-button-bg-color-hover: #8C8275;
    --guests-button-color-hover: #ffffff;
    --guests-scroll: rgb(0 0 0 / 30%);
    --guests-scroll-bg: rgb(0 0 0 / 10%);
    --guests-font-color: #000000;
}

/* ===========================================
   2. FORMULARIO - Altura 100% para layout flex
   =========================================== */
#neobookings-form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ===========================================
   2.1 CALENDARIO - Botón cerrar alineado a la derecha
   =========================================== */
#bookForm .bookMiddle .fieldBox .field .popups > .popupsCancel {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* ===========================================
   3. TRIGGER - Input fake de huéspedes
   =========================================== */
#guestsFake {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    width: 100%;
}

#guestsFake:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Hacer que el label se mueva hacia arriba cuando el div tiene contenido */
#bookForm .bookMiddle .fieldBox .field #guestsFake.has-content ~ label,
#bookForm .bookMiddle .fieldBox .field #guestsFake:focus ~ label {
    top: -6px;
    left: 16px;
}

/* ===========================================
   3. POPUP DE HUÉSPEDES (estilo inline)
   Hereda posicionamiento base de .popups en can-salia-hotels.css
   =========================================== */
#bookForm .bookMiddle .fieldBox .field .guests-popups {
    width: max(345px, 100%);
    padding: 30px 20px 20px;
    background-color: var(--guests-bg-color);
}

/* Botón cerrar (X) posicionado arriba a la derecha */
#bookForm .bookMiddle .fieldBox .field .guests-popups > .guests-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

#bookForm .bookMiddle .fieldBox .field .guests-popups > .guests-close img {
    width: 14px;
    height: 14px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

#bookForm .bookMiddle .fieldBox .field .guests-popups > .guests-close:hover img {
    opacity: 1;
}

/* ===========================================
   4. CONTENEDOR DE HABITACIONES
   =========================================== */
.guests-popups .roomsbox {
    width: 100%;
    max-height: 250px;
    padding-right: 10px;
    overflow-y: auto;
    margin-bottom: 5px;
}

/* Scrollbar personalizado */
.guests-popups .roomsbox::-webkit-scrollbar {
    width: 2px;
}

.guests-popups .roomsbox::-webkit-scrollbar-track {
    background: var(--guests-scroll-bg);
    border-radius: 10px;
}

.guests-popups .roomsbox::-webkit-scrollbar-thumb {
    min-height: 40px;
    background: var(--guests-scroll);
    border-radius: 10px;
}

/* ===========================================
   5. HABITACIÓN INDIVIDUAL
   =========================================== */
.guests-popups .room {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    padding: 0 0 16px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid rgb(0 0 0 / 20%);
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
}

.guests-popups .room:last-of-type {
    margin-bottom: 16px;
    border-bottom: none;
}

/* Título de habitación */
.guests-popups .room-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--guests-font-color);
    line-height: normal;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Botón eliminar habitación */
.guests-popups .room-title .remove-room {
    padding: 3px 10px;
    background-color: var(--guests-button-bg-color);
    border: 1px solid var(--guests-button-bg-color);
    border-radius: 30px;
    color: var(--guests-button-color);
    font-family: 'Lato', sans-serif;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
    transition: all 0.3s ease-in-out;
}

.guests-popups .room-title .remove-room:hover {
    background-color: var(--guests-button-bg-color-hover);
    color: var(--guests-button-color-hover);
    border-color: var(--guests-button-color-hover);
}

/* Ocultar eliminar en la primera habitación */
.guests-popups .room:first-of-type .remove-room {
    display: none;
}

/* ===========================================
   6. CAMPOS DE HUÉSPEDES (adultos, niños, bebés)
   =========================================== */
.guests-popups .room-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
    margin-top: 6px;
    margin-bottom: 0;
}

.guests-popups .room-field .field-name {
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--guests-font-color);
    line-height: normal;
}

/* ===========================================
   7. BOTONES +/- (NUMBER INPUT) - Estilo circular
   =========================================== */
.guests-popups .number-input {
    display: flex;
    align-items: center;
    gap: 5px;
    border: none;
    background: transparent;
}

.guests-popups .number-input button {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 30px;
    padding: 0;
    outline: 0;
    border: 1px solid var(--guests-font-color) !important;
    background-color: transparent;
    border-radius: 100%;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.3s ease;
}

.guests-popups .number-input button:hover:not(.guests-disabled) {
    background-color: transparent !important;
}

.guests-popups .number-input button.guests-disabled {
    opacity: 0.4;
    cursor: auto;
}

/* Símbolo menos y más con pseudo-elementos */
.guests-popups .number-input button::before,
.guests-popups .number-input button::after {
    position: absolute;
    content: '';
    display: inline-block;
    width: 0.7rem;
    height: 2px;
    background-color: var(--guests-font-color);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Solo el plus tiene la línea vertical */
.guests-popups .number-input button.minus::after {
    display: none;
}

.guests-popups .number-input button.plus::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

/* Input numérico - Reset de estilos de .form-control */
#bookForm .bookMiddle .fieldBox .field .guests-popups .number-input input.form-control {
    display: block;
    width: 35px;
    height: 30px;
    margin: 0;
    padding: 0;
    border: none;
    background-color: transparent;
    background-image: none;
    border-radius: 0;
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    color: #000000;
    text-align: center;
    line-height: 30px;
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
}

#bookForm .bookMiddle .fieldBox .field .guests-popups .number-input input.form-control::-webkit-outer-spin-button,
#bookForm .bookMiddle .fieldBox .field .guests-popups .number-input input.form-control::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ===========================================
   8. EDADES DE NIÑOS
   =========================================== */
.guests-popups .ages-inputs {
    width: 100%;
    padding: 0;
    background: transparent;
    margin-top: 10px;
    font-size: 14px;
}

.guests-popups .ages-inputs.d-none {
    display: none;
}

.guests-popups .ages-label {
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    color: var(--guests-font-color);
    font-weight: 400;
    display: block;
    margin-bottom: 8px;
}

.guests-popups .ages-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

.guests-popups .ages-container .age-select-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 0;
}

.guests-popups .ages-container .age-select-wrapper span {
    font-family: 'Lato', sans-serif;
    font-size: 12px;
    color: var(--guests-font-color);
}

.guests-popups .ages-container select {
    padding: 8px 40px 8px 8px;
    border: 1px solid black;
    border-radius: 0;
    background: #FFFFFF;
    background-image: url(/themes/default/images/select_menu_icon.png);
    background-repeat: no-repeat;
    background-position: right 14px center;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    color: var(--guests-font-color);
    cursor: pointer;
    min-width: auto;
    width: auto;
    height: auto;
    line-height: 19px;
}

.guests-popups .ages-container select:focus {
    outline: none;
}

/* ===========================================
   9. BOTONES DE ACCIÓN
   =========================================== */
.guests-popups .action-buttons-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    gap: 12px;
    border-top: none;
    font-size: 14px;
    width: 100%;
}

.guests-popups .action-buttons-container a {
    flex: 1;
    padding: 12px 15px;
    text-align: center;
    text-decoration: none;
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

/* Botón añadir habitación - con borde, cuadrado */
.guests-popups .action-buttons-container .btn-add-room {
    background: transparent;
    border: 1px solid var(--guests-font-color);
    border-radius: 0;
    color: var(--guests-font-color);
    padding: 10px 20px;
}

.guests-popups .action-buttons-container .btn-add-room:hover {
    background: rgba(0, 0, 0, 0.05);
    text-decoration: none;
}

/* Botón aceptar - estilo con color primario, cuadrado */
/* Especificidad mayor que #bookForm .bookMiddle .fieldBox .field .popups .popupsCancel */
#bookForm .bookMiddle .fieldBox .field .guests-popups .action-buttons-container .guests-accept {
    padding: 10px 23px;
    background-color: var(--guests-button-bg-color);
    border: 1px solid var(--guests-button-bg-color);
    border-radius: 0;
    color: var(--guests-button-color);
    font-weight: 500;
    width: auto;
    height: auto;
}

#bookForm .bookMiddle .fieldBox .field .guests-popups .action-buttons-container .guests-accept:hover {
    background-color: var(--guests-button-bg-color-hover);
    color: var(--guests-button-color-hover);
    border-color: var(--guests-button-color-hover);
}

/* ===========================================
   10. RESPONSIVE
   =========================================== */
@media (max-width: 992px) {
    #bookForm .bookMiddle .fieldBox .field .guests-popups {
        min-width: 280px;
        max-width: 320px;
        padding: 25px;
    }

    .guests-popups .roomsbox {
        max-height: 250px;
    }
}

@media (max-width: 576px) {
    #bookForm .bookMiddle .fieldBox .field .guests-popups {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        min-width: 100%;
        max-width: 100%;
        width: 100%;
        height: 100%;
        z-index: 9999;
        padding: 30px;
        justify-content: center;
    }

    /* Forzar flex cuando está visible (jQuery añade display:block inline) */
    #bookForm .bookMiddle .fieldBox .field .guests-popups[style*="display: block"] {
        display: flex !important;
        flex-direction: column;
        align-items: center;
    }

    .guests-popups .roomsbox {
        flex: 1;
        max-height: 520px;
        overflow-y: auto;
    }

    .guests-popups .action-buttons-container {
        margin-top: auto;
        flex-shrink: 0;
        width: 100%;
    }
}
