/* 
 * Estilos para el Buscador Portada de Aloja360 v3.3
 * Todos los estilos están encapsulados con el prefijo .a360-portada
 * para evitar conflictos con estilos globales del tema
 */

/* ===================== FUENTES Y RESET ===================== */
.a360-portada {
    font-family: "Nunito", "Open Sans", Arial, sans-serif;
    box-sizing: border-box;
}

.a360-portada *,
.a360-portada *::before,
.a360-portada *::after {
    box-sizing: border-box;
}

/* ===================== CONTENEDOR PRINCIPAL ===================== */
.a360-portada .buscador-wrapper {
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 60px;
    padding: 0;
}

/* ===================== CAJA BUSCADOR ===================== */
.a360-portada .buscador-container {
    background-color: white;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 1px 1px 3px 3px;
    margin: 0 auto;
    border-radius: 20px;
    max-width: 900px;
    box-shadow: 0 6px 15px rgba(0,0,0,.1);
    position: relative;
    border: 1px solid #ccc;
    z-index: 10;
}

/* ===================== CONTENEDOR DE FECHAS ===================== */
.a360-portada .fechas-container {
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 90px;
    padding: 0;
    border-radius: 10px;
    width: max-content;
    max-width: 100%;
    flex: 0 0 auto;
}

.a360-portada .fechas-wrapper {
    background-color: transparent; /* Eliminado color de depuración */
    margin-top: -20px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    margin-inline: auto;
}

/* ===================== ELEMENTOS DE FECHA INDIVIDUAL ===================== */
.a360-portada .buscador-item {
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 90px;
    max-width: 150px;
    padding: 15px 5px 5px 5px;
    border: 1px solid #ccc;
    border-radius: 12px;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

.a360-portada .buscador-item label {
    font-size: 18px;
    color: #444;
    font-weight: normal;
    margin-bottom: -5px;
    margin-top: -15px;
    text-align: center;
}

.a360-portada .buscador-item:hover {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0px 4px 12px rgba(40, 167, 69, 0.3);
    transform: scale(1.15);
}

.a360-portada .buscador-item input {
    border: none;
    background: none;
    text-align: center;
    font-size: 40px;
    font-weight: bold;
    color: black;
    padding: 1px;
    width: 100%;
}

.a360-portada .buscador-item span {
    font-size: 25px;
    color: black;
    font-weight: normal;
}

/* ===================== FECHAS CLICABLES ===================== */
.a360-portada .fecha-clickable {
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 0px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    margin-bottom: -2px;
}

.a360-portada .fecha-clickable:hover {
    background-color: rgba(0, 255, 0, 0.1);
}

.a360-portada .fecha-entrada,
.a360-portada .fecha-salida {
    font-size: 38px;
    font-weight: bold;
    text-transform: capitalize;
    margin-bottom: -12px;
    margin-top: -2px;
}

.a360-portada .fecha-entrada-dia,
.a360-portada .fecha-salida-dia {
    font-size: 22px;
    font-weight: normal;
    color: #666;
}

/* ===================== CONTENEDOR DE NOCHES ===================== */
.a360-portada .noches-container {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 8px 6px;
    border-radius: 12px;
    box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease-in-out;
    margin-bottom: 10px;
}

.a360-portada .noches-container label {
    text-align: center;
    display: block;
    width: 100%;
    padding-bottom: 4px;
}

.a360-portada .noches-container .noches-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.a360-portada .noches-container button {
    background-color: white;
    border: 1px solid #ccc;
    font-size: 20px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.4s ease;
    margin-bottom: -10px;
}

.a360-portada .noches-container button:hover {
    background-color: #e0e0e0;
}

.a360-portada .noches-container span {
    font-size: 30px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* ===================== CALENDARIO DESPLEGABLE ===================== */
.a360-portada .calendar > .days-grid > div:nth-child(6n+7),
.a360-portada .calendar > .days-grid > div:nth-child(6n+1) {
    font-weight: 700;
    color: blue;
}

/* ===================== CONTENEDOR DE HUÉSPEDES ===================== */
.a360-portada .huespedes-box {
    background-color: white;
    position: relative;
    border: 1px solid #ccc;
    border-radius: 12px;
    transition: background-color 0.2s ease;
    width: auto;
    min-width: 150px;
    padding: 18px 1px 13px 1px;
    text-align: center;
    cursor: pointer;
    margin-left: 0;
    transform: none;
}

.a360-portada .huespedes-box:hover {
    background-color: #f5f5f5;
}

.a360-portada .huespedes-box label {
    position: static;
    top: auto;
    margin-bottom: 0;
}

/* ===================== DROPDOWN DE HUÉSPEDES ===================== */
.a360-portada .huespedes-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translate(-50%, -10px);
    width: clamp(240px, 90vw, 340px);
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,.2);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity .3s ease, transform .3s ease;
}

.a360-portada .huespedes-dropdown.mostrar {
    display: block;
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ===================== ELEMENTOS DE HUÉSPEDES ===================== */
.a360-portada .huespedes-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 8px 12px 6px 12px;
    text-align: center;
}

.a360-portada .huespedes-item label {
    margin: 0;
    font-weight: 400;
    font-size: 22px;
    flex: 1;
    min-width: 70px;
}

.a360-portada .huespedes-item span {
    display: inline-block;
    min-width: 22px;
    text-align: center;
    font-size: 22px;
    margin: 0 6px;
}

.a360-portada .huespedes-item button {
    width: 34px;
    height: 36px;
    border: 2px solid #4CAF50;
    color: #4CAF50;
    border-radius: 50%;
    background: white;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, color .2s, transform .1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.a360-portada .huespedes-item button:focus,
.a360-portada .confirmar-huespedes:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

.a360-portada .huespedes-item button:hover {
    background: #4CAF50;
    color: white;
}

.a360-portada .huespedes-item button:active {
    transform: scale(0.9);
}

/* ===================== BOTÓN CONFIRMAR HUÉSPEDES ===================== */
.a360-portada .confirmar-huespedes {
    display: block;
    width: calc(100% - 28px);
    margin: 10px 14px 14px;
    padding: 8px;
    border: none;
    background: #8bc34a;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 20px;
    text-align: center;
    transition: all 0.3s ease-in-out;
}

.a360-portada .confirmar-huespedes:hover {
    background: #008e00;
    transform: scale(1.08);
}

/* ===================== BOTÓN BUSCAR ===================== */
.a360-portada .boton-buscar {
    background-color: #28a745;
    color: white;
    font-size: 38px;
    font-weight: normal;
    padding: 14px 38px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease-in-out;
}

.a360-portada .boton-buscar:hover {
    background-color: #1e7e34;
    transform: scale(1.17);
}

.a360-portada .boton-buscar i {
    font-size: 24px;
}

/* ===================== CONTENEDOR DE CÓDIGO PROMOCIONAL ===================== */
.a360-portada .codigo-container {
    position: absolute;
    align-self: center;
    width: 200px;
    background: rgba(255, 215, 0, 0.95);
    padding: 3px 10px 5px 10px;
    border-radius: 12px;
    opacity: .5;
    z-index: 5;
    transform: translateX(350px);
    transition: transform 0.3s ease, opacity 0.5s ease;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.a360-portada .codigo-container label {
    font-size: 20px;
    font-weight: normal;
    color: #333;
    margin-bottom: 2px;
}

.a360-portada .codigo-container input {
    width: 80%;
    padding: 8px;
    font-size: 20px;
    text-align: center;
    border: 1px solid #bbb;
    border-radius: 8px;
    background: white;
    transition: box-shadow 0.3s ease;
}

.a360-portada .codigo-container input:focus {
    border-color: #28a745;
    box-shadow: 0px 4px 8px rgba(40, 167, 69, 0.3);
    outline: none;
}

/* ===================== AVISOS ===================== */
.a360-portada .avisos-container {
    width: 100%;
    margin-bottom: 10px;
}

.a360-portada .aviso {
    border-radius: 4px;
    padding: 12px 16px;
    margin: 8px 0;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: slideDown 0.3s ease-out;
}

.a360-portada .aviso-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.a360-portada .aviso-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ===================== RESPONSIVE DESIGN ===================== */

/* Solo desktop / dispositivos con hover real */
@media (min-width: 481px) and (hover: hover) {
    .a360-portada .codigo-container:hover,
    .a360-portada .codigo-container:focus-within {
        transform: translateX(370px);
        opacity: 1;
        z-index: 15;
    }
}

/* ===================== DESKTOP/TABLET LAYOUT (≥ 768px) ===================== */
@media screen and (min-width: 768px) {
    /* Contenedor principal - una sola fila */
    .a360-portada .buscador-container {
        display: flex;
        flex-wrap: nowrap; /* Una sola fila */
        justify-content: space-between;
        align-items: center;
        gap: 16px; /* Gaps más pequeños */
        padding: 15px 20px;
        margin: 0 auto;
        width: 100%; /* Ocupa 100% del ancho disponible */
        max-width: none; /* Sin límite máximo */
        min-width: 0; /* Permite compresión */
    }

    /* Contenedor de fechas - más compacto */
    .a360-portada .fechas-container {
        gap: 20px; /* Gap reducido */
        flex: 0 0 auto;
        min-width: 0;
    }

    /* Elementos de fecha - más compactos */
    .a360-portada .buscador-item {
        min-width: 80px; /* Reducido */
        max-width: 120px; /* Reducido */
        padding: 12px 8px 8px 8px;
        flex: 0 0 auto;
    }

    .a360-portada .buscador-item label {
        font-size: 16px; /* Reducido */
        margin-bottom: -3px;
        margin-top: -12px;
    }

    .a360-portada .fecha-entrada,
    .a360-portada .fecha-salida {
        font-size: 32px; /* Reducido */
        margin-bottom: -8px;
        margin-top: -1px;
    }

    .a360-portada .fecha-entrada-dia,
    .a360-portada .fecha-salida-dia {
        font-size: 18px; /* Reducido */
    }

    /* Contenedor de noches - más compacto */
    .a360-portada .noches-container {
        padding: 6px 8px;
        top: -25px;
    }

    .a360-portada .noches-container label {
        font-size: 14px; /* Reducido */
    }

    .a360-portada .noches-container span {
        font-size: 26px; /* Reducido */
    }

    .a360-portada .noches-container button {
        width: 26px; /* Reducido */
        height: 26px; /* Reducido */
        font-size: 18px; /* Reducido */
    }

    /* Contenedor de huéspedes - más compacto */
    .a360-portada .huespedes-box {
        min-width: 120px; /* Reducido */
        padding: 15px 8px 10px 8px;
        flex: 0 0 auto;
    }

    .a360-portada .huespedes-box .huespedes-text {
        font-size: 16px; /* Reducido */
    }

    /* Botón buscar - más compacto */
    .a360-portada .boton-buscar {
        font-size: 32px; /* Reducido */
        padding: 12px 24px; /* Reducido */
        flex: 0 0 auto;
        white-space: nowrap; /* Evita que se rompa */
    }

    .a360-portada .boton-buscar i {
        font-size: 20px; /* Reducido */
    }

    /* Código promocional - más compacto */
    .a360-portada .codigo-container {
        width: 160px; /* Reducido */
        padding: 2px 8px 4px 8px;
        transform: translateX(280px); /* Ajustado */
    }

    .a360-portada .codigo-container label {
        font-size: 16px; /* Reducido */
    }

    .a360-portada .codigo-container input {
        font-size: 16px; /* Reducido */
        padding: 6px;
    }

    /* Hover del código promocional */
    .a360-portada .codigo-container:hover,
    .a360-portada .codigo-container:focus-within {
        transform: translateX(300px); /* Ajustado */
    }

    /* Avisos - más compactos */
    .a360-portada .aviso {
        font-size: 13px; /* Reducido */
        padding: 10px 14px; /* Reducido */
    }
}

/* ===================== DESKTOP LARGE (≥ 1024px) ===================== */
@media screen and (min-width: 1024px) {
    .a360-portada .buscador-container {
        gap: 20px; /* Gap ligeramente mayor en pantallas grandes */
    }

    .a360-portada .fechas-container {
        gap: 24px; /* Gap ligeramente mayor */
    }

    .a360-portada .buscador-item {
        min-width: 90px; /* Ligeramente mayor */
        max-width: 130px; /* Ligeramente mayor */
    }

    .a360-portada .buscador-item label {
        font-size: 17px; /* Ligeramente mayor */
    }

    .a360-portada .fecha-entrada,
    .a360-portada .fecha-salida {
        font-size: 34px; /* Ligeramente mayor */
    }

    .a360-portada .fecha-entrada-dia,
    .a360-portada .fecha-salida-dia {
        font-size: 19px; /* Ligeramente mayor */
    }

    .a360-portada .huespedes-box {
        min-width: 130px; /* Ligeramente mayor */
    }

    .a360-portada .boton-buscar {
        font-size: 34px; /* Ligeramente mayor */
        padding: 13px 26px; /* Ligeramente mayor */
    }
}

/* ===================== MÓVIL (≤ 767px) - SIN CAMBIOS ===================== */
@media screen and (max-width: 767px) {
    /* El móvil se mantiene exactamente igual que antes */
    .a360-portada .buscador-wrapper {
        position: relative;
        min-height: 250px;
        padding-bottom: 10px;
    }

    .a360-portada .buscador-container {
        width: 100vw;
        max-width: 100%;
        padding: 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        box-sizing: border-box;
        min-height: 150px;
    }

    .a360-portada .codigo-container {
        position: absolute;
        left: 50%;
        bottom: 5px;
        transform: translateX(-50%);
        z-index: 5;
        width: 60%;
        opacity: 1;
        overflow: hidden;
        cursor: pointer;
        max-height: 74px;
    }

    .a360-portada .codigo-container.abierto {
        bottom: 8px;
        max-height: 240px;
        z-index: 20;
    }

    .a360-portada .codigo-container:hover,
    .a360-portada .codigo-container:focus-within {
        transform: translateX(-50%) !important;
    }

    .a360-portada .fecha-entrada,
    .a360-portada .fecha-salida {
        font-size: 26px;
        margin-bottom: 4px;
    }

    .a360-portada .fecha-entrada-dia,
    .a360-portada .fecha-salida-dia {
        font-size: 16px;
    }

    .a360-portada .fechas-container {
        max-width: 260px;
        width: 100%;
    }

    .a360-portada .noches-container {
        max-width: 180px;
        width: auto;
        padding: 8px 12px;
    }

    .a360-portada .huespedes-box {
        width: 85% !important;
        max-width: 280px;
        text-align: center;
        min-height: 25px;
        padding: 12px 10px;
    }

    .a360-portada .boton-buscar {
        width: 90%;
        min-width: 250px;
        text-align: center;
        min-height: 45px;
        display: block;
        margin-top: -20px !important;
    }
}

/* ===================== CALENDARIO EASEPICK ===================== */
.a360-portada .fechas-wrapper .easepick-wrapper {
    position: absolute !important;
    top: calc(100% + 12px) !important;
    left: 0 !important;
    transform: none !important;
    z-index: 10000 !important; /* Z-index alto para evitar clipping */
    width: 680px;
    max-width: min(94vw, 680px);
}

.a360-portada .fechas-wrapper.cal-oculto .easepick-wrapper {
    display: none;
}

/* ===================== ESTADOS ESPECIALES ===================== */
.a360-portada .codigo-container.abierto {
    bottom: 8px;
    max-height: 240px;
    z-index: 20;
}

/* ===================== ACCESIBILIDAD ===================== */
.a360-portada [role="button"] {
    cursor: pointer;
}

.a360-portada [aria-expanded="true"] {
    /* Estilos para elementos expandidos */
}

.a360-portada [aria-expanded="false"] {
    /* Estilos para elementos colapsados */
}

/* ===================== UTILIDADES ===================== */
.a360-portada .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===================== ANIMACIONES ===================== */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* ===================== MODO COMPACTO ===================== */
/* Estilos para el modo compacto (ideal para sidebars) */
.a360-portada-compact .buscador-wrapper {
    margin-top: 0; /* Sin margen superior en modo compacto */
}

.a360-portada-compact .buscador-container {
    max-width: 100%; /* Ocupar todo el ancho disponible */
    gap: 15px; /* Reducir gaps para modo compacto */
    padding: 8px 12px; /* Padding más compacto */
    border-radius: 12px; /* Bordes menos redondeados */
    box-shadow: 0 2px 8px rgba(0,0,0,.08); /* Sombra más sutil */
}

.a360-portada-compact .fechas-container {
    gap: 8px; /* Reducir gap entre fechas */
}

.a360-portada-compact .buscador-item {
    min-width: 70px; /* Reducir min-width */
    max-width: 100px; /* Reducir max-width */
    padding: 8px 4px; /* Padding más compacto */
}

.a360-portada-compact .buscador-item label {
    font-size: 14px; /* Reducir tamaño de fuente */
    margin-bottom: 2px;
}

.a360-portada-compact .fecha-clickable span {
    font-size: 24px; /* Reducir tamaño de fuente */
}

.a360-portada-compact .noches-container {
    padding: 0;
    margin-bottom: 0;
}

.a360-portada-compact .noches-control {
    gap: 4px;
}

.a360-portada-compact .noches-control button {
    width: 22px;
    height: 22px;
    font-size: 16px;
}

.a360-portada-compact .noches-value {
    font-size: 20px;
}

.a360-portada-compact .huespedes-container {
    min-width: 100px; /* Reducir min-width */
    padding: 8px 12px; /* Padding más compacto */
}

.a360-portada-compact .huespedes-text {
    font-size: 14px; /* Reducir tamaño de fuente */
}

.a360-portada-compact .boton-buscar {
    padding: 10px 20px; /* Padding más compacto */
    font-size: 24px; /* Reducir tamaño de fuente */
}

.a360-portada-compact .codigo-container {
    max-width: 140px; /* Reducir ancho máximo */
    margin-top: 0;
    margin-left: 12px; /* Reducir margen izquierdo */
}

.a360-portada-compact .codigo-promo {
    font-size: 14px; /* Reducir tamaño de fuente */
    padding: 6px 8px; /* Padding más compacto */
}

/* Responsive para modo compacto */
@media screen and (max-width: 767px) {
    .a360-portada-compact .buscador-container {
        flex-direction: column; /* Apilar en móvil */
        gap: 12px;
    }
    
    .a360-portada-compact .fechas-wrapper {
        flex-direction: column;
        gap: 8px;
    }
    
    .a360-portada-compact .fechas-container {
        flex-direction: row;
        gap: 8px;
    }
}

/* ===================== FALLBACK DE CALENDARIO ===================== */
/* Estilos para inputs de texto cuando EasePick no carga */
.a360-portada .fecha-input-fallback {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background-color: white;
    transition: border-color 0.3s ease;
}

.a360-portada .fecha-input-fallback:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.a360-portada .fecha-input-fallback:invalid {
    border-color: #d63638;
}

.a360-portada .fecha-input-fallback::placeholder {
    color: #999;
    font-style: italic;
}

/* Responsive para fallback */
@media screen and (max-width: 767px) {
    .a360-portada .fecha-input-fallback {
        font-size: 16px; /* Evitar zoom en iOS */
    }
}