@import url('https://fonts.googleapis.com/css2?family=Carter+One&display=swap');

/* ==================================== */
/* ESTILOS DE GALERiA Y MODAL */
/* ==================================== */

.gallery__img {
    object-fit: cover;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.5s;
}
.gallery__img:hover {
    transform: scale(1.02);
}
.gallery__img--big {
    height: 400px;
}
.gallery__img--small {
    height: 200px;
}
.modal {
    width: 100%;
    min-height: 100vh;
    background: rgba(0,0,0,0.9);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000000;
    display: none;
}
.modal__content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
.modal__img {
    width: 60%;
}
.modal__boton {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    width: 50px;
    height: 50px;
    line-height: 50px;
    background: #DE423A;
    font-size: 2.5em;
    text-align: center;
    border-radius: 50%;
    font-family: monospace;
}
.modal--open {
    display: block;
}
.txt-nosotros {
    font-size: 1.8em;
    color: #FF0000;
    padding: 10px;
    font-family: 'Pacifico', cursive;
    font-weight: 100; 
}


/* ================================================== */
/* ESTILOS UNIDADES 2026 (BUSQUEDA Y FILTROS) */
/* ================================================== */

.search-results-content {
    display: grid;
    grid-template-columns: 300px 1fr; 
    gap: 20px;
    max-width: 1500px; 
    margin: 20px auto; 
    padding: 0 15px;
}

.search-ordering-bar {
    grid-column: 1 / -1;
    background: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* ESTILO ETIQUETA ORDENAR POR (CORREGIDO) */
.search-ordering-bar label[for="search-ordering"] {
    font-size: 16px;
    color: #495057;
    font-weight: bold;
    margin-right: 15px; 
    padding: 0;
}

.search-filters-sidebar {
    grid-column: 1 / 2;
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.results-area-container {
    grid-column: 2 / 3; 
    padding: 0;
}

.mobile-filters-toggle {
    display: none;
    width: 100%;
    padding: 15px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    color: #12437c;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    transition: background 0.3s ease;
}

/* ---------------------------------- */
/* ESTILOS DE FILTROS */
/* ---------------------------------- */

.filter-group {
    margin-bottom: 0;
    border-bottom: 1px solid #e9ecef;
}

.filters-title {
    font-size: 20px;
    color: #FF0000;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.filter-label.collapsible {
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 16px;
    color: #495057;
    font-weight: bold; 
    margin: 0;
    padding: 12px 8px;
    background: none;
    border: none;
    transition: color 0.2s ease;
    user-select: none;
    position: relative;
}

.filter-icon {
    font-size: 14px;
    font-weight: normal;
    transition: transform 0.3s ease; 
    color: #12437c;
    position: absolute;
    right: 8px;
    display: inline-block; 
}

.filter-group.collapsed .filter-icon {
    transform: rotate(0deg); 
}

.filter-group:not(.collapsed) .filter-icon {
    transform: rotate(90deg);
}

.filter-options {
    padding-left: 8px;
    padding-right: 8px;
    padding-bottom: 10px;
    flex-direction: column;
    gap: 8px;
}

.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 0;
}
.filter-checkbox-input {
    margin: 0;
}
.filter-checkbox-text {
    font-size: 14px;
    color: #495057;
}
.filters-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #FF0000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.apply-filters-btn, .clear-filters-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s ease;
}
.apply-filters-btn {
    background: #FF0000; 
    color: white; 
    border: none; 
}
.apply-filters-btn:hover {
    background: #cc0000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.clear-filters-btn {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e9ecef;
    text-decoration: none; 
}
.clear-filters-btn:hover {
    background: #e9ecef; 
    color: #495057;
}
.filter-min-max {
}
.min-max-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}
.filter-min-max {
    margin-top: 5px;
}
.min-max-inputs {
    display: flex;
    align-items: center;
    gap: 8px; 
}

.filter-min-input, 
.filter-max-input {
    flex-grow: 1;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
    text-align: center; 
    -webkit-appearance: none;
    margin: 0;
    -moz-appearance: textfield;
}

.min-max-separator {
    font-weight: bold;
    color: #6c757d;
    font-size: 16px;
}

.min-max-separator {
    font-weight: bold;
    color: #6c757d;
    font-size: 16px;
}

/* ==================================== */
/* ESTILOS DE LISTING CARD (FINAL CORREGIDO) */
/* ==================================== */

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 260px)); 
    gap: 20px;
    justify-content: start; 
}

.listing-card-new {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; 
    position: relative; 
}

.listing-card-new:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.listing-image-container {
    position: relative;
    height: 188px;
    width: 100%;
    overflow: hidden;
    flex-shrink: 0;
}

.listing-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.listing-card-new:hover .listing-image {
    transform: scale(1.1);
}

.listing-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
}

.listing-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333; 
    
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    margin-bottom: 5px; 
}

.listing-price {
    font-size: 20px; 
    font-weight: bold;
    color: #0000FF;
    text-align: center; 
    margin-bottom: 10px;
    padding-top: 5px;
}

.listing-info-wrapper {
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
    padding: 8px; 
    flex-grow: 1;
}

.listing-technical-attributes { 
    display: flex;
    gap: 12px;
    margin-bottom: 4px;
    flex-wrap: wrap;
    justify-content: flex-start;
}
.attribute-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 15px; 
    color: #6c757d; 
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;    
    text-overflow: ellipsis; 
}

.attribute-item i {
    color: #12437c; 
    font-size: 14px;
}

.category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 0, 0, 0.8) !important; 
    opacity: 0.8; 
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 5;
    text-transform: uppercase;
}


/* ---------------------------------- */
/* BOTÓN VER DETALLES */
/* ---------------------------------- */

.listing-details-btn {
     margin-bottom: 8px;
     text-align: center;
}

.details-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FF0000 !important; 
    color: white !important; 
    padding: 6px 35px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.details-btn:hover {
    background: #0f3a6b !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(18, 67, 124, 0.3);
}

.listing-action-buttons {
    width: auto; 
    display: flex; 
    justify-content: flex-end; 
    align-items: center; 
    padding: 0; 
    margin: 0;
    border-top: none; 
    position: absolute; 
    top: 10px; 
    right: 10px; 
    z-index: 100; 
    gap: 10px; 
}

.listing-share-btn, .listing-favorite-btn {
    pointer-events: auto;
    position: static; 
    float: none;
    margin: 0; 
}

.listing-share-btn .share-btn, 
.listing-favorite-btn .favorite-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #6c757d;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: static; 
}

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

@media (max-width: 992px) {
    .search-results-content {
        display: block; 
        gap: 0;
        padding: 0 15px; 
    }
    
    .search-ordering-bar {
        width: 100%;
        margin-bottom: 15px;
    }

    .search-filters-sidebar {
        width: 100%;
        display: none; 
        margin-bottom: 20px;
    }
    
    .mobile-filters-toggle {
        display: flex; 
    }

    .listings-grid {
        grid-template-columns: 1fr; 
        width: 100%;
        margin-top: 0;
    }
    
    .results-area-container {
        grid-column: auto;
        padding: 0;
        width: 100%;
    }
    
    .listing-image-container {
        height: 220px; 
    }
}