/* Estilos para la nueva página de visualización de inmueble */
body {
    background-color: #ffffff;
}

.inmueble-header {
    margin-bottom: 1.5rem;
}

.inmueble-title {
    font-size: 2rem;
    font-weight: 600;
}

.inmueble-location {
    font-size: 1.1rem;
    color: #717171;
}

/*------------------------------------*\ 
    #IMAGE GALLERY GRID
\*------------------------------------*/
.image-gallery-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 250px 250px; /* Aumentada la altura de las filas para más altura total */
    gap: 8px;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item {
    width: 100%;
    height: 100%; /* La altura del item se ajusta al 100% de la fila del grid */
    overflow: hidden;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}



/* Lighting effect overlay */
.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0);
    transition: background-color 0.3s ease;
    z-index: 1; /* Ensure it's on top of the image */
}

.gallery-item:hover::before {
    background-color: rgba(255, 255, 255, 0.15); /* Subtle white overlay */
}

.gallery-item:first-child {
    grid-row: 1 / span 2;
    grid-column: 1 / span 1;
    border-top-right-radius: 0 !important; /* Sin borde redondeado superior derecho */
    border-bottom-right-radius: 0 !important; /* Sin borde redondeado inferior derecho */
}

.gallery-item:nth-child(2) {
    grid-column: 2 / span 1;
}

.gallery-item:nth-child(3) {
    grid-column: 3 / span 1;
}

.gallery-item:nth-child(4) {
    grid-column: 2 / span 1;
}

.gallery-item:nth-child(5) {
    grid-column: 3 / span 1;
}

.gallery-container {
    position: relative;
    margin-bottom: 1rem;
}

#show-all-photos-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 10;
    border: 1px solid #222;
    background-color: #fff;
    color: #222;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.18);
    cursor: pointer;
    border-radius: 8px;
    padding: 6px 12px;
}

#show-all-photos-btn:hover {
    background-color: #f7f7f7;
}

@media (max-width: 768px) {
    #show-all-photos-btn {
        bottom: 12px;
        right: 12px;
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}

/* Responsive gallery - Grid is now hidden on mobile */
@media (max-width: 767.98px) {
    .image-gallery-grid {
        display: none;
    }
}

/* Styles for the new mobile slider */
.swiper-container-mobile {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.swiper-container-mobile .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swiper-container-mobile .swiper-pagination {
    bottom: 35px !important;
    right: 10px !important;
    left: auto !important;
    width: auto !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    padding: 5px 10px !important;
    border-radius: 16px !important;
    font-size: 0.85rem !important;
    z-index: 21 !important;
}



/* Styles for the content sheet that overlaps the gallery */
.content-sheet {
    background-color: #fff;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    margin-top: -24px;
    position: relative;
    padding-top: 1.5rem; /* Added vertical padding */
    padding-bottom: 1.5rem; /* Added vertical padding */
}

/*------------------------------------*\ 
    #INMUEBLE CONTENT
\*------------------------------------*/
.inmueble-content-col {
    padding-right: 0;
}

.inmueble-section {
    padding: 1.5rem 0;
    border-bottom: 1px solid #ddd;
}
.inmueble-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.inmueble-specs span {
    margin-right: 1.5rem;
}

.amenities-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Default for larger screens */
    gap: 1rem;
}
@media (max-width: 767.98px) {
    .amenities-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
    }
    .inmueble-specs {
        flex-wrap: wrap; /* Ensure items wrap */
        justify-content: flex-start; /* Align to start on mobile */
    }
    .inmueble-specs span {
        white-space: normal; /* Allow text to wrap */
        margin-right: 0.5rem; /* Reduce margin between items */
        margin-bottom: 0.5rem; /* Add vertical spacing */
    }
}

.amenity-item {
    display: flex;
    align-items: center;
    font-size: 1rem;
    background-color: transparent; /* Override grey background */
    padding: 0; /* Override padding */
    border-radius: 0; /* Override border-radius */
    color: #333; /* Ensure consistent text color */
    margin-bottom: 0.5rem; /* Add some space between items */
}

.amenity-item i {
    font-size: 1.2rem;
    width: 30px;
    margin-right: 10px;
    color: #333;
}


/*------------------------------------*\ 
    #BOOKING WIDGET
\*------------------------------------*/
.sticky-booking-wrapper {
    position: -webkit-sticky;
    position: sticky;
    top: 20px; /* Adjust as needed */
    z-index: 10;
}

.booking-widget {
    /* Removed sticky properties */
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.booking-price {
    font-size: 1.5rem;
    font-weight: 600;
}
.booking-price span {
    font-size: 1rem;
    font-weight: 400;
    color: #717171;
}

#total-price-nights-info {
    color: #222; /* Ensure the "por X noches" part is black */
}

/* Explicitly style the underlined price to override generic span styles */
#desktop-dynamic-summary .precio-subrayado {
    font-size: 1.25rem; /* Match fs-5 */
    font-weight: 700;   /* Match fw-bold */
    color: #222;       /* Explicit black color */
    text-decoration: underline;
}

.date-picker-container {
    border: 1px solid #ccc;
    border-radius: 8px;
    display: flex;
    margin: 1rem 0;
}

.date-input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
}

.date-input:first-child {
    border-right: 1px solid #ccc;
}

.guest-selector {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.reserve-button {
    width: 100%;
    padding: 0.8rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(to right, #E61E4D 0%, #D70466 50%, #C13584 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.price-breakdown {
    margin-top: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1rem;
}

.price-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: #333;
}

.price-total {
    font-weight: bold;
    border-top: 1px solid #ddd;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.date-and-guests-inputs {
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
}

.date-inputs {
    display: flex;
}

.date-input-wrapper {
    flex: 1;
    position: relative;
}

.date-input-wrapper:first-child {
    border-right: 1px solid #ccc;
}

.input-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 0.75rem 0;
    display: block;
}

.date-input-wrapper .form-control,
.guest-input-wrapper .form-select {
    border: none;
    padding-top: 0.25rem;
    padding-left: 0.75rem;
    font-size: 0.9rem;
}

.guest-input-wrapper {
    border-top: 1px solid #ccc;
}

.review-summary-widget {
    font-size: 0.9rem;
}

.review-summary-widget .fa-star {
    color: #ff385c;
}


/*------------------------------------*\ 
    #REVIEW SECTION
\*------------------------------------*/
.star-rating {
    font-size: 1.2rem;
    color: #FFD700; /* Gold color for stars */
    cursor: pointer;
}

.star-rating .far.fa-star,
.star-rating .fas.fa-star {
    transition: color 0.2s ease-in-out;
}

.star-rating .far.fa-star:hover,
.star-rating .far.fa-star:hover ~ .far.fa-star,
.star-rating .fas.fa-star {
    color: #FFD700;
}

.star-rating-display {
    font-size: 1.1rem;
    color: #FFD700;
}

.comment-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.comment-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.comment-author {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.comment-date {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 0.5rem;
}

.comment-text {
    line-height: 1.6;
}

.review-summary-stars {
    font-size: 1.2rem;
    color: #FFD700;
    margin-right: 0.5rem;
}

.review-summary-text {
    font-size: 1rem;
    color: #555;
}

@media (max-width: 767.98px) {
    #mobile-calendar-inline {
        display: flex !important;
        justify-content: center;
        min-height: 300px; /* Give it some space to exist */
    }

    /* Prevent unwanted horizontal scroll on mobile */
    body {
        overflow-x: hidden;
    }

    @media (max-width: 767.98px) {
        #mobile-calendar-inline {
            margin-left: -22px; /* Counteract parent padding to leave 10px margin */
            margin-right: -22px; /* Counteract parent padding to leave 10px margin */
        }
    }

    /* Regla para reducir el margin-top de la sección de Normas de la Casa en móvil */
    .inmueble-section.mt-4 {
        margin-top: 0.5rem !important; /* Reducido aún más */
    }
    .inmueble-section {
        padding-bottom: 0.5rem !important;
    }
}




/* Specific padding adjustment for description section */
.less-bottom-padding {
    padding-bottom: 0.5rem;
}

/*------------------------------------*\ 
    #SPECIAL OFFER POPUP
\*------------------------------------*/
.special-offer-popup {
    /* Mantener propiedades visuales, pero controlar display y opacidad con clases */
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    background-color: #ffffff;
    color: #222222;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: bold;
    font-size: 1.1rem;
    width: 100%;
    white-space: normal;
    margin-bottom: 1rem;

    /* Propiedades de transición base */
    transition: opacity 1s ease-out; /* La transición siempre estará definida */
    opacity: 0; /* Por defecto invisible */
    pointer-events: none; /* No interactivo por defecto */
}

.special-offer-popup.show-special-offer {
    /* Solo la animación de entrada */
    animation: bounceIn 0.8s ease-out forwards; 
}

.special-offer-popup.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Clase para ocultar completamente */
.is-hidden {
    display: none !important; /* Usar !important para asegurar que se aplique */
}

.special-offer-popup .fa-tag,
.special-offer-popup .fa-star {
    color: #E61E4D; /* Icono de etiqueta rojo */
    margin-right: 10px; /* Space between icon and text */
    font-size: 1.2em; /* Make icon a bit bigger */
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}



.original-price-strikethrough {
    text-decoration: line-through;
}

/* --- Mobile-specific Floating Offer Popup (Safe Animation) --- */
@media (max-width: 767.98px) {
    .special-offer-popup {
        display: none !important;
    }

    .special-offer-popup.show-special-offer {
        /* Apply the new, safer animation */
        animation: slideUpFadeIn 0.5s ease-out forwards;
    }

    /* A safer animation that avoids 'scale' to prevent rendering bugs */
    @keyframes slideUpFadeIn {
        from {
            opacity: 0;
            transform: translate(-50%, 20px); /* Start centered and 20px lower */
        }
        to {
            opacity: 1;
            transform: translate(-50%, 0); /* End centered and at final position */
        }
    }
}
.special-offer-popup.fade-out {
    opacity: 0;
    transition: opacity 1s ease-out; /* 1 second fade out duration */
}

/* Modificaciones de bordes redondeados para la galería de imágenes */
.image-gallery-grid .gallery-item:first-child {
    border-top-right-radius: 0 !important; /* Sin borde redondeado superior derecho */
    border-bottom-right-radius: 0 !important; /* Sin borde redondeado inferior derecho */
}

.image-gallery-grid .gallery-item:nth-child(2),
.image-gallery-grid .gallery-item:nth-child(4) {
    border-radius: 0 !important; /* Sin bordes redondeados para las dos imágenes centrales */
}

.image-gallery-grid .gallery-item:nth-child(3),
.image-gallery-grid .gallery-item:nth-child(5) {
    border-top-left-radius: 0 !important; /* Esquinas izquierdas sin redondear para las dos imágenes de la derecha */
    border-bottom-left-radius: 0 !important;
}


/* --- Booking Loader Overlay --- */
#booking-loader-overlay {
    position: fixed; /* Covers the whole screen */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 2000; /* High z-index */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.booking-loader-content {
    text-align: center;
    padding: 0 20px;
}

.booking-loader-content p {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-top: 1.5rem;
}

.icon-container {
    font-size: 4rem;
    height: 64px;
    width: 64px;
    position: relative;
}

.letter-animation, .success-checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}

.letter-animation {
    animation: fly 2.5s ease-in-out infinite;
    opacity: 1;
}

.success-checkmark {
    color: #28a745;
    opacity: 0;
    transform: scale(0.5);
}

#booking-loader-overlay.complete .letter-animation {
    opacity: 0;
    animation: none; /* Stop the animation */
}

#booking-loader-overlay.complete .success-checkmark {
    opacity: 1;
    transform: scale(1);
    animation: check-scale 0.5s ease-out forwards;
}

@keyframes fly {
    0% {
        transform: translateX(-150px) rotate(-15deg);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translateX(150px) rotate(15deg);
        opacity: 0;
    }
}

@keyframes check-scale {
    0% { transform: scale(0.5); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Estilos para días bloqueados en Flatpickr */
.flatpickr-day.dia-bloqueado {
    background-color: #e0e0e0 !important; /* Un gris más oscuro para el fondo */
    border-color: #e0e0e0 !important;
    color: #888 !important; /* Texto del número en gris oscuro */
    cursor: not-allowed !important;
    font-weight: normal; /* Quitar negrita si la tiene */
    pointer-events: none; /* Desactivar eventos de clic */
    text-decoration: line-through; /* Tachar el número */
}

/* Opcional: Asegurarse de que el hover no cambie la apariencia */
.flatpickr-day.dia-bloqueado:hover {
    background-color: #e0e0e0 !important;
    border-color: #e0e0e0 !important;
    color: #888 !important;
}

/* Ajuste para el círculo gris que pediste originalmente. */
/* Puedes descomentar esto y comentar lo de arriba si prefieres el círculo. */
/*
.flatpickr-day.dia-bloqueado {
    border-radius: 50% !important;
    background: #cccccc !important;
    color: #ffffff !important;
    border: 1px solid #cccccc !important;
    pointer-events: none;
}
*/

/* Custom rule to remove border on desktop */
@media (min-width: 768px) {
    .no-desktop-border {
        border-bottom: none !important;
    }
}
