/*----------------------------------------------------------------*/
/* Estilos Generales del Plugin
/*----------------------------------------------------------------*/
.mxig-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    padding: 15px;
    box-sizing: border-box;
    color: #333;
    width: 72rem; /* Todos los shortcode con el mismo tamaño */
}

/*----------------------------------------------------------------*/
/* Filtros (Desplegables) en una Fila
/*----------------------------------------------------------------*/
.mxig-filter-wrapper.mxig-focused-filters {
    display: flex; /* CAMBIO: Usar Flexbox */
    flex-wrap: nowrap; /* CAMBIO: Forzar una sola línea */
    gap: 10px; /* Espacio entre grupos de filtros */
    align-items: center /*flex-end*/; /* Alinear items (label+select) y el botón de limpiar a la base */
    margin-bottom: 30px;
    padding: 15px; /* Un poco menos de padding vertical */
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow-x: auto; /* CAMBIO: Añadir scroll horizontal si los filtros no caben */
    padding-bottom: 15px; /* Espacio para la barra de scroll si aparece */
}

.mxig-filter-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0; /* Eliminado margen inferior ya que gap se encarga */
    flex: 0 0 auto; /* CAMBIO: No crecer, no encoger por defecto, base auto */
    min-width: 180px; /* CAMBIO: Ancho mínimo para cada grupo de filtros */
}

.mxig-filter-group label {
    margin-bottom: 8px;
    font-size: 0.85em; /* Un poco más pequeño para que quepa mejor */
    color: #495057;
    font-weight: 500;
    white-space: nowrap; /* Evitar que el label se parta */
}

.mxig-filter-select {
    padding: 9px 10px; /* Ajustado padding */
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #fff;
    font-size: 0.85em; /* Un poco más pequeño */
    line-height: 1.4;
    width: 100%; 
    box-sizing: border-box;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat; background-position: right 10px center; background-size: 10px; padding-right: 30px;
}
.mxig-filter-select:focus { border-color: #80bdff; outline: 0; box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25); }

.mxig-clear-filters-button {
    margin-top: 15px; /* Añado un margen superior para centrar el boton */
    padding: 9px 18px; /* Consistente con selects */
    cursor: pointer;
    background-color: #6c757d;
    color: white;
    border: 1px solid #5a6268;
    border-radius: 20px;
    font-size: 0.85em; /* Consistente con selects */
    transition: background-color 0.2s, border-color 0.2s;
    white-space: nowrap; /* Evitar que el texto del botón se parta */
    /* margin-top: auto; Ya no es necesario con align-items: flex-end */
    /* margin-left: 15px; Espacio si viene después de un filtro */
}
.mxig-clear-filters-button:hover { background-color: #5a6268; border-color: #545b62; }

/*----------------------------------------------------------------*/
/* Rejilla de Propiedades (Isotope Grid)
/* (Estilos sin cambios respecto a la versión anterior)
/*----------------------------------------------------------------*/
.mxig-grid { 
    margin-top: 20px; 
}
#mxig-no-results { display: none; text-align: center; padding: 30px 15px; color: #777; font-size: 1.1em; background-color: #f8f9fa; border: 1px dashed #ced4da; border-radius: 4px; }
.mxig-grid-item {
    width: calc(33.333% - 24px); margin: 12px; padding: 18px; border: 1px solid #dee2e6; border-radius: 6px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.06); background-color: #ffffff; box-sizing: border-box; overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.mxig-grid-item:hover { transform: translateY(-3px); box-shadow: 0 4px 10px rgba(0,0,0,0.09); }
.mxig-grid-item img { width: 100%; height: 180px; object-fit: cover; border-radius: 4px; margin-bottom: 12px; display: block; background-color: #f8f9fa; }
.mxig-item-content h3 { margin-top: 0; margin-bottom: 8px; font-size: 1.1rem; color: #343a40; line-height: 1.35; font-weight: 600; }
.mxig-item-content p { font-size: 0.875rem; line-height: 1.5; margin-bottom: 7px; color: #495057; }
.mxig-location { font-size: 0.85rem; color: #6c757d; margin-bottom: 5px; }
.mxig-price { font-weight: bold; font-size: 1.1rem; color: #198754; margin: 10px 0; }
.mxig-type { font-weight: 500; color: #0d6efd; margin-bottom: 8px; font-size: 0.9rem; }
.mxig-details-summary { font-size: 0.825rem; color: #55595c; line-height: 1.6; margin-bottom: 12px; }
.mxig-detail-item { margin-right: 12px; display: inline-block; white-space: nowrap; }
.mxig-detail-item i.fas { margin-right: 5px; color: #007bff; font-size:0.9em; }
.mxig-feature-tag-small { font-size: 0.8em; margin-left: 5px; color: #555; }
.mxig-feature-tag-small i.fas { margin-right: 3px; }
.mxig-detail-button { display: inline-block; margin-top: 12px; padding: 9px 18px; background-color: #007bff; color: white; text-decoration: none; border-radius: 4px; font-size: 0.9em; font-weight: 500; transition: background-color 0.2s; text-align: center; }
.mxig-detail-button:hover { background-color: #0056b3; color: white; }

/*----------------------------------------------------------------*/
/* Paginación
/* (Estilos sin cambios respecto a la versión anterior)
/*----------------------------------------------------------------*/
.mxig-pagination { text-align: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid #e9ecef; }
.mxig-pagination button, .mxig-pagination span { margin: 0 3px; padding: 8px 12px; border: 1px solid #ced4da; background-color: #fff; color: #007bff; cursor: pointer; border-radius: 4px; font-size: 0.9em; transition: background-color 0.2s, color 0.2s; }
.mxig-pagination button:hover { background-color: #e9ecef; border-color: #adb5bd; }
.mxig-pagination button.is-active { background-color: #007bff; color: #fff; border-color: #007bff; cursor: default; }
.mxig-pagination span { cursor: default; border: none; background-color: transparent; padding: 8px 0; }
.mxig-page-info { font-size: 0.9em; color: #6c757d; margin-bottom: 15px; }

/*----------------------------------------------------------------*/
/* Página de Detalle de Propiedad
/* (Estilos sin cambios respecto a la versión anterior)
/*----------------------------------------------------------------*/
.mxig-detail-container { max-width: 960px; margin: 30px auto; padding: 25px 30px; background-color: #ffffff; border: 1px solid #e9ecef; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.07); line-height: 1.65; }
.mxig-back-button { display: inline-block; margin-bottom: 25px; color: #007bff; text-decoration: none; font-size: 0.9em; padding: 8px 12px; border: 1px solid #007bff; border-radius: 4px; transition: background-color 0.2s, color 0.2s; }
.mxig-back-button:hover { background-color: #007bff; color: #fff; text-decoration: none; }
.mxig-back-button i.fas { margin-right: 5px; }
.mxig-detail-container h1 { font-size: 2.2em; color: #2c3e50; margin-top: 0; margin-bottom: 8px; border-bottom: 2px solid #f0f0f0; padding-bottom: 15px; font-weight: 600; line-height: 1.3; }
.mxig-detail-container h3 { font-size: 1.4em; color: #343a40; margin-top: 25px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #e9ecef; font-weight: 500; }
.mxig-detail-location { font-size: 1.05em; color: #555; margin-bottom: 25px; }
.mxig-detail-location i.fas { margin-right: 5px; color: #007bff; }
.mxig-detail-main-content { display: flex; flex-wrap: wrap; gap: 30px; margin-bottom: 30px; }
.mxig-detail-gallery { flex: 1 1 55%; min-width: 300px; }
.mxig-main-image img.mxig-enlargeable-image { cursor: zoom-in; }
.mxig-main-image img { width: 100%; max-height: 480px; object-fit: cover; border-radius: 6px; border: 1px solid #ddd; margin-bottom: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.mxig-thumbnails { display: flex; flex-wrap: wrap; gap: 10px; }
.mxig-thumbnails img { width: 90px; height: 70px; object-fit: cover; cursor: pointer; border: 2px solid #eee; border-radius: 4px; transition: border-color 0.2s, transform 0.2s; }
.mxig-thumbnails img:hover { border-color: #007bff; transform: scale(1.05); }
.mxig-thumbnails img.active { border-color: #0056b3; box-shadow: 0 0 8px rgba(0,123,255,0.5); }
.mxig-detail-info { flex: 1 1 40%; font-size: 0.95em; padding: 20px; background-color: #f8f9fa; border-radius: 6px; border: 1px solid #e9ecef; }
.mxig-detail-price { font-size: 1.8em; font-weight: 700; color: #28a745; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #e9ecef; }
.mxig-detail-price span { font-size: 0.7em; font-weight: 500; color: #555; margin-left: 5px; }
.mxig-detail-info ul { list-style: none; padding: 0; margin: 0 0 15px 0; }
.mxig-detail-info ul li { padding: 10px 0; border-bottom: 1px dotted #e0e0e0; color: #495057; display: flex; align-items: center; }
.mxig-detail-info ul li:last-child { border-bottom: none; }
.mxig-detail-info ul li i.fas { margin-right: 10px; color: #007bff; width: 20px; text-align: center; font-size: 1.1em; }
.mxig-detail-info p { margin-bottom: 10px; color: #495057; }
.mxig-detail-info p i.fas { margin-right: 8px; color: #007bff; }
.mxig-detail-info a { color: #007bff; text-decoration: none; }
.mxig-detail-info a:hover { text-decoration: underline; }
.mxig-map-container { height: 350px; width: 100%; margin-top: 20px; margin-bottom: 20px; border: 1px solid #ced4da; border-radius: 6px; overflow: hidden; }
.mxig-map-container iframe { border: 0; }
.mxig-detail-description { margin-top: 30px; padding-top: 20px; border-top: 2px solid #f0f0f0; line-height: 1.7; color: #343a40; }
.mxig-detail-description p { margin-bottom: 1em; }
.mxig-detail-ref { margin-top: 25px; font-size: 0.85em; color: #6c757d; text-align: right; padding-top: 15px; border-top: 1px dotted #eee; }
.mxig-image-count { font-size: 0.75rem; color: #6c757d; margin-top: 8px; }

/*----------------------------------------------------------------*/
/* Formulario de Contacto en Página de Detalle
/* (Estilos sin cambios respecto a la versión anterior)
/*----------------------------------------------------------------*/
.mxig-contact-form-section { margin-top: 35px; padding: 25px; background-color: #f0f2f5; border-radius: 8px; border: 1px solid #d9dbde; }
.mxig-contact-form-section h3 { font-size: 1.5em; color: #343a40; margin-bottom: 20px; text-align: left; border-bottom: none; padding-bottom: 0; }
.mxig-contact-form-section p { margin-bottom: 18px; }
.mxig-contact-form-section label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.9em; color: #444; }
.mxig-contact-form-section input[type="text"], .mxig-contact-form-section input[type="email"], .mxig-contact-form-section input[type="tel"], .mxig-contact-form-section textarea { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-size: 0.95em; transition: border-color 0.2s, box-shadow 0.2s; }
.mxig-contact-form-section input:focus, .mxig-contact-form-section textarea:focus { border-color: #007bff; box-shadow: 0 0 0 0.15rem rgba(0,123,255,.25); outline: none; }
.mxig-contact-form-section textarea { min-height: 120px; resize: vertical; }
.mxig-contact-form-section input[type="submit"] { background-color: #28a745; color: white; padding: 12px 25px; border: none; border-radius: 4px; cursor: pointer; font-size: 1em; font-weight: 500; transition: background-color 0.2s; }
.mxig-contact-form-section input[type="submit"]:hover { background-color: #218838; }
.mxig-required { color: #dc3545; margin-left: 3px; }
.mxig-form-feedback { padding: 15px 20px; margin-bottom: 20px; border-radius: 4px; font-size: 0.95em; border-width: 1px; border-style: solid; }
.mxig-form-feedback.success { background-color: #d1e7dd; color: #0f5132; border-color: #badbcc; }
.mxig-form-feedback.error { background-color: #f8d7da; color: #842029; border-color: #f5c2c7; }

/*----------------------------------------------------------------*/
/* Modal de Imagen
/* (Estilos sin cambios respecto a la versión anterior)
/*----------------------------------------------------------------*/
.mxig-enlargeable-image { cursor: zoom-in; }
.mxig-modal { display: none; position: fixed; z-index: 10000; padding-top: 60px; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.92); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.mxig-modal-content { margin: auto; display: block; width: auto; max-width: 90%; max-height: 80vh; animation-name: mxig-zoom; animation-duration: 0.3s; border-radius: 4px; box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
@keyframes mxig-zoom { from {transform:scale(0.5); opacity: 0;} to {transform:scale(1); opacity: 1;} }
#mxig-modal-caption { margin: 15px auto 0; display: block; width: 80%; max-width: 700px; text-align: center; color: #ccc; padding: 10px 0; font-size: 0.9em; height: auto; }
.mxig-modal-close { position: absolute; top: 20px; right: 35px; color: #f1f1f1; font-size: 45px; font-weight: bold; transition: 0.3s ease; line-height: 1; }
.mxig-modal-close:hover, .mxig-modal-close:focus { color: #bbb; text-decoration: none; cursor: pointer; }

/*----------------------------------------------------------------*/
/* Estilos Responsivos
/*----------------------------------------------------------------*/
@media (max-width: 1200px) { /* Laptops y tablets grandes */
    .mxig-filter-wrapper.mxig-focused-filters {
        /* Permitir que se envuelvan si no caben, en lugar de forzar una sola fila con scroll */
        flex-wrap: wrap; 
        overflow-x: hidden; /* No es necesario el scroll si se envuelven */
    }
     .mxig-filter-group {
        flex-basis: calc(33.33% - 10px); /* Intentar 3 grupos por fila, ajustando el gap */
        min-width: 160px; /* Reducir min-width para que quepan más */
    }
}

@media (max-width: 992px) { /* Tablets */
    .mxig-grid-item { width: calc(50% - 20px); }
    .mxig-detail-main-content { flex-direction: column; }
     .mxig-filter-group {
        flex-basis: calc(50% - 10px); /* Intentar 2 grupos por fila */
    }
}

@media (max-width: 767px) { /* Móviles */
    .mxig-grid-item { width: calc(100% - 20px); }
    .mxig-filter-wrapper.mxig-focused-filters {
        padding: 10px;
        gap: 10px;
    }
    .mxig-filter-group {
        flex-basis: 100%; /* Un grupo por fila */
        min-width: unset;
    }
    .mxig-filter-select { font-size: 0.95em; } /* Un poco más grande para móviles */
    .mxig-clear-filters-button { width: 100%; text-align: center; margin-left: 0; }

    .mxig-detail-container { padding: 20px 15px; }
    .mxig-detail-container h1 { font-size: 1.8em; }
    .mxig-detail-price { font-size: 1.5em; }
    .mxig-thumbnails img { width: 70px; height: 55px; }
    .mxig-modal-content { max-width: 95%; max-height: 75vh; }
    .mxig-modal-close { font-size: 35px; top: 15px; right: 25px; }
}