@charset "UTF-8";

:root {
    --blue-tecnomat: #001685;
    --yellow-tecnomat: #FFD100;
    --orange-tecnomat: #ff6b00;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    width: 1080px; /* Risoluzione Totem */
    height: 1920px;
    overflow: hidden;
    font-family: 'Roboto', sans-serif;
}

.btn {
    border-radius: 0 !important;
}

/* Classe personalizzata per il tasto Aggiungi alla Lista */
.btn-tec-list {
    background-color: #ff6b00; /* Arancione Tecnomat */
    border: 2px solid #ff6b00;
    color: #ffffff !important; /* Forza il testo bianco */
    border-radius: 50px;       /* Lo rende arrotondato e moderno */
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Effetto quando viene toccato/cliccato */
.btn-tec-list:active, .btn-tec-list:hover {
    background-color: #e66000 !important;
    border-color: #e66000 !important;
    transform: scale(0.98); /* Leggero feedback al tocco */
    color: #ffffff !important;
}

/* Stile per l'icona dentro il tasto */
.btn-tec-list i {
    color: #ffffff !important;
    font-size: 1.2rem;
}

/* ==========================================================================
   STRUTTURA HOME PAGE
   ========================================================================== */
.home-body {
    background: black; /* Sfondo nero dietro il video */
}

.home-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 10;
}

/* Fumetti Ciclici Home */
.home-speech-area {
    position: absolute;
    top: 38%; /* Sotto la testa dell'operaio */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    z-index: 20;
    text-align: center;
}

.bubble-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    height: 250px;
}

.speech-bubble {
    background: white;
    border: 5px solid var(--blue-tecnomat);
    border-radius: 40px;
    padding: 30px 50px;
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--blue-tecnomat);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 15px 15px 0px rgba(0, 22, 133, 0.1);
    opacity: 0;
    width: auto;
    white-space: nowrap;
    animation: bubbleSequence 12s infinite ease-in-out;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    top: -24px; /* Freccia sopra */
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 20px 24px 20px;
    border-style: solid;
    border-color: transparent transparent var(--blue-tecnomat) transparent;
}

.b1 { animation-delay: 0s; }
.b2 { animation-delay: 4s; }
.b3 { animation-delay: 8s; }

@keyframes bubbleSequence {
    0%, 100% { opacity: 0; transform: translate(-50%, 20px); }
    5%, 28% { opacity: 1; transform: translate(-50%, 0); }
    33% { opacity: 0; transform: translate(-50%, -20px); }
}

/* Footer Home (Risoluzione Frecce Gialle/Blu) */
.home-footer {
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 80px 0 40px 0;
    background: linear-gradient(to top, white 0%, rgba(255,255,255,0.9) 50%, transparent 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 30;
}

.btn-start {
    width: 85%;
    padding: 45px;
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    background: var(--blue-tecnomat);
    color: white;
    border: none;
    border-radius: 100px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 2;
}

/* Sfondo Video */
.fullscreen-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
}

.bg-video {
    width: 100%; height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   STRUTTURA ASSISTENTE (CHAT)
   ========================================================================== */

.mini-logo {
    height: 50px; 
    position: static; /* RESET del position: absolute precedente */
    transform: none;  /* RESET del transform precedente */
}

.assistant-body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Impedisce lo scroll dell'intera pagina */
}

.mini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px; /* Aumentato leggermente il padding */
    background-color: var(--blue-tecnomat);
    color: white;
    height: 120px; /* Altezza fissa per l'header del totem */
    width: 100%;
    position: relative;
    z-index: 1000;
}

.header-left, .header-right {
    flex: 1; 
    display: flex;
    align-items: center;
}

.header-right {
    flex: 0 0 150px; /* Larghezza minima per lo stato online */
    display: flex;
    justify-content: flex-end;
}

.header-left {
    flex: 0 0 200px; /* Larghezza fissa per il logo */
    display: flex;
    justify-content: flex-start;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 45px; /* Spazio generoso per le dita sul totem */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
    color: white !important;
    cursor: pointer;
    min-width: 80px;
}

.nav-item:hover {
    opacity: 0.8;
}

.nav-icon {
    width: 45px;  /* Icone più grandi per il totem */
    height: 45px;
    margin-bottom: 8px;
    stroke: white; /* Forza il colore delle linee */
}

.nav-item span {
    font-size: 14px; /* Testo leggibile */
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cart-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}



.badge-count {
    position: absolute;
    top: -8px;      /* Lo sposta un po' sopra l'icona */
    right: -12px;   /* Lo sposta a destra dell'icona */
    background-color: var(--orange-tecnomat);
    color: white;
    font-size: 14px;
    font-weight: 900;
    min-width: 24px;
    height: 24px;
    border-radius: 50%; /* Lo rende un cerchio perfetto */
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #004595; /* Bordo blu come lo sfondo per "staccarlo" visivamente */
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 10;
}

.home-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
}

.home-icon-outline { width: 60px; height: 60px; margin-bottom: 5px; }

.chat-container {
    height: 500px; /* Regola questa altezza in base al totem */
    flex: none; 
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}



/* Messaggi Uniformati */
@keyframes messageEntrance {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message {
    display: flex;
    gap: 25px;
    padding: 25px 40px;
    font-size: 2rem;
    font-weight: 700;
    max-width: 95%; /* Allargata leggermente per far stare tutto in linea */
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border: 4px solid var(--blue-tecnomat);
    background: #e9ecef;
    line-height: 1.3;
    animation: messageEntrance 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    will-change: transform, opacity;
}

.ai-message {
    align-self: flex-start;
    border-radius: 45px 45px 45px 10px;
    color: var(--blue-tecnomat);
    
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 25px;
    
    /* Usiamo px fissi per il totem da 1080px */
    width: 950px; 
    padding: 30px;
    margin-left: 20px;
}

.message-content {
    /* Sottraiamo lo spazio occupato da avatar e mic (circa 300px totali) */
    width: 600px; 
    flex-shrink: 0;
}

.message-text {
    font-size: 2rem;
    line-height: 1.3;
    /* Impedisce al testo di allargare la bolla */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Microfono Inline posizionato a destra */
.mic-inline-container {
    width: 150px;
    height: 120px;
    flex-shrink: 0;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center;
    border-left: 3px solid rgba(0, 22, 133, 0.1);
    margin: 0 !important;
    padding: 0 !important;
}

/* Bottone Microfono Inline */
.mic-btn-inline {
    width: 90px !important;
    height: 90px !important;
    border-radius: 50%;
    background: var(--orange-tecnomat);
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mic-btn-inline span {
    font-size: 3rem; /* Emoji grande */
}

.mic-status-inline {
    font-size: 1rem !important;
    font-weight: 900;
    margin-top: 5px;
    color: var(--blue-tecnomat);
    text-transform: uppercase;
    text-align: center;
}

.user-message {
    align-self: flex-end;
    margin-left: auto;
    border-radius: 45px 45px 10px 45px;
    color: #ffffff;
    background: var(--blue-tecnomat);
    flex-direction: row-reverse; /* Testo a destra (o sinistra se aggiungi avatar utente) */
}

/* Avatar e Animazioni */
.avatar-container {
    width: 85px; height: 85px;
    border-radius: 50%;
    border: 4px solid var(--orange-tecnomat);
    overflow: hidden;
    flex-shrink: 0;
}

.inner-avatar { width: 100%; height: 100%; object-fit: cover; }

.is-waiting {
    animation: avatar-breath 0.8s infinite ease-in-out;
}

@keyframes avatar-breath {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0px var(--orange-tecnomat); }
    50% { transform: scale(1.1); box-shadow: 0 0 25px var(--orange-tecnomat); }
}

/* Footer Assistente */
.assistant-footer {
    height: 100px; /* Dimezzato lo spazio */
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.mic-btn {
    width: 200px; height: 200px;
    border-radius: 50%;
    background: var(--yellow-tecnomat);
    border: none;
    font-size: 5rem;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    position: relative;
}

.recording .mic-pulse {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 50%;
    background: rgba(255, 209, 0, 0.4);
    animation: micPulse 1.5s infinite;
}

@keyframes micPulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}

.status-indicator { 
    color: #4CAF50; 
    font-weight: bold; 
    font-size: 1.4rem; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.status-indicator::before { content: "●"; animation: blink 2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ==========================================================================
   STRUTTURA CARD PRODOTTI
   ========================================================================== */
/* Contenitore orizzontale per le card */

#prodotti-suggeriti-container {
    padding: 20px;
    margin-top: 10px;
    /* Rimuovi grid-template-columns e rows */
}

.tm-product-card {
    background: white;
    border: 3px solid #001685;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.tm-img-container {
    height: 150px; /* Mantieni un'altezza fissa adeguata alla card 4x3 */
    display: flex !important; /* Forza Flexbox */
    justify-content: center !important; /* Centra orizzontalmente */
    align-items: center !important; /* Centra verticalmente */
    overflow: hidden; /* Taglia eventuali parti eccedenti se l'immagine è troppo grande */
    padding: 10px; /* Un po' di respiro dai bordi */
    background-color: #fdfdfd; /* Sfondo leggero opzionale per far risaltare l'immagine */
    border-bottom: 1px solid #eee; /* Linea di separazione pulita */
}

.tm-img-container img {
    max-width: 100%; /* L'immagine non supera la larghezza del contenitore */
    max-height: 100%; /* L'immagine non supera l'altezza del contenitore */
    width: auto; /* Mantiene le proporzioni */
    height: auto; /* Mantiene le proporzioni */
    object-fit: contain; /* Assicura che l'intera immagine sia visibile senza ritagli, adattandosi allo spazio */
}

.tm-product-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--blue-tecnomat);
    min-height: 2.4em; /* Blocca l'altezza del titolo */
}

.text-orange {
    color: var(--orange-tecnomat) !important;
    font-weight: 800;
    font-size: 1.4rem;
}

.tm-content {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Spinge il resto verso il basso */
}

/* Titolo Prodotto: Flessibile ma ordinato */
.tm-title {
    font-size: 1.1rem !important; /* Leggermente più piccolo per le 4 colonne */
    line-height: 1.2;
    color: var(--blue-tecnomat);
    margin-bottom: 10px;
    
    /* Rimuoviamo altezze fisse per evitare tagli */
    height: auto !important; 
    min-height: 3.6em; /* Garantisce spazio per almeno 3 righe senza sbalzi */
    
    /* Gestione testo lungo */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Mostra al massimo 3 righe, poi mette i puntini */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tm-price-row {
    margin-bottom: 8px;
}

.tm-price {
    font-size: 34px;
    font-weight: 900;
    color: #000000;
}

.tm-disponibile {
    font-weight: 900;
    color: var(--orange-tecnomat);
    font-size: 19px;
}

.tm-iva {
    font-size: 15px;
}

.tm-codes p {
    font-size: 0.85rem; /* Font più piccolo per i codici per risparmiare spazio */
    margin-bottom: 2px;
    line-height: 1;
}

.modal-content {
    background-color: #ffffff;
    box-shadow: 0 0 100px rgba(0,0,0,0.5); /* Effetto profondità su tutto lo schermo */
}

#modalProductPrice {
    color: #000000;
    border-bottom: 2px solid #eee;
    padding-bottom: 20px;
}

#modalProductDescription {
    background: #f8f9fa;
    border-left: 5px solid var(--blue-tecnomat);
    padding: 20px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333;
    
    /* Gestione spazio verticale */
    max-height: 400px; /* Limita l'altezza per non rompere il layout */
    overflow-y: auto;  /* Aggiunge lo scroll se il testo è tanto */
    
    /* Effetto pulito */
    border-radius: 0 10px 10px 0;
}

/* Rendi la scrollbar più sottile e moderna per il totem */
#modalProductDescription::-webkit-scrollbar {
    width: 8px;
}
#modalProductDescription::-webkit-scrollbar-thumb {
    background: var(--blue-tecnomat);
    border-radius: 10px;
}

.modal-backdrop.show {
    opacity: 0.8; /* Scurisce molto lo sfondo per far risaltare il modal */
}

.product-info { text-align: center; width: 100%; }
.product-name { font-size: 1.4rem; font-weight: 900; color: var(--blue-tecnomat); margin-bottom: 10px; height: 3.5rem; overflow: hidden; }
.product-price { font-size: 2rem; color: var(--orange-tecnomat); font-weight: 900; margin-bottom: 5px; }
.product-pos { font-size: 1.1rem; color: #666; font-style: italic; }


/* Contenitore principale dell'overlay */
#mapOverlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    
    background-color: white;
    overflow: hidden !important;
    padding: 0 !important;
    
    /* Layout */
    display: none; /* Gestito dal JS con d-none o display:flex */
    flex-direction: column;
    z-index: 9999 !important;
    pointer-events: all;
    
    /* Forza il rendering accelerato dall'hardware */
    transform: translateZ(0);
    backface-visibility: hidden;
}

#mapOverlay.d-none {
    pointer-events: none;     /* Smette di bloccare i clic quando è nascosto */
    display: none !important;
}

.map-header-compact {
    padding: 20px 25px 10px 25px;
    background: white;
    z-index: 10;
}

.map-area-viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background: #f8f9fa; /* Colore di caricamento neutro */
}

.map-wrapper {
    position: relative;
    display: inline-block; /* Fondamentale per avvolgere l'immagine */
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border: 2px solid #ddd;
    border-radius: 15px;
    background: #f9f9f9;
}

#mapPin {
    position: absolute;
    z-index: 1000;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

#mappaImmagine {
    max-width: 95%; /* Leggermente più piccola per stare nel modal */
    height: auto;
    max-height: 70vh; /* Lascia spazio per header e "Tu sei qui" */
    display: block;
    object-fit: contain;
}

/* Raggruppamento Mappa + Pin */
.map-container-final {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pin-pulsante {
    width: 32px;
    height: 32px;
    background-color: #ff6b00;
    border: 3px solid white;
    border-radius: 50% !important;
    box-shadow: 0 0 15px rgba(227,6,19,0.6);
}

#labelReparto {
    background: #001685; /* Blu Tecnomat */
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Stile del tasto stampa sulla mappa */
.btn-totem-stampa {
    position: absolute !important;
    bottom: 35px !important;
    right: 35px !important;
    z-index: 3000 !important;
    padding: 10px 25px !important;
    font-size: 1.2rem !important;
    
    border: 4px solid #004595 !important; /* Blu Tecnomat */
    background-color: #001685 !important;
    color: #ffffff !important;

    /* Effetto feedback al tocco (essenziale per Totem) */
    transition: transform 0.1s active;
}

.btn-totem-stampa:active {
    transform: scale(0.95);
    background-color: #e6b800 !important; /* Giallo più scuro al tocco */
}

/* Assicurati che l'icona sia ben distanziata */
.btn-totem-stampa i {
    font-size: 1.6rem;
    vertical-align: middle;
}




/** ---- STAMPE ---- **/

@media print {
    
    @page {
        size: 80mm auto; /* Altezza automatica basata sul contenuto */
        margin: 0 !important;
    }
    
    /* 1. Nascondi TUTTO ciò che c'è nella pagina */
    body * {
        visibility: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* 3. Mostra SOLO l'area di stampa e rendila visibile */
    #area-stampa, #area-stampa * {
        visibility: visible !important;
    }
    
    #area-stampa {
        position: absolute;
        left: 20px;
        top: 0;
        width: 76mm !important; /* Qui prendi lo spazio a destra */
        display: block !important;
        background: white !important;
    }
    
    .scontrino-container {
        /* LARGHEZZA E MARGINI */
        width: 100% !important; 
        margin: 0 !important;
        
        /* IL MARGINE SINISTRO CHE CERCAVI */
        padding-left: 5mm !important; 
        padding-top: 5mm !important;
        padding-right: 2mm !important;
        
        font-family: 'Courier New', monospace;
        color: black !important;
        background: white !important;
    }

    .scontrino-header {
        text-align: center;
        border-bottom: 2px solid black;
        margin-bottom: 10px;
        /* Compensa il padding left per centrare il titolo rispetto alla carta */
        margin-right: 3mm; 
    }

    .titolo-tecnomat {
        font-size: 30px;
        font-weight: 900;
        margin: 0;
        text-align: center;
    }

    .info-riga {
        display: block;
        width: 100%;
        font-size: 20px;
        font-weight: bold;
    }

    .testo-corsia {
        font-size: 24px;
        font-weight: 900;
    }

    .codici-box {
        margin-top: 10px;
        border-top: 1px dashed black;
        font-size: 13px;
    }

    .data-stampa {
        font-size: 11px;
        text-align: center;
        margin-top: 15px;
    }
    
    
    
}

#qrcode-container {
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: inline-block;
    margin-top: 15px;
    border: 2px solid #004595;
}

.btn-scarica-tel {
    background-color: #28a745 !important; /* Verde per differenziarlo dal blu/giallo */
    color: white !important;
    border: none !important;
}

#qrcode img {
    border: 5px solid black;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Effetto Scanner Laser */
.laser-line {
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: red;
    box-shadow: 0 0 15px 2px red;
    top: 0;
    animation: scan 2s infinite linear;
    z-index: 10;
}

@keyframes scan {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}

.scanner-box {
    position: relative;
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    border: 2px dashed #004595;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ==========================================================================
   STILE SPECIFICO PER ASSISTENTE PROGETTI (INGEGNERE)
   ========================================================================== */

#chat-container2 {
    /* Altezza fissa o dinamica per attivare lo scroll */
    height: 90%; 
    min-height: 400px;
    
    /* GESTIONE SCROLL: Fondamentale per le risposte lunghe */
    overflow-y: auto !important;
    overflow-x: hidden;
    
    /* Layout interno */
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 25px;
    
    /* Background opzionale per distinguere l'area */
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    
    /* Scroll fluido */
    scroll-behavior: smooth;
}

/* Personalizzazione barra di scorrimento per ID chat-container2 */
#chat-container2::-webkit-scrollbar {
    width: 10px;
}

#chat-container2::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#chat-container2::-webkit-scrollbar-thumb {
    background: #ff6b00; /* Arancione Tecnomat per lo scroll dei progetti */
    border-radius: 10px;
    border: 2px solid #f1f1f1;
}

/* Evita che le bolle AI troppo lunghe escano dal contenitore */
#chat-container2 .ai-message, 
#chat-container2 .user-message {
    max-width: 90%;
    word-wrap: break-word;
}