/* Reset e stili base */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

/* --- FIX IMPORTANTE: Disabilita il trascinamento delle immagini --- */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Variabili colori (corrispondenti alla config Tailwind) */
:root {
    --color-primary: #0f172a;
    --color-secondary: #d97706;
    --color-light: #f8fafc;
}

/* Stili Slider Prima/Dopo */
.ba-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    cursor: ew-resize;
    user-select: none;
    background-color: #e5e7eb;
    /* Assicura che il touch action sia gestito per lo slide orizzontale */
    touch-action: pan-y;
}

/* Immagine di sfondo ("Dopo") */
.ba-background-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Impedisce agli eventi mouse di interferire con il container */
    pointer-events: none;
}

/* Contenitore immagine in primo piano ("Prima") */
.ba-foreground {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    /* Default start position */
    overflow: hidden;
    border-right: 2px solid white;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    /* Importante per far passare i click al container padre */
}

.ba-foreground-img {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    max-width: unset;
    /* Importante per non scalare l'immagine tagliata */
    object-fit: cover;
    pointer-events: none;
}

/* Maniglia centrale */
.ba-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: transparent;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-50%);
    pointer-events: none;
    /* Gli eventi sono gestiti dal genitore */
}

.ba-circle {
    width: 40px;
    height: 40px;
    background-color: var(--color-secondary);
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Etichette Prima/Dopo */
.ba-label {
    position: absolute;
    top: 1rem;
    padding: 0.25rem 0.5rem;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0.25rem;
    pointer-events: none;
    z-index: 10;
}

.ba-label.before {
    left: 1rem;
}

.ba-label.after {
    right: 1rem;
}

/* Utility */
.hidden-menu {
    display: none;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}