/**
 * Tokko Full Importer - Frontend Styles
 * @version 3.3.0
 */

/* ==========================================
   GRID PRINCIPAL
   ========================================== */
.tfi-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
}
.tfi-grid.tfi-cols-1 { grid-template-columns: repeat(1, 1fr); }
.tfi-grid.tfi-cols-2 { grid-template-columns: repeat(2, 1fr); }
.tfi-grid.tfi-cols-3 { grid-template-columns: repeat(3, 1fr); }
.tfi-grid.tfi-cols-4 { grid-template-columns: repeat(4, 1fr); }
.tfi-grid.tfi-cols-5 { grid-template-columns: repeat(5, 1fr); }
.tfi-grid.tfi-cols-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1024px) {
    .tfi-grid.tfi-tablet-1 { grid-template-columns: repeat(1, 1fr) !important; }
    .tfi-grid.tfi-tablet-2 { grid-template-columns: repeat(2, 1fr) !important; }
    .tfi-grid.tfi-tablet-3 { grid-template-columns: repeat(3, 1fr) !important; }
    .tfi-grid.tfi-tablet-4 { grid-template-columns: repeat(4, 1fr) !important; }
}
@media (max-width: 767px) {
    .tfi-grid { gap: 20px; }
    .tfi-grid.tfi-mobile-1 { grid-template-columns: repeat(1, 1fr) !important; }
    .tfi-grid.tfi-mobile-2 { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ==========================================
   TARJETA DE PROPIEDAD
   ========================================== */
.tfi-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.tfi-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.tfi-item.tfi-align-center .tfi-body {
    align-items: center;
    text-align: center;
}
.tfi-item.tfi-align-right .tfi-body {
    align-items: flex-end;
    text-align: right;
}
.tfi-item.tfi-align-left .tfi-body {
    align-items: flex-start;
    text-align: left;
}

/* ==========================================
   IMAGEN DESTACADA - OCUPA EL 100% SIEMPRE
   ========================================== */
.tfi-img {
    position: relative;
    width: 100%;
    height: 260px;
    min-height: 260px;
    max-height: 260px;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tfi-img img {
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transition: transform 0.4s ease;
}

/* ==========================================
   BADGE VENTA/ALQUILER SEPARADOS
   ========================================== */
.tfi-operation-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: #93003c;
    color: #ffffff;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    z-index: 10;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    line-height: 1.2;
    transition: background 0.2s;
}
.tfi-operation-badge.is-venta { background-color: #28a745; }
.tfi-operation-badge.is-alquiler { background-color: #007bff; }
.tfi-operation-badge.is-alquiler-temporario { background-color: #ffc107; color: #212529; }

/* ==========================================
   BODY DE LA TARJETA
   ========================================== */
.tfi-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

/* ==========================================
   TÍTULO
   ========================================== */
.tfi-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    min-height: 50px;
}
.tfi-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
}
.tfi-title a:hover {
    color: #93003c;
}

/* ==========================================
   DESCRIPCIÓN
   ========================================== */
.tfi-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 5px 0;
    min-height: 30px;
}

/* ==========================================
   PRECIO
   ========================================== */
.tfi-price {
    font-size: 24px;
    font-weight: 700;
    color: #93003c;
    margin: 8px 0;
}
.tfi-price-consult {
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 4px;
    display: inline-block;
}

/* ==========================================
   CARACTERÍSTICAS
   ========================================== */
.tfi-features {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
    color: #6c757d;
    margin: 12px 0;
}
.tfi-feature {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tfi-feature svg {
    flex-shrink: 0;
}

/* ==========================================
   BOTÓN
   ========================================== */
.tfi-btn {
    display: inline-block;
    width: 100%;
    padding: 12px 24px;
    background-color: #93003c;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: auto;
    border: none;
    cursor: pointer;
}
.tfi-btn:hover {
    background-color: #6d0029;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(147, 0, 60, 0.3);
    color: #ffffff;
    text-decoration: none;
}

/* ==========================================
   PAGINACIÓN
   ========================================== */
.tfi-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}
.tfi-pagination a,
.tfi-pagination span {
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #dee2e6;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
}
.tfi-pagination a:hover {
    background: #93003c;
    border-color: #93003c;
    color: #fff;
}
.tfi-pagination .current {
    background: #93003c;
    border-color: #93003c;
    color: #fff;
}

/* ==========================================
   SIN RESULTADOS
   ========================================== */
.tfi-no-results {
    padding: 60px 20px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
    color: #6c757d;
    font-size: 16px;
}

/* ==========================================
   RESPONSIVE - AJUSTES ADICIONALES
   ========================================== */
@media (max-width: 767px) {
    .tfi-img {
        height: 170px;
        min-height: 170px;
        max-height: 170px;
        aspect-ratio: 4/3;
    }
    .tfi-body { padding: 15px; }
    .tfi-title { font-size: 16px; min-height: auto; }
    .tfi-price { font-size: 20px; }
    .tfi-description { font-size: 13px; }
    .tfi-features { gap: 10px; font-size: 13px; }
    .tfi-btn { padding: 10px 20px; font-size: 13px; }
    .tfi-operation-badge { padding: 6px 12px; font-size: 11px; top: 10px; left: 10px; }
}

/* ==========================================
   MODO OSCURO (Opcional)
   ========================================== */
@media (prefers-color-scheme: dark) {
    .tfi-item { background: #2d3748; border-color: #4a5568; }
    .tfi-title a { color: #e2e8f0; }
    .tfi-title a:hover { color: #ff6b9d; }
    .tfi-features, .tfi-description { color: #cbd5e0; }
}
