/**
 * CTR Bienes Raíces - Estilos Modernos Propiedades
 * Cards estilo personas/familias con fondo azul de la marca
 */

/* ===== GRID DE PROPIEDADES ===== */
.propiedades-grid-modern {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 2rem 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
}

.propiedades-grid-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.propiedad-hidden {
    display: none;
}

.propiedad-card-modern {
    background: var(--color-white);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    animation: slideInUp 0.6s ease backwards;
    height: 320px;
    display: flex;
    flex-direction: row;
    gap: 0;
    padding: 0.75rem;
    border: 3px solid transparent;
    width: 100%;
    box-sizing: border-box;
    isolation: isolate;
}

.propiedad-card-modern:nth-child(1) { animation-delay: 0.1s; }
.propiedad-card-modern:nth-child(2) { animation-delay: 0.2s; }
.propiedad-card-modern:nth-child(3) { animation-delay: 0.3s; }
.propiedad-card-modern:nth-child(4) { animation-delay: 0.4s; }
.propiedad-card-modern:nth-child(5) { animation-delay: 0.5s; }
.propiedad-card-modern:nth-child(6) { animation-delay: 0.6s; }

.propiedad-card-modern:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 61, 255, 0.4);
    z-index: 5;
    border-color: var(--color-primary);
}

.propiedad-card-modern:hover .propiedad-card-content-modern {
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.3);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.propiedad-card-image-modern {
    flex: 0 0 40%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
}

.propiedad-card-image-modern img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.propiedad-card-modern:hover .propiedad-card-image-modern img {
    transform: scale(1.15);
}

.propiedad-card-overlay {
    display: none;
}

.propiedad-card-content-modern {
    flex: 1;
    padding: 2.25rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 20px;
    margin-left: -0.75rem;
    position: relative;
    z-index: 1;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.2);
    min-width: 0;
    height: 100%;
    overflow: visible;
}

.propiedad-card-modern:hover .propiedad-card-overlay {
    transform: translateY(-10px);
}

.propiedad-card-name {
    font-family: var(--font-title);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 1.5rem;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.propiedad-card-features-modern {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.propiedad-feature-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-white);
    font-size: 1rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    white-space: nowrap;
}

.propiedad-feature-modern svg {
    width: 20px;
    height: 20px;
    fill: var(--color-white);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.propiedad-card-info-box {
    background: transparent;
    backdrop-filter: none;
    padding: 0;
    border-radius: 0;
    border: none;
    margin-top: auto;
    flex-shrink: 0;
}

.propiedad-card-price-modern {
    font-family: var(--font-body) !important;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--color-white);
    margin-bottom: 0.5rem;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.propiedad-card-location-modern {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.propiedad-card-location-modern svg {
    width: 16px;
    height: 16px;
    fill: var(--color-white);
}

/* Sección "Oportunidades únicas aquí" */
.propiedades-section-modern {
    padding: var(--spacing-xl) 2rem;
    background: linear-gradient(135deg, #002a7f 0%, #003dff 100%) !important;
    position: relative;
    overflow: hidden;
}

/* Estilos mejorados para propiedades destacadas con fondo institucional */
.carrusel-proyectos-modern#propiedades,
section#propiedades.carrusel-proyectos-modern {
    background: linear-gradient(135deg, #002a7f 0%, #003dff 50%, #4d80ff 100%) !important;
    background-image: none !important;
    position: relative;
    overflow: hidden;
}

.carrusel-proyectos-modern#propiedades::before,
section#propiedades.carrusel-proyectos-modern::before {
    content: '' !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.05)"/></svg>');
    opacity: 0.6;
    pointer-events: none;
    z-index: 1;
    display: block !important;
}

.carrusel-proyectos-modern#propiedades::after,
section#propiedades.carrusel-proyectos-modern::after {
    display: none !important;
    content: none !important;
}

.propiedades-section-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.05)"/></svg>');
    opacity: 0.3;
}

.propiedades-section-modern .container {
    position: relative;
    z-index: 1;
}

.propiedades-title-modern {
    text-align: center;
    margin-bottom: 3rem;
}

.propiedades-title-modern h2 {
    font-family: var(--font-title);
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: var(--color-white);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}

.propiedades-title-modern p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

.propiedades-actions-modern {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 1400px) {
    .propiedades-grid-modern {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.75rem;
    }
}

@media (max-width: 1024px) {
    .propiedades-grid-modern {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .propiedad-card-modern {
        height: 340px;
    }
    
    .propiedad-card-content-modern {
        padding: 1.75rem 1.75rem;
    }
}

@media (max-width: 768px) {
    .propiedades-grid-modern {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .propiedad-card-modern {
        flex-direction: column;
        height: auto;
        padding: 0.75rem;
    }
    
    .propiedad-card-image-modern {
        flex: 0 0 280px;
        width: 100%;
    }
    
    .propiedad-card-content-modern {
        margin-left: 0;
        margin-top: -1rem;
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    
    .propiedad-card-name {
        font-size: 1.5rem;
    }
    
    .propiedad-card-price-modern {
        font-size: 1.9rem;
    }
    
    .propiedades-actions-modern {
        flex-direction: column;
    }
    
    .propiedades-actions-modern .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* ===== ESTILOS FORZADOS AL FINAL PARA PROPIEDADES DESTACADAS ===== */
/* Asegurar máxima prioridad para el fondo azul institucional */
section#propiedades.carrusel-proyectos-modern,
#propiedades.carrusel-proyectos-modern,
.carrusel-proyectos-modern#propiedades {
    background: linear-gradient(135deg, #002a7f 0%, #003dff 50%, #4d80ff 100%) !important;
    background-color: #003dff !important;
    background-image: none !important;
    padding: 5rem 0 !important;
    position: relative !important;
    overflow: hidden !important;
}

section#propiedades.carrusel-proyectos-modern::before,
#propiedades.carrusel-proyectos-modern::before,
.carrusel-proyectos-modern#propiedades::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.05)"/></svg>') !important;
    opacity: 0.6 !important;
    pointer-events: none !important;
    z-index: 1 !important;
    display: block !important;
}

section#propiedades.carrusel-proyectos-modern::after,
#propiedades.carrusel-proyectos-modern::after,
.carrusel-proyectos-modern#propiedades::after {
    display: none !important;
    content: none !important;
}

/* Asegurar que el header se vea bien */
section#propiedades.carrusel-proyectos-modern .carrusel-header-modern h2,
#propiedades.carrusel-proyectos-modern .carrusel-header-modern h2 {
    color: #ffffff !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #ffffff !important;
    background-clip: unset !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

section#propiedades.carrusel-proyectos-modern .carrusel-header-modern p,
#propiedades.carrusel-proyectos-modern .carrusel-header-modern p {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* ===== MODO OSCURO ===== */
[data-theme="dark"] .propiedad-card-modern {
    background: var(--bg-secondary);
    border-color: rgba(0, 61, 255, 0.3);
}

[data-theme="dark"] .propiedad-card-modern:hover {
    border-color: var(--color-primary);
    box-shadow: 0 20px 60px rgba(0, 61, 255, 0.5);
}

[data-theme="dark"] .propiedad-card-content-modern {
    background: linear-gradient(135deg, #002a7f 0%, #003dff 50%, #4d80ff 100%);
}

[data-theme="dark"] .propiedad-card-name {
    color: var(--color-white);
}

[data-theme="dark"] .propiedad-card-location-modern {
    color: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .propiedad-card-location-modern svg {
    fill: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .propiedad-card-price-modern {
    color: var(--color-white);
}

[data-theme="dark"] .propiedad-feature-modern {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .propiedad-feature-modern svg {
    fill: var(--color-white);
}

[data-theme="dark"] .propiedad-card-description-modern {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .propiedades-cards-modern {
    background-color: var(--bg-primary);
}

[data-theme="dark"] .propiedades-grid-modern {
    background-color: var(--bg-primary);
}