.grid-anuncios {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 8px 0;
    width: 100%;
    max-width: 100%;
}

.card-anuncio {
    position: relative;
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    overflow: hidden;
}

.card-content {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 10px;
    min-height: auto;
}

.card-image-container {
    width: 150px;
    height: 218px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: none;
}

.card-image {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.photo-counter {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 1;
}

.phone-number {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    font-size: 0.85rem;
    color: white;
    background-color: var(--color-whatsapp);
    border-radius: 4px;
    text-decoration: none;
    justify-content: center;
    min-height: 28px;
    width: 100%;
}

.phone-number:hover {
    background-color: #1f9d4f;
    color: white;
    text-decoration: none;
}

.call-button {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    font-size: 0.85rem;
    color: white;
    background-color: var(--color-primario);
    border-radius: 4px;
    text-decoration: none;
    justify-content: center;
    min-height: 28px;
}

.call-button:hover {
    background-color: var(--color-primarioOscuro);
    color: white;
    text-decoration: none;
}

.image-overlay {
    display: none;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: #4d4f4f;
}

.meta-info {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.card-title {
    font-size: 1.1rem;
    margin: 0;
    color: #99185a;
    font-weight: 500;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-title a {
    color: inherit;
    text-decoration: none;
    font-weight: bold;
}

.card-title a:hover {
    color: inherit;
    text-decoration: none;
}

.card-subtitle {
    display: none;
}

.card-meta {
    display: flex;
    gap: 8px;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 4px;
}

.card-description {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-description p {
    font-size: 0.85rem;
    margin: 0;
    color: #4d4f4f;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.description-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.description-tags span {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(0,0,0,0.05);
    border-radius: 12px;
    color: #666;
}

.card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-top: auto;
}

.card-actions .action-button.full-width {
    grid-column: span 2;
}

.phone-display {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    font-size: 0.85rem;
    background-color: #f5f5f5;
    border-radius: 4px;
    color: #444;
    font-weight: bold;
}

.whatsapp-button {
    display: none;
}

.btn-perfil {
    font-size: 0.85rem;
}

.location-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Tipos específicos */
.basico {
    background-color: var(--color-anuncioBasico);
}

.premium {
    background-color: var(--color-anuncioPremium);
}

.fugaz {
    background-color: var(--color-fugaz);
    grid-column: span 2;
}

.fugaz .card-content {
    grid-template-columns: 150px 1fr;
}

.fugaz .card-image-container {
    width: 150px;
    height: 218px;
}

/* Remove or comment out old tag styles */
.tag {
    display: none;
}

/* Placeholder styles */
.anuncioPlaceholder {
    position: relative;
    height: 234px; /* Altura aproximada de un anuncio */
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
}

.anuncioPlaceholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Ensure grid layout for dynamic content */
#anuncios {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 8px;
}

.action-button span {
    font-weight: bold;
}

.btn-filtros {
    font-size: 0.85rem;
    padding: 6px 12px;
}

@media screen and (max-width: 768px) {
    .grid-anuncios, #anuncios {
        grid-template-columns: 1fr;
        width: 100%;
        padding: 8px 4px;
    }

    .fugaz {
        grid-column: span 1;
    }

    .card-content {
        grid-template-columns: 120px 1fr;
        gap: 8px;
    }

    .card-image-container {
        width: 120px;
        height: 175px;
    }

    .fugaz .card-content {
        grid-template-columns: 120px 1fr;
    }

    .fugaz .card-image-container {
        width: 120px;
        height: 175px;
    }

    .card-actions {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 4px;
    }

    .phone-number, .call-button {
        width: auto;
        padding: 8px;
    }

    .action-button.full-width {
        width: auto;
    }

    .phone-display {
        font-size: 0.8rem;
    }

    .card-description p {
        display: none;
    }

    .card-title {
        -webkit-line-clamp: 3;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
        font-size: 13px;
        line-height: 1.3;
    }

    .description-tags {
        margin-top: 4px;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .description-tags span {
        font-size: 0.65rem;
        padding: 2px 4px;
    }

    .card-anuncio {
        width: 100%;
        margin: 0;
    }

    .btn-filtros {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
}

@media screen and (max-width: 480px) {
    .card-content {
        grid-template-columns: 100px 1fr;
    }

    .card-image-container {
        width: 100px;
        height: 146px;
    }

    .card-description p {
        -webkit-line-clamp: 3;
    }

    .description-tags {
        margin-top: 2px;
    }

    .description-tags span {
        font-size: 0.6rem;
        padding: 1px 4px;
    }

    .card-description {
        margin-top: 0;
    }

    .fugaz .card-content {
        grid-template-columns: 100px 1fr;
    }

    .fugaz .card-image-container {
        width: 100px;
        height: 146px;
    }

    .phone-number, .call-button {
        padding: 6px;
        font-size: 0.75rem;
        min-height: 24px;
    }

    .phone-display {
        padding: 6px;
        font-size: 0.75rem;
    }
}

