/* Estilos para la página de propiedades */
.property-card {
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.property-card h3 {
    margin-top: 0;
    color: var(--accent);
}
.amenities-list {
    margin-top: 1rem;
    padding-left: 1.2rem;
}
.amenities-list li {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Grid para tarjetas de propiedades */
.properties-grid__list,
#properties-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Responsive grid */
@media (max-width: 992px) {
    .properties-grid__list,
    #properties-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .properties-grid__list,
    #properties-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-top: 1rem;
        align-items: stretch; /* que cada celda tenga la altura del más alto automáticamente */
        /* quitamos grid-auto-rows para permitir altura natural y estiramiento */
    }
    
    .property-card {
        transition: none !important;
        height: auto; /* permitir ajuste natural al contenido */
    }
    
    .property-card .content {
        gap: 0.3rem !important;
        flex-grow: 0 !important;
    }
    
    .property-card .price {
        font-size: 1rem !important;
        margin-top: 0 !important;
    }
    
    .amenities-preview {
        font-size: 0.75rem !important;
        gap: 0.35rem !important;
    }
    
    .amenities-preview .amenity-item {
        padding: 0.3rem 0.5rem !important;
    }
    
    /* Mobile: square 1:1 fixed, no hover effects */
    .property-card .thumbnail {
        aspect-ratio: 1 / 1 !important;
        height: auto !important;
        background-size: cover;
        background-position: center;
        transition: none !important;
    }
    /* Disable all hover effects on mobile */
    .property-card:hover {
        transform: none !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
    }
    .property-card:hover .thumbnail { 
        aspect-ratio: 1 / 1 !important;
        height: auto !important;
        transform: none !important;
    }
    .property-card:hover h3 {
        font-size: 0.9rem !important;
    }
    .property-card:hover .meta {
        font-size: 0.8rem !important;
    }
    .property-card:hover .price {
        font-size: 1rem !important;
    }
    .property-card:hover .amenities-preview {
        font-size: 0.75rem !important;
        gap: 0.35rem !important;
    }
    .property-card:hover .amenities-preview .amenity-item {
        padding: 0.3rem 0.5rem !important;
    }
    .property-card:hover .description {
        font-size: inherit !important;
        max-height: inherit !important;
    }
    .property-card:hover .gallery-nav {
        display: none !important;
    }
    
    .property-card .description {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .properties-grid__list,
    #properties-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .property-card {
        padding: 0;
        transition: none !important;
        height: auto;
    }
    
    .property-card h3 { 
        font-size: 0.85rem !important;
    }
    
    .property-card .meta {
        font-size: 0.75rem !important;
    }
    
    .property-card .price {
        font-size: 0.95rem !important;
        margin-top: 0 !important;
    }
    
    .amenities-preview {
        font-size: 0.7rem !important;
        gap: 0.3rem !important;
    }
    
    .amenities-preview .amenity-item {
        padding: 0.25rem 0.4rem !important;
    }
    
    .property-card .thumbnail {
        aspect-ratio: 1 / 1 !important;
        height: auto !important;
        background-size: cover;
        background-position: center;
        transition: none !important;
    }
    /* No hover effects at all */
    .property-card:hover {
        transform: none !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
    }
    .property-card:hover .thumbnail { 
        aspect-ratio: 1 / 1 !important;
        height: auto !important;
    }
    .property-card:hover h3 {
        font-size: 0.85rem !important;
    }
    .property-card:hover .meta {
        font-size: 0.75rem !important;
    }
    .property-card:hover .price {
        font-size: 0.95rem !important;
    }
    .property-card:hover .amenities-preview {
        font-size: 0.7rem !important;
        gap: 0.3rem !important;
    }
    .property-card:hover .amenities-preview .amenity-item {
        padding: 0.25rem 0.4rem !important;
    }
    .property-card:hover .description {
        font-size: inherit !important;
        max-height: inherit !important;
    }
    .property-card:hover .gallery-nav {
        display: none !important;
    }
    
    .property-card .content {
        padding: 0.7rem;
        gap: 0.25rem !important;
        flex-grow: 0 !important;
    }
    
    .property-card .description {
        display: none !important;
    }
}


.property-card {
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover elegante solo en desktop */
@media (min-width: 769px) {
    .property-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 24px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.12);
    }
    
    .property-card:hover .thumbnail {
        filter: brightness(1.05);
    }
    
    .property-card:hover h3 {
        color: var(--accent-hover, #5a7bff);
    }
}

.property-card .thumbnail {
    width: 100%;
    height: 140px;
    background-size: cover;
    background-position: center;
    position: relative;
    flex-shrink: 0;
    z-index: 1;
}

/* Galería de imágenes */
.property-card .gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: none;
    justify-content: space-between;
    padding: 0 0.5rem;
    z-index: 10;
}

.gallery-nav button {
    background: rgba(255,255,255,0.9);
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: background 0.2s;
}

.gallery-nav button:hover {
    background: #fff;
}

.property-card .content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 0;
    gap: 0.8rem;
}


.property-card h3 { 
    margin: 0; 
    color: var(--accent); 
    font-size: 1.4rem;
    line-height: 1.3;
    transition: font-size 0.3s ease;
}

.property-card:hover h3 {
    font-size: 1.1rem;
}

.property-card .meta { 
    font-size: 1rem; 
    color: var(--text-muted); 
    transition: font-size 0.3s ease;
}

.property-card:hover .meta {
    font-size: 0.85rem;
}

/* Descripción (solo desktop; móvil se oculta) */
.property-card .description { 
    font-size: 1rem; 
    color: var(--text-muted); 
    line-height: 1.5;
    max-height: 4.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* soporte WebKit */
    -webkit-box-orient: vertical;
    transition: font-size 0.3s ease, max-height 0.3s ease;
}

 .property-card:hover .description {
    font-size: 0.85rem;
    max-height: 2.55em;
    -webkit-line-clamp: 2;
}

.property-card .price { 
    font-weight: 700; 
    color: var(--accent); 
    font-size: 1.4rem;
    transition: font-size 0.3s ease;
    text-align: right;
}

.property-card:hover .price {
    font-size: 1.1rem;
}

/* Amenities en tarjeta - TODAS las prestaciones en grid de 2 columnas */
.amenities-preview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
    font-size: 0.75rem;
    transition: font-size 0.3s ease, gap 0.3s ease;
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
}

.amenities-preview::-webkit-scrollbar {
    width: 4px;
}

.amenities-preview::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 2px;
}

.property-card:hover .amenities-preview {
    font-size: 0.7rem;
    gap: 0.3rem;
}

.amenities-preview .amenity-item {
    background: rgba(0,0,0,0.05);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: padding 0.3s ease;
    line-height: 1.2;
}

.property-card:hover .amenities-preview .amenity-item {
    padding: 0.25rem 0.4rem;
}

/* Responsive */
@media (max-width: 900px) {
    .properties-grid__list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .properties-grid__list { grid-template-columns: 1fr; }
}

/* Desktop only: hover effects */
@media (min-width: 769px) {
    .property-card {
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        min-height: 440px; /* sólo desktop */
    }
    .property-card .content {
        flex-grow: 1;
    }
    .property-card .price {
        margin-top: auto;
    }
    .property-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    }
    .property-card .thumbnail {
        transition: height 0.3s ease;
    }
    .property-card:hover .thumbnail {
        height: 240px;
    }
    .property-card:hover .gallery-nav {
        display: flex;
    }
    .property-card h3 {
        transition: font-size 0.3s ease;
    }
    .property-card:hover h3 {
        font-size: 1.1rem;
    }
    .property-card .meta {
        transition: font-size 0.3s ease;
    }
    .property-card:hover .meta {
        font-size: 0.85rem;
    }
    .property-card .description {
        transition: font-size 0.3s ease, max-height 0.3s ease;
    }
    .property-card:hover .description {
        font-size: 0.85rem;
        max-height: 2.55em;
        -webkit-line-clamp: 2;
    }
    .property-card .price {
        transition: font-size 0.3s ease;
    }
    .property-card:hover .price {
        font-size: 1.1rem;
    }
    .amenities-preview {
        transition: font-size 0.3s ease, gap 0.3s ease;
    }
    .property-card:hover .amenities-preview {
        font-size: 0.7rem;
        gap: 0.3rem;
    }
    .amenities-preview .amenity-item {
        transition: padding 0.3s ease;
    }
    .property-card:hover .amenities-preview .amenity-item {
        padding: 0.25rem 0.4rem;
    }
}

/* Modal de detalle de propiedad */
.property-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.property-modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    z-index: 10;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(0,0,0,0.8);
}

.modal-gallery {
    position: relative;
    width: 100%;
    height: 400px;
    background: #000;
}

.modal-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
}

.modal-gallery-nav button {
    background: rgba(255,255,255,0.9);
    border: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.modal-gallery-nav button:hover {
    background: #fff;
}

.modal-body {
    padding: 2rem;
}

.modal-title {
    margin-top: 0;
    color: var(--accent);
    font-size: 2rem;
}

.modal-meta {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.modal-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--brand-mid);
    margin-bottom: 1.5rem;
}

.modal-desc {
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.modal-amenities {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.6rem;
    margin: 1.5rem 0;
}

.modal-amenities .amenity-item {
    background: rgba(0,0,0,0.05);
    padding: 0.7rem 1rem;
    border-radius: 6px;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.4;
}

.map-container {
    width: 100%;
    height: 300px;
    background: #e0e0e0;
    border-radius: 8px;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}


.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-options {
    margin-bottom: 1.5rem;
    text-align: right;
}

.whatsapp-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    color: #25D366;
    padding: 0.6rem 1rem;
    border: 1px solid #25D366;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.whatsapp-contact-btn:hover {
    background: #25D366;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.whatsapp-contact-btn svg {
    width: 18px;
    height: 18px;
}

.contact-form input,
.contact-form textarea {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
}

.contact-form button {
    background: var(--brand-mid);
    color: #fff;
    border: 0;
    padding: 1rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.contact-form button:hover {
    background: var(--brand-dark);
}

/* Estado del formulario de contacto en el modal de propiedad */
#contact-status {
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    background: rgba(0,0,0,0.04);
}


/* Estilos para actividades y anuncios */
.activities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.actividad-card, .anuncio-card {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.actividad-card:hover, .anuncio-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.actividad-image, .anuncio-image {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
}

.actividad-content, .anuncio-content {
    padding: 1rem;
}

.actividad-content h3, .anuncio-content h3 {
    margin-top: 0;
    color: var(--accent);
    font-size: 1.1rem;
}

.actividad-content p, .anuncio-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.anuncio-content .contact {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--brand-mid);
}

@media (max-width: 900px) {
    .activities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .activities-grid {
        grid-template-columns: 1fr;
    }
}
