.review-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #fdf7ed;
    border-radius: 8px;
    display: none; /* Form nascosto di default */
}

.review-form-container.active {
    display: block;
}

.write-review-button {
    display: block;
    width: fit-content;
    margin: 2rem auto;
    padding: 0.75rem 1.5rem;
    background-color: #000;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.write-review-button:hover {
    background-color: #333;
}

.review-submission-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Rating Stars */
.stars-container {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 1rem 0;
}

.star {
    font-size: 2rem;
    cursor: pointer;
    color: #ddd;
    transition: color 0.2s;
}

.star:hover {
    color: #ffd700;
}

.star.active {
    color: #ffd700;
}

/* Form Groups */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* Terms Checkbox */
.terms-group {
    font-size: 0.9rem;
}

.checkbox-container {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.terms-text a {
    color: #000;
    text-decoration: none;
}

.terms-text a:hover {
    text-decoration: underline;
}

/* Reviews Grid */
.reviews-grid {
   display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* <-- Modifica fondamentale */
    gap: 1rem; /* Spazio tra le recensioni */
    margin: 2rem 0;
     align-items:flex-start;
     transition: all 0.3s ease-in-out;
}

.loader {
    display: none;
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.review-content {
    position: relative;
    line-height: 1.5;
    
}

.review-content.truncated {
    max-height: 100px;
    overflow: hidden;
    transition: max-height 0.3s ease-out; 
}

.review-content.truncated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: linear-gradient(rgba(253, 247, 237, 0), #fdf7ed);
    pointer-events: none;
}

.review-card {
    background-color: #fdf7ed;
    padding: 1.5rem; /* Ridotto il padding */
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    height: auto; /* <-- Importante: permette alle card di adattarsi al contenuto */
}


.loader.active {
    display: block;
}
.review-card {
    background-color: #fdf7ed;
    padding: 2rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}


.review-title {
    font-size: 1.1rem; /* Leggermente ridotto il titolo */
    font-weight: 600;
    margin-bottom: 0.3rem; /* Ridotto il margine */
}

.review-rating {
    color: #ffd700;
    font-size: 1rem; /* Ridotta la dimensione delle stelle */
    margin-bottom: 0.7rem; /* Ridotto il margine */
}



.review-author {
    margin-top: 0.7rem; /* Ridotto il margine */
    font-style: italic;
    color: #666;
    font-size: 0.9rem; /* Ridotta la dimensione del testo */
}
.review-date {
    margin-top: 0.3rem; /* Ridotto il margine */
    font-size: 0.9rem; /* Ridotta la dimensione del testo */
    color: #888; /* Colore meno evidente */
}

.read-more-button {
    display: inline-block;
    margin-top: 1rem;
    color: #000;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.read-more-button:hover {
    color: #333;
}

.load-more-button {
    display: none;
    width: fit-content;
    margin: 2rem auto;
    padding: 0.75rem 1.5rem;
    background-color: #000;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.load-more-button.visible {
    display: block;
}

.load-more-button:hover {
    background-color: #333;
}

/* Messages */
#review-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
}

#review-message.success {
    background-color: #d4edda;
    color: #155724;
}

#review-message.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* Responsive Adjustments */
@media screen and (max-width: 992px) {
    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .review-form-container {
        padding: 1rem;
    }
    
    .star {
        font-size: 1.75rem;
    }
    
    .review-card {
        padding: 1.5rem;
    }
}

@media screen and (max-width: 576px) {
    .reviews-grid {
        grid-template-columns: 1fr;
    }
}