﻿/* Carousel aperto - posizionato in fondo alla pagina */
.bottom-carousel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1), opacity 300ms ease;
    text-align: center !important;
}

.carousel-paper {
    display: flex;
    flex-direction: column;
    border-radius: 16px 16px 0 0 !important;
    padding: 0;
    height: 300px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1) !important;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
}

/* Header del carousel */
.carousel-header {
    padding: 16px 20px;
    border-bottom: 2px solid #e3f2fd;
    background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

    .carousel-header .mud-icon-root {
        color: white;
    }

    .carousel-header .mud-text {
        color: white;
        font-weight: 600;
        letter-spacing: 0.5px;
    }

    .carousel-header .mud-icon-button {
        color: white;
    }

        .carousel-header .mud-icon-button:hover {
            background-color: rgba(255, 255, 255, 0.15);
        }

/* Contenitore interno del carousel */
.carousel-inner {
    flex: 1;
    overflow: hidden;
}

/* Item del carousel */
.carousel-item-wrap {
    padding: 24px 28px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

    /* Sezione meta (descr1 e titolo) */
    .carousel-item-wrap .meta {
        padding-bottom: 12px;
        border-bottom: 1px solid #e0e0e0;
    }

    .carousel-item-wrap .descr1 {
        color: #1976d2;
        font-weight: 600;
        margin-bottom: 3px;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 1px;
    }

    .carousel-item-wrap .titolo {
        color: #212121;
        font-weight: 700;
        line-height: 1.3;
        margin: 0;
    }

    /* Body con il testo */
    .carousel-item-wrap .body {
        flex: 1;
        overflow: hidden;
    }

    .carousel-item-wrap .testo {
        color: #424242;
        line-height: 1.6;
        overflow-y: auto;
        max-height: 140px;
        padding-right: 8px;
    }

        /* Scrollbar personalizzata */
        .carousel-item-wrap .testo::-webkit-scrollbar {
            width: 6px;
        }

        .carousel-item-wrap .testo::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 3px;
        }

        .carousel-item-wrap .testo::-webkit-scrollbar-thumb {
            background: #bdbdbd;
            border-radius: 3px;
        }

            .carousel-item-wrap .testo::-webkit-scrollbar-thumb:hover {
                background: #9e9e9e;
            }

    /* Azioni (pulsante Apri) */
    .carousel-item-wrap .actions {
        padding-top: 12px;
        border-top: 1px solid #e0e0e0;
    }

        .carousel-item-wrap .actions .mud-button-root {
            color: #1976d2;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

            .carousel-item-wrap .actions .mud-button-root:hover {
                background-color: rgba(25, 118, 210, 0.08);
            }

/* FAB quando il carousel è chiuso */
.bottom-carousel-closed {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1500;
}

.open-fab {
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.4) !important;
    transition: all 200ms ease;
}

    .open-fab:hover {
        box-shadow: 0 8px 24px rgba(25, 118, 210, 0.5) !important;
        transform: translateY(-2px);
    }

/* Indicatori del carousel (bullets) */
.mud-carousel .mud-carousel-bullets-container {
    bottom: 8px;
}

.mud-carousel .mud-carousel-bullet {
    background-color: rgba(25, 118, 210, 0.3);
}

    .mud-carousel .mud-carousel-bullet.mud-carousel-bullet-active {
        background-color: #1976d2;
    }

/* Frecce di navigazione */
.mud-carousel .mud-icon-button {
    color: #1976d2;
}

    .mud-carousel .mud-icon-button:hover {
        background-color: rgba(25, 118, 210, 0.08);
    }

/* Stato "Nessuna annotazione" */
.carousel-item-wrap .mud-text {
    color: #757575;
    text-align: center;
    padding: 40px 20px;
}

/* Responsive - mobile */
@media (max-width: 768px) {
    .carousel-paper {
        height: 230px;
    }

    .carousel-header {
        padding: 12px 16px;
    }

    .carousel-item-wrap {
        padding: 16px 20px;
    }

        .carousel-item-wrap .testo {
            max-height: 100px;
            font-size: 0.875rem;
        }

    .bottom-carousel-closed {
        bottom: 16px;
        right: 16px;
    }
}

/* Animazioni */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.bottom-carousel {
    animation: slideUp 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-image: url('img/background-2.jpeg');
    background-size: cover; /* adatta l'immagine a tutto lo schermo */
    background-repeat: no-repeat; /* evita che si ripeta */
    background-position: center; /* centra l'immagine */
    background-attachment: fixed; /* opzionale: effetto "parallax" */
    margin: 0; /* rimuove i margini di default */
    min-height: 100vh; /* assicura che copra tutta la finestra */
}

input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px var(--mud-palette-surface) inset !important;
    -webkit-text-fill-color: var(--mud-palette-textprimary) !important;
}

.numeric-center input {
    text-align: center !important;
}

.matrix-wrapper {
    overflow-x: auto;
}

.matrix-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 600px;
}

    .matrix-table th, .matrix-table td {
        border: 1px solid rgba(0,0,0,0.12);
        padding: 6px;
        text-align: center;
        vertical-align: middle;
        height:6rem;
    }

        .matrix-table th.fixed-col, .matrix-table td.fixed-col {
            position: sticky;
            left: 0;
            background: #fff;
            z-index: 2;
            width: 220px;
            text-align: left;
            padding-left: 8px;
        }
        .matrix-table td.fixed-col-cell {
            position: sticky;
            left: 0;
            width: 180px;
            text-align: left;
            padding: 10px;
        }
            .cell-split {
                display: flex;
                flex-direction: column;
                height: 6rem;
            }

.cell-top {
    flex: 0 0 12%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.cell-bottom {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 4px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.90rem;
}

.small {
    font-size: 0.8rem;
    color: #550;
}

.bold {
    font-weight: 600;
}

.cell-art {
    font-size: 0.7rem;
    color: #777;
    margin-top: 4px;
    text-align: center;
}

.processing-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    backdrop-filter: blur(4px);
    background: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.processing-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    padding: 18px 22px;
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 320px;
    justify-content: center;
}

.processing-text {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.scroll-top-fab {
    position: fixed;
    right: 18px;
    bottom: 24px;
    z-index: 2000;
    box-shadow: 0 6px 18px rgba(0,0,0,0.20);
    transition: transform .18s ease, opacity .18s ease;
    opacity: 0;
    transform: translateY(12px) scale(.95);
    pointer-events: none;
}

    .scroll-top-fab.show {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }


/* ============================
   SOLO per la sezione "righe normali"
   ============================ */
.matrix-adjust .cell-split {
    display: flex;
    flex-direction: column;
    height: 6rem; /* altezza fissa SOLO qui */
    min-height: 6rem;
    max-height: 6rem;
    box-sizing: border-box;
    overflow: hidden;
}

.matrix-adjust .cell-top {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.matrix-adjust .cell-bottom {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 4px;
    overflow: hidden;
}

.matrix-adjust .cell-sconto {
    max-height: 2.2rem;
    height: 2.2rem;
    width: 100%;
    box-sizing: border-box;
}

.matrix-adjust .fixed-col {
    height: 6rem !important;
    min-height: 6rem !important;
    max-height: 6rem !important;
    display: table-cell;
    box-sizing: border-box;
}



/* ────────────────────────────────────────────────
   SOLO per la modalità esplodi articoli
   ──────────────────────────────────────────────── */

.explodi-articoli-row .cell-split.exp {
    display: flex;
    flex-direction: column;
    height: 6rem;
    min-height: 6rem;
    max-height: 6rem;
    overflow: hidden;
    box-sizing: border-box;
}

.explodi-articoli-row .cell-top {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px;
}

.explodi-articoli-row .cell-bottom {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 4px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Numeric field stabilizzato */
.explodi-articoli-row .cell-sconto {
    max-height: 2.2rem;
    height: 2.2rem;
    width: 100%;
    box-sizing: border-box;
}

/* Colonna sticky della modalità  */
.explodi-articoli-row .fixed-col {
    height: 6rem !important;
    min-height: 6rem !important;
    max-height: 6rem !important;
    overflow: hidden;
    display: flex;
    align-items: center; /* centra verticalmente */
    background: #fff;
    z-index: 3;
}
