/* Finder CRM Integration — estilos de frontend */

.fcrm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--fcrm-grid-min, 280px), 1fr));
    gap: 24px;
    margin: 24px 0;
    font-family: var(--fcrm-font, inherit);
}

.fcrm-card {
    background: var(--fcrm-bg, #fff);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.fcrm-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.fcrm-card-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.fcrm-card-image {
    position: relative;
    flex-shrink: 0;
}

.fcrm-card-image img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
}

.fcrm-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--fcrm-primary, #333);
    color: var(--fcrm-text-on-primary, #fff);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 4px 10px;
    border-radius: 20px;
}

.fcrm-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.fcrm-card h3,
.fcrm-card h4 {
    margin: 12px 16px 4px;
    color: var(--fcrm-primary, #333);
    font-size: 1.05rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.fcrm-price {
    margin: 0 16px 8px;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--fcrm-accent, #0073aa);
}

.fcrm-price-large {
    font-size: 1.6rem;
}

.fcrm-meta {
    margin: 0 16px 6px;
    font-size: 0.88rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fcrm-desc {
    margin: 0 16px 8px;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fcrm-desc-full {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.6;
    margin: 16px 0;
}

.fcrm-agente-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 16px 16px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.85rem;
    color: #777;
    flex-shrink: 0;
}

.fcrm-agente-nombre {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.fcrm-agente-box {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.fcrm-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #25d366;
    color: #fff !important;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
    flex-shrink: 0;
}

.fcrm-whatsapp-btn:hover {
    background: #1ebc59;
}

.fcrm-agente-card {
    text-align: center;
    padding-bottom: 16px;
}

.fcrm-agente-card img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 50%;
    margin: 16px auto 8px;
    display: block;
}

.fcrm-agente-card h4 {
    color: var(--fcrm-primary, #333);
    margin-bottom: 4px;
}

.fcrm-agente-card p {
    margin: 2px 0;
    font-size: 0.88rem;
}

.fcrm-agente-card a {
    color: var(--fcrm-accent, #0073aa);
    text-decoration: none;
}

.fcrm-agente-card a:hover {
    text-decoration: underline;
}

/* Filtros */
.fcrm-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: end;
    margin-bottom: 28px;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    font-family: var(--fcrm-font, inherit);
}

.fcrm-filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8rem;
}

.fcrm-filter-field label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.72rem;
    color: #888;
}

.fcrm-filter-field input,
.fcrm-filter-field select {
    padding: 9px 12px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    min-width: 140px;
    font-size: 0.9rem;
    background: #fafafa;
}

.fcrm-filter-field input:focus,
.fcrm-filter-field select:focus {
    outline: none;
    border-color: var(--fcrm-accent, #0073aa);
    background: #fff;
}

.fcrm-filter-submit button {
    background: var(--fcrm-primary, #333);
    color: var(--fcrm-text-on-primary, #fff);
    border: none;
    border-radius: 6px;
    padding: 10px 26px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    height: 40px;
}

.fcrm-filter-submit button:hover {
    opacity: 0.9;
}

/* Paginación */
.fcrm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 28px 0 8px;
    font-family: var(--fcrm-font, inherit);
}

.fcrm-page-link {
    color: var(--fcrm-primary, #333);
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.fcrm-page-link:hover {
    background: var(--fcrm-primary, #333);
    color: var(--fcrm-text-on-primary, #fff);
}

.fcrm-page-current {
    color: #888;
    font-size: 0.85rem;
    padding: 0 4px;
}

/* Detalle / galería */
.fcrm-detail {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    margin: 24px 0;
    font-family: var(--fcrm-font, inherit);
}

@media (max-width: 782px) {
    .fcrm-detail {
        grid-template-columns: 1fr;
    }
}

.fcrm-gallery-main {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f2f2f2;
}

.fcrm-gallery-main img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}

.fcrm-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.fcrm-gallery-prev { left: 10px; }
.fcrm-gallery-next { right: 10px; }

.fcrm-gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
}

.fcrm-gallery-thumbs img {
    width: 70px;
    height: 55px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    flex-shrink: 0;
}

.fcrm-gallery-thumbs img.is-active {
    opacity: 1;
    outline: 2px solid var(--fcrm-accent, #0073aa);
}

.fcrm-detail-info h1 {
    color: var(--fcrm-primary, #333);
    margin-top: 0;
}

.fcrm-error {
    color: #b32d2e;
    background: #fbeaea;
    padding: 10px 14px;
    border-radius: 6px;
}

.fcrm-empty {
    color: #777;
    font-style: italic;
}

/* Destacadas: si se fija un número de columnas por atributo, igual respeta mobile */
@media (max-width: 782px) {
    .fcrm-destacadas-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .fcrm-destacadas-grid {
        grid-template-columns: 1fr !important;
    }
}
