/* ==========================================================================
   MARÍA PROPIEDADES - ESTILOS
   ========================================================================== */

/* Filtros de Propiedades
   ========================================================================== */
.mp-filtro-propiedades {
    background: transparent;
    padding: 0;
    margin-bottom: 40px;
}

.mp-filtro-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.mp-filtro-horizontal .mp-filtro-form {
    flex-direction: row;
}

.mp-filtro-vertical .mp-filtro-form {
    flex-direction: column;
    align-items: stretch;
}

.mp-filtro-item {
    flex: 1;
    min-width: 180px;
}

.mp-filtro-vertical .mp-filtro-item {
    width: 100%;
}

.mp-filtro-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 400;
    color: #333;
    font-size: 14px;
}

.mp-filtro-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 42px;
}

.mp-filtro-select:hover {
    border-color: #999;
}

.mp-filtro-select:focus {
    outline: none;
    border-color: #a89f94;
    box-shadow: 0 0 0 2px rgba(168, 159, 148, 0.15);
}

/* Botón FILTRAR - Forzar estilos del template */
.mp-btn-filtrar,
.mp-btn-filtrar.elementor-button,
.mp-btn-filtrar.elementor-button.elementor-size-md {
    background-color: #a89f94 !important;
    background-image: none !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 12px 30px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
    min-width: 140px !important;
    text-transform: uppercase !important;
}

.mp-btn-filtrar:hover,
.mp-btn-filtrar.elementor-button:hover {
    background-color: #968d82 !important;
    color: #fff !important;
}

.mp-btn-filtrar:active {
    transform: translateY(1px) !important;
}

.mp-filtro-button {
    display: flex;
    align-items: flex-end;
}

/* Grid de Propiedades
   ========================================================================== */
.mp-propiedades-container {
    position: relative;
    min-height: 400px;
}

.mp-propiedades-grid {
    display: grid;
    grid-template-columns: repeat(var(--columnas, 3), 1fr);
    gap: 30px;
    padding: 20px 0;
}

/* Responsive Grid */
@media (max-width: 1200px) {
    .mp-propiedades-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .mp-propiedades-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}

/* Tarjeta de Propiedad
   ========================================================================== */
.mp-propiedad-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mp-propiedad-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* Imagen de la Propiedad */
.mp-propiedad-imagen {
    position: relative;
    height: 250px;
    overflow: hidden;
    background: #f5f5f5;
}

.mp-propiedad-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.mp-propiedad-card:hover .mp-propiedad-imagen img {
    transform: scale(1.1);
}

.mp-no-imagen {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 48px;
}

.mp-propiedad-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #a89f94 !important;
    background-color: #a89f94 !important;
    color: #fff !important;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.mp-propiedad-precio {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
}

.mp-precio-valor {
    background: rgba(255,255,255,0.95);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    backdrop-filter: blur(10px);
}

.mp-propiedad-id {
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

/* Contenido de la Propiedad */
.mp-propiedad-contenido {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mp-propiedad-titulo {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 15px 0;
    line-height: 1.4;
    min-height: 50px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Características */
.mp-propiedad-caracteristicas {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 15px;
    padding: 15px 0;
    border-top: 1px solid #ecf0f1;
    border-bottom: 1px solid #ecf0f1;
}

.mp-caracteristica {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #7f8c8d;
}

.mp-caracteristica i {
    color: #a89f94 !important;
    font-size: 16px !important;
    min-width: 20px;
}

/* Footer de la Tarjeta */
.mp-propiedad-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
}

.mp-propiedad-agente {
    font-size: 13px;
    color: #7f8c8d;
    font-weight: 500;
}

.mp-propiedad-acciones {
    display: flex;
    gap: 8px;
}

.mp-propiedad-acciones button {
    width: 36px !important;
    height: 36px !important;
    border: 1px solid #a89f94 !important;
    border-radius: 50% !important;
    background: transparent !important;
    background-color: transparent !important;
    color: #a89f94 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
}

.mp-propiedad-acciones button:hover {
    background: #a89f94 !important;
    background-color: #a89f94 !important;
    color: #fff !important;
}

/* Estados de Carga y Error
   ========================================================================== */
.mp-loading-inicial,
.mp-loading-propiedades {
    text-align: center;
    padding: 60px 20px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mp-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #a89f94;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: mp-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes mp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mp-loading-propiedades p,
.mp-loading-inicial p {
    color: #7f8c8d;
    font-size: 16px;
    margin: 10px 0 0 0;
}

.mp-no-propiedades,
.mp-error-propiedades {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #7f8c8d;
    background: #f8f9fa;
    border-radius: 12px;
}

.mp-error-propiedades {
    color: #8a7060;
    background: #f5f0eb;
}

.mp-error-propiedades p {
    margin: 8px 0;
    color: #8a7060;
}

.mp-error-propiedades .mp-btn-reintentar {
    margin-top: 20px;
    padding: 12px 28px;
    background: #a89f94;
    color: #fff;
    border: none;
    border-radius: 0;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mp-error-propiedades .mp-btn-reintentar:hover {
    background: #968d82;
}

/* Animaciones
   ========================================================================== */
@keyframes mp-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mp-propiedad-card {
    animation: mp-fadeIn 0.5s ease forwards;
}

.mp-propiedad-card:nth-child(1) { animation-delay: 0.1s; }
.mp-propiedad-card:nth-child(2) { animation-delay: 0.2s; }
.mp-propiedad-card:nth-child(3) { animation-delay: 0.3s; }
.mp-propiedad-card:nth-child(4) { animation-delay: 0.4s; }
.mp-propiedad-card:nth-child(5) { animation-delay: 0.5s; }
.mp-propiedad-card:nth-child(6) { animation-delay: 0.6s; }

/* Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .mp-filtro-propiedades {
        padding: 20px;
    }
    
    .mp-filtro-form {
        flex-direction: column;
    }
    
    .mp-filtro-item {
        width: 100%;
        min-width: unset;
    }
    
    .mp-propiedad-caracteristicas {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .mp-propiedad-imagen {
        height: 200px;
    }
    
    .mp-precio-valor {
        font-size: 16px;
        padding: 8px 12px;
    }
}

/* Paginación
   ========================================================================== */
.mp-paginacion {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #ecf0f1;
    text-align: center;
}

.mp-paginacion-info {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 15px;
}

.mp-paginacion-controles {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mp-btn-pagina {
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mp-btn-pagina:hover {
    background: #f5f5f5;
    border-color: #a89f94;
    color: #a89f94;
}

.mp-btn-pagina.mp-pagina-activa {
    background: #a89f94;
    border-color: #a89f94;
    color: #fff;
}

.mp-btn-pagina.mp-pagina-activa:hover {
    background: #968d82;
    border-color: #968d82;
}

.mp-btn-prev,
.mp-btn-next {
    min-width: auto;
    padding: 8px 16px;
}

.mp-paginacion-dots {
    color: #7f8c8d;
    padding: 0 4px;
}

@media (max-width: 768px) {
    .mp-paginacion-controles {
        gap: 6px;
    }

    .mp-btn-pagina {
        min-width: 36px;
        height: 36px;
        padding: 6px 10px;
        font-size: 13px;
    }

    .mp-btn-prev,
    .mp-btn-next {
        padding: 6px 12px;
    }

    .mp-btn-prev span,
    .mp-btn-next span {
        display: none;
    }
}

/* Editor de Elementor
   ========================================================================== */
.elementor-editor-active .mp-loading-inicial {
    display: none;
}

.elementor-editor-active .mp-propiedades-resultado:empty::before {
    content: "Las propiedades se cargarán aquí después de publicar la página";
    display: block;
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    background: #f8f9fa;
    border-radius: 12px;
    font-size: 16px;
}
