/* ==========================================
   FIX FOOTER - Corrección para el footer
   ========================================== */

/* Asegurar que el contenido ocupa al menos toda la altura de la pantalla */
.site-content {
    min-height: calc(100vh - 450px);
    display: flex;
    flex-direction: column;
}

/* Asegurar que el wrapper principal ocupe el espacio disponible */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Corrección para el sidebar en fichas */
.sidebar-one {
    position: relative;
    z-index: 1;
}

/* Asegurar que el footer siempre esté al final y visible */
.site-footer {
    position: relative;
    z-index: 2;
    margin-top: auto;
    clear: both;
}

/* Evitar que el contenido del sidebar extienda demasiado la página */
.sidebar .widget {
    margin-bottom: 30px;
    max-height: none;
    overflow: visible;
}

/* Corrección para el área de opiniones - LIMITAR ALTURA */
.listing-reviews-area {
    max-height: none;
    overflow: visible;
}

/* Limitar altura de la lista de comentarios con scroll */
.comment-list {
    max-height: 1500px;
    overflow-y: auto;
    padding-right: 15px;
    margin-bottom: 20px;
}

/* Scrollbar personalizada para opiniones */
.comment-list::-webkit-scrollbar {
    width: 10px;
}

.comment-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.comment-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #0099ff, #0077cc);
    border-radius: 5px;
}

.comment-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0077cc, #005599);
}

/* Asegurar que el contenedor principal no tenga height fijo */
.ptb-100 {
    padding-top: 100px;
    padding-bottom: 100px;
    min-height: auto !important;
}

/* Corrección para el contenedor de la ficha */
.single-listing-todo {
    overflow: visible;
}

/* Footer widgets area - asegurar padding correcto */
.footer-widget-area {
    padding-top: 80px;
    padding-bottom: 40px;
    position: relative;
    background: #f8f9fa;
    clear: both;
}

/* Footer bottom - asegurar que se vea completo */
.footer-bottom-area {
    padding: 25px 0;
    background: #2c3e50;
    color: #fff;
    position: relative;
    z-index: 10;
    clear: both;
}

/* Evitar solapamientos con contenido absolute */
body {
    position: relative;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

/* Corrección para imágenes que podrían extender la página */
img {
    max-width: 100%;
    height: auto;
}

/* Corrección para el contenedor de comentarios */
.comment-list li {
    margin-bottom: 20px;
    position: relative;
}

/* Asegurar que el avatar no afecte el layout */
.comment-author .avatar {
    max-width: 60px;
    height: auto;
}

/* Corrección para el contenedor principal en páginas de ficha */
.listing-todo-thumbnail-area {
    position: relative;
    z-index: 1;
}

/* Asegurar clear antes del footer */
.site-content>.container:last-child::after {
    content: "";
    display: table;
    clear: both;
}

/* Responsive */
@media (max-width: 991px) {
    .site-content {
        min-height: auto;
    }

    .comment-list {
        max-height: 1000px;
        overflow-y: auto;
        padding-right: 10px;
    }

    .footer-widget-area {
        padding-top: 50px;
        padding-bottom: 30px;
    }
}

@media (max-width: 767px) {
    .comment-list {
        max-height: 800px;
    }

    .ptb-100 {
        padding-top: 60px;
        padding-bottom: 60px;
    }
}

/* Evitar que scripts pendientes afecten el layout */
script {
    display: none;
}

/* Asegurar que el row principal cierre correctamente */
.row::after {
    content: "";
    display: table;
    clear: both;
}

/* ==========================================
   FIX MENU FICHA - Corrección menú inferior
   ========================================== */

/* --- Desktop: menú en la parte inferior del hero --- */
.listing-todo-feature {
    display: flex !important;
    z-index: 20;
    bottom: 0;
    position: absolute;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3));
}

.listing-todo-feature .listing-todo-feature-list {
    width: 100%;
    justify-content: center;
    display: flex;
    flex-wrap: nowrap;
}

/* Contenedor del hero: NO usar overflow:hidden que recorta el menú */
.listing-todo-thumbnail-area {
    position: relative;
    overflow: visible;
}

/* --- Móvil: menú fijo en la parte inferior de la pantalla --- */
@media only screen and (max-width: 991px) {

    /* Reducir altura del hero para móviles */
    .listing-todo-thumbnail-area,
    .listing-todo-thumbnail-area .todo-thumb {
        max-height: 60vh;
        min-height: 350px !important;
    }

    .listing-todo-header {
        padding-bottom: 70px;
    }
}

@media only screen and (max-width: 767px) {

    /* Fijar el menú en la parte inferior de la pantalla */
    .listing-todo-feature {
        position: absolute !important; /* Cambiado de fixed a absolute */
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 20 !important; /* Reducido de 9999 a 20 */
        background-color: rgba(0, 0, 0, 0.88);
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
        height: auto !important;
        padding: 0;
        margin: 0;
    }

    /* Espacio para que el footer no quede oculto debajo del menú fijo.
       Solo páginas con .listing-todo-feature tendrán este menú visible. */
    .site-footer {
        padding-bottom: 65px;
    }

    .listing-todo-feature .listing-todo-feature-list {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-around;
        align-items: center;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .listing-todo-feature .listing-todo-feature-list .single-list {
        padding: 10px 5px;
        font-size: 12px;
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-right: none;
        color: #fff;
        text-decoration: none;
    }

    .listing-todo-feature .listing-todo-feature-list .single-list span[class^="icon-"] {
        font-size: 20px;
        margin-right: 0;
        margin-bottom: 4px;
    }

    .listing-todo-feature .listing-todo-feature-list .single-list .text {
        font-size: 11px;
        white-space: nowrap;
    }

    /* Reducir hero aún más en móviles pequeños */
    .listing-todo-thumbnail-area,
    .listing-todo-thumbnail-area .todo-thumb {
        max-height: 55vh;
        min-height: 300px !important;
    }

    .listing-todo-header {
        padding-bottom: 20px;
    }
}

/* ==========================================
   FORCE REMOVE STICKY BEHAVIOR FROM WIDGETS
   ========================================== */
aside.widget,
.widget.bt-business-info-widget,
.sidebar-one aside,
.sidebar-two aside,
.sidebar-one,
.sidebar-two,
.theiaStickySidebar,
div[class*="sidebar"],
div[style*="position: sticky"],
div[style*="position: fixed"] {
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important; /* Reset any transform used by JS sticky libs */
}
