/* --- LAYOUT GENERALE --- */
.kmz-reviews-grid {
    display: grid !important;
    gap: 20px !important;
    width: 100% !important;
    margin: 20px 0 !important;
}
.kmz-cols-4 { grid-template-columns: repeat(4, 1fr) !important; }
.kmz-cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
.kmz-cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
.kmz-cols-1 { grid-template-columns: 1fr !important; }

/* --- WRAPPER CAROSELLO (Frecce Laterali Esterne) --- */
.kmz-slider-outer-wrapper {
    position: relative;
    padding: 0 60px; /* Spazio laterale per le frecce */
}

/* Frecce Carosello */
.kmz-slider-outer-wrapper .swiper-button-next,
.kmz-slider-outer-wrapper .swiper-button-prev {
    color: #333 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 40px;
    height: 40px;
}

.kmz-slider-outer-wrapper .swiper-button-prev { left: 0 !important; }
.kmz-slider-outer-wrapper .swiper-button-next { right: 0 !important; }

.kmz-slider-outer-wrapper .swiper-button-next::after,
.kmz-slider-outer-wrapper .swiper-button-prev::after { 
    font-size: 24px !important; 
    font-weight: bold; 
}


/* --- CARD DESIGN --- */
.kmz-review-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    display: flex !important;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.kmz-card-slider {
    height: 200px;
    background: #f4f4f4;
    overflow: hidden;
}

.kmz-inner-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    height: 100%;
    scrollbar-width: none;
}
.kmz-inner-track::-webkit-scrollbar { display: none; }

.kmz-inner-track img {
    min-width: 100%;
    height: 100%;
    object-fit: cover;
    scroll-snap-align: start;
    cursor: zoom-in;
}

.kmz-review-body { padding: 20px; flex-grow: 1; }
.kmz-text-container { font-size: 14px; line-height: 1.5; color: #555; }

.kmz-read-more {
    display: block;
    margin-top: 10px;
    background: none;
    border: none;
    color: #ce1b28;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.kmz-review-footer {
    padding: 15px 20px;
    background: #fafafa;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
}

.kmz-avatar { width: 40px; height: 40px; border-radius: 50%; margin-right: 12px; }
.kmz-author { font-weight: bold; font-size: 14px; }
.kmz-stars { color: #ffb400; font-size: 12px; }

/* --- LIGHTBOX (Frecce Laterali Esterne) --- */
#kmz-lb-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.92);
    z-index: 999999;
    justify-content: center;
    align-items: center;
}

#kmz-lb-img { 
    max-width: 80%; /* Lasciamo spazio laterale */
    max-height: 85vh; 
    object-fit: contain; 
}

.lb-btn {
    position: absolute;
    color: #fff;
    font-size: 60px;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s;
}

.lb-btn:hover { color: #93BE20; }

.lb-prev { left: 30px; top: 30%; transform: translateY(-50%); }
.lb-next { right: 30px; top: 30%; transform: translateY(-50%); }
.lb-close { top: 20px; right: 30px; font-size: 40px; }

@media (max-width: 768px) {
    .kmz-slider-outer-wrapper { padding: 0 40px; }
    .lb-btn { font-size: 40px; }
    .lb-prev { left: 10px; }
    .lb-next { right: 10px; }
}

.kmz-review-card {
	height:450px !important;
}

button.kmz-read-more {
    padding: 5px 20px !important;
    font-size: 0.6rem !important;
    text-decoration: none !important;
	background-color:#93BE20 !important;
	color:#ffffff !important;
	border:none !important;
}

button.kmz-read-more:hover {
	
	background-color:#000 !important
	
}


/* --- LIGHTBOX MINIATURE --- */
#kmz-lb-thumbnails {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    max-width: 80%;
}

.lb-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.lb-thumb:hover, .lb-thumb.active {
    opacity: 1;
    border-color: #93BE20; 
}

/* Modifica al contenitore principale per impilare foto e miniature */
#kmz-lb-overlay {
    flex-direction: column !important; /* Mette le miniature sotto la foto */
}

/* Assicura che l'immagine e le miniature siano incolonnate */
.lb-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 80%;
    max-height: 80vh;
}

#kmz-lb-img {
    max-width: 100%;
    max-height: 70vh; /* Lascia spazio sotto per le thumb */
    object-fit: contain;
}

#kmz-lb-thumbnails {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto; /* Se sono troppe diventano scorrevoli */
    overflow-y: hidden;;
    padding: 10px;
}


/* Impedisce alle immagini di uscire dal contenitore prima del caricamento JS */
.kmz-slider-outer-wrapper .swiper {
    overflow: hidden !important;
    max-height: 500px; /* O l'altezza che preferisci */
}

.kmz-gallery-item img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Fix per lo spazio bianco */
.swiper-wrapper {
    display: flex !important;
}



.kmz-main-image-wrap {
    width: 100%;
    margin-bottom: 8px;
}

.kmz-main-photo {
    width: 100%;
    height: 200px; /* O quella che preferisci */
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
}

.kmz-review-thumbnails {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.kmz-thumb-item {
    flex: 1; /* Divide lo spazio equamente in 3 */
    aspect-ratio: 1 / 1;
}

.kmz-mini-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.kmz-mini-thumb:hover {
    opacity: 0.8;
}