/* comparison-slider.css - Stili per il componente di confronto immagini */

.comparison-slider-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    border-radius: var(--radius-normal);
    overflow: hidden;
    box-shadow: var(--shadow-normal);
}

.comparison-slider {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.comparison-after,
.comparison-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.comparison-after img,
.comparison-before img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* L'immagine "prima" sarà inizialmente mostrata al 50% della larghezza */
.comparison-before {
    width: 50%;
}

/* Stile del divisore */
.comparison-divider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    z-index: var(--z-10);
    cursor: ew-resize; /* Cursore per indicare che è trascinabile */
    touch-action: none; /* Previene il comportamento di scroll touch predefinito */
}

.divider-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background-color: var(--color-white);
}

.divider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.divider-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 15px rgba(237, 28, 36, 0.5);
}

.handle-icon {
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
} 

/* Etichette Prima e Dopo */
.comparison-label {
    position: absolute;
    top: 20px;
    font-family: var(--font-family-gotham-medium);
    font-weight: var(--font-weight-500);
    color: var(--color-white);
    background-color: var(--color-primary);
    padding: 5px 15px;
    border-radius: var(--radius-button);
    font-size: var(--font-size-s);
    text-transform: uppercase;
    z-index: var(--z-10);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.label-before {
    left: 20px;
}

.label-after {
    right: 20px;
}

/* Animazione leggera al caricamento */
@keyframes showSlider {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comparison-slider-container {
    animation: showSlider 0.6s ease forwards;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .comparison-slider {
        height: 350px;
    }
    
    .divider-handle {
        width: 32px;
        height: 32px;
    }
    
    .handle-icon {
        width: 18px;
        height: 18px;
    }
    
    .comparison-label {
        padding: 4px 12px;
        font-size: 12px;
    }
}