/**
 * Estilos para la sección de reseñas de productos
 */

/* Contenedor principal de reseñas */
.product-reviews-container {
    margin-top: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
}

/* Título de la sección */
.product-reviews-container h3 {
    color: var(--theme-color, #3BB77E);
    margin-bottom: 20px;
    font-weight: 600;
    position: relative;
    padding-bottom: 10px;
}

.product-reviews-container h3:after {
    content: '';
    width: 50px;
    height: 3px;
    background-color: var(--theme-color, #3BB77E);
    position: absolute;
    bottom: 0;
    left: 0;
}

/* Estrellas de valoración */
.review-rating {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.review-rating .stars {
    color: #FFB800;
    font-size: 18px;
    margin-right: 10px;
}

.review-rating .rating-text {
    color: #666;
    font-size: 14px;
}

/* Comentario de la reseña */
.review-comment {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    position: relative;
}

.review-comment:before {
    content: '"';
    font-size: 40px;
    color: rgba(0, 0, 0, 0.1);
    position: absolute;
    top: 5px;
    left: 10px;
}

.review-comment p {
    padding-left: 20px;
    position: relative;
    z-index: 1;
}

/* Información del usuario */
.review-user {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.review-user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.review-user .user-info {
    display: flex;
    flex-direction: column;
}

.review-user .user-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.review-user .review-date {
    font-size: 12px;
    color: #999;
}

/* Resumen de valoraciones */
.reviews-summary {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.reviews-summary .average-rating {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.reviews-summary .average-rating .big-rating {
    font-size: 48px;
    font-weight: 700;
    color: #333;
    margin-right: 15px;
}

.reviews-summary .average-rating .rating-stars {
    display: flex;
    flex-direction: column;
}

.reviews-summary .rating-count {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* Barras de progreso para cada nivel de estrellas */
.rating-bars .rating-bar {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.rating-bars .star-label {
    width: 40px;
    font-size: 14px;
    color: #666;
}

.rating-bars .progress {
    flex: 1;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 10px;
}

.rating-bars .progress-bar {
    height: 100%;
    background-color: var(--theme-color, #3BB77E);
}

.rating-bars .percent {
    width: 40px;
    font-size: 14px;
    color: #666;
    text-align: right;
}

/* Botón para escribir una reseña */
.write-review-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--button-background, #3BB77E);
    color: var(--button-text-color, #fff) !important;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin-top: 20px;
}

.write-review-btn:hover {
    background-color: var(--hover-color, #30A56E);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Mensaje cuando no hay reseñas */
.no-reviews {
    text-align: center;
    padding: 30px 0;
}

.no-reviews img {
    max-width: 150px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.no-reviews h4 {
    color: #999;
    font-weight: 500;
}

/* Estilos para el popup de valoración */
.review-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.review-popup.active {
    display: flex;
}

.review-popup-content {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.review-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.review-popup-close:hover {
    color: #333;
}

.review-popup h3 {
    margin-bottom: 20px;
    color: var(--theme-color, #3BB77E);
}

/* Estrellas interactivas para valoración */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    margin-bottom: 20px;
}

.star-rating input {
    display: none;
}

.star-rating label {
    cursor: pointer;
    width: 40px;
    height: 40px;
    font-size: 40px;
    color: #ddd;
    transition: color 0.3s;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: #FFB800;
}

/* Campo de comentario */
.review-comment-field {
    margin-bottom: 20px;
}

.review-comment-field textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 100px;
}

/* Botón de envío */
.submit-review-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--button-background, #3BB77E);
    color: var(--button-text-color, #fff);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-review-btn:hover {
    background-color: var(--hover-color, #30A56E);
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .reviews-summary .average-rating {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .reviews-summary .average-rating .big-rating {
        margin-bottom: 10px;
    }
    
    .review-user {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .review-user img {
        margin-bottom: 10px;
    }
}
