/* 
Sistema de Calificaciones - Componente CSS Minimalista y Elegante
*/

.ratings-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.ratings-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.ratings-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    margin: 0;
}

.overall-score {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
}

.overall-stars {
    display: flex;
    gap: 0.1rem;
}

.overall-score-number {
    font-size: 0.75rem;
    font-weight: 600;
    color: #059669;
    min-width: 1.5rem;
    text-align: right;
}

.ratings-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.rating-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.3rem 0;
}

.rating-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}

.rating-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.7;
}

.rating-text {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rating-score {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.rating-stars {
    display: flex;
    gap: 0.05rem;
}

.star {
    width: 12px;
    height: 12px;
    fill: #e2e8f0;
    transition: fill 0.2s ease;
}

.star.filled {
    fill: #f59e0b;
}

.star.half-filled {
    fill: url(#half-star-gradient);
}

.rating-number {
    font-size: 0.65rem;
    color: #6b7280;
    font-weight: 500;
    min-width: 1.2rem;
    text-align: right;
}

/* Variantes de iconos para diferentes tipos de indicadores */
.rating-icon.durability { color: #0ea5e9; }
.rating-icon.price { color: #ff6b00 !important; } /* Naranja brillante para debug */
.rating-icon.maintenance { color: #f59e0b; }
.rating-icon.security { color: #ef4444; }
.rating-icon.aesthetics { color: #8b5cf6; }
.rating-icon.energy { color: #22c55e; }
.rating-icon.installation { color: #6b7280; }

/* Responsive: En móviles hacer aún más compacto */
@media (max-width: 640px) {
    .ratings-container {
        padding: 0.5rem;
        gap: 0.3rem;
    }
    
    .ratings-title {
        font-size: 0.75rem;
    }
    
    .rating-text {
        font-size: 0.65rem;
    }
    
    .rating-number {
        font-size: 0.6rem;
    }
    
    .star {
        width: 10px;
        height: 10px;
    }
    
    .rating-icon {
        width: 12px;
        height: 12px;
    }
}

/* Estados especiales */
.ratings-container.no-ratings {
    display: none;
}

.ratings-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Gradiente para estrellas semi-llenas */
.ratings-gradients {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Animación sutil al cargar */
.rating-item {
    opacity: 0;
    animation: fadeInUp 0.3s ease forwards;
}

.rating-item:nth-child(1) { animation-delay: 0.1s; }
.rating-item:nth-child(2) { animation-delay: 0.15s; }
.rating-item:nth-child(3) { animation-delay: 0.2s; }
.rating-item:nth-child(4) { animation-delay: 0.25s; }
.rating-item:nth-child(5) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover effects sutiles */
.rating-item:hover {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    padding: 0.3rem 0.4rem;
    margin: 0 -0.4rem;
}

.rating-item:hover .rating-text {
    color: #475569;
}

.rating-item:hover .star.filled {
    fill: #f97316;
}
