@charset "UTF-8";

/* ==========================================================================
   1. VARIABILI E BASE
   ========================================================================== */
:root {
    --blue-tecnomat: #004691;
    --blue-dark: #001635;
    --yellow-tecnomat: #FFD200;
    --red-tecnomat: #e10613;
    --light-grey: #f4f4f4;
    --dark-text: #333333;
    --white: #ffffff;
    --header-height: 100px;
    --sidebar-width: 400px;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--light-grey);
    margin: 0;
    color: var(--dark-text);
    height: 100vh;
    overflow: hidden; /* Il layout è gestito dai container interni */
}

/* ==========================================================================
   2. START PAGE (ATTRACT SCREEN) - INVARIATO
   ========================================================================== */
#attract-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    background: black;
    cursor: pointer;
}

#bg-video {
    position: absolute;
    min-width: 100%; min-height: 100%;
    z-index: -1;
    object-fit: cover;
    filter: brightness(0.6);
}

.pulse-ring {
    position: absolute;
    width: 150px; height: 150px;
    border: 2px solid white;
    border-radius: 50%;
    animation: ripple 3s linear infinite;
    opacity: 0;
}

@keyframes ripple {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(3); opacity: 0; }
}

/* ==========================================================================
   3. HEADER TECNOMAT
   ========================================================================== */
.main-header {
    height: var(--header-height);
    background-color: var(--blue-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.header-logo {
    height: 60px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.btn-nav-flat {
    background: none; border: none; color: white;
    display: inline-flex; flex-direction: column; align-items: center;
    margin-left: 25px; transition: opacity 0.2s;
}

.btn-nav-flat i { font-size: 22px; margin-bottom: 5px; }
.btn-nav-flat span { font-size: 0.7rem; font-weight: 700; letter-spacing: 1px; }

/* ==========================================================================
   4. LAYOUT A DUE COLONNE (27" MONITOR)
   ========================================================================== */
.totem-wrapper {
    display: flex;
    height: calc(100vh - var(--header-height));
    width: 100%;
}

/* --- COLONNA SINISTRA (CHAT & PROGETTO) --- */
.main-content-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 30px;
    overflow-y: auto;
    background: var(--light-grey);
}

/* --- COLONNA DESTRA (SIDEBAR CARRELLO) --- */
.sidebar-cart {
    width: var(--sidebar-width);
    background: var(--white);
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 20px rgba(0,0,0,0.05);
}

/* ==========================================================================
   5. COMPONENTI INTERAZIONE
   ========================================================================== */
.interaction-card {
    background: var(--white);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.btn-mic {
    background-color: var(--yellow-tecnomat);
    border: none;
    width: 90px; height: 90px;
    border-radius: 50%;
    font-size: 2.5rem;
    color: var(--blue-tecnomat);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.btn-mic.listening {
    background-color: var(--red-tecnomat);
    color: white;
    animation: pulse-mic 1.5s infinite;
}

@keyframes pulse-mic {
    0% { box-shadow: 0 0 0 0 rgba(225, 6, 19, 0.5); }
    70% { box-shadow: 0 0 0 20px rgba(225, 6, 19, 0); }
    100% { box-shadow: 0 0 0 0 rgba(225, 6, 19, 0); }
}

/* Area Risposta AI */
.ai-chat-bubble {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    border-left: 10px solid var(--blue-tecnomat);
    margin-bottom: 25px;
    font-size: 1.2rem;
    line-height: 1.6;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--blue-tecnomat);
    font-weight: 900;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

/* SVG Container */
.svg-container {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
    border: 2px solid #eee;
}

.svg-container svg {
    max-width: 100%;
    height: auto;
    max-height: 550px;
}

/* ==========================================================================
   6. CARD PRODOTTI (TECNOMAT STYLE)
   ========================================================================== */
.tm-product-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    width: 280px;
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.tm-product-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.tm-img-container {
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.tm-img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.tm-title {
    font-size: 1.1rem;
    font-weight: 400;
    color: #333;
    line-height: 1.3;
    height: 3rem;
    overflow: hidden;
    margin-bottom: 15px;
}


.tm-code {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.tm-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-bottom: 20px;
}

.tm-dispo {
    font-weight: 700;
    color: #666;
}

.tm-check {
    color: #4CAF50;
    font-size: 1.2rem;
}

.tm-price-row {
    padding-top: 15px;
}

.tm-price {
    font-size: 1.8rem;
    font-weight: 900;
    color: #000;
}

.products-grid-chat {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.product-card-ui {
    background: #fff;
    border: 2px solid #eee;
    border-left: 6px solid var(--yellow-tecnomat);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.product-card-ui:hover {
    transform: translateY(-3px);
    border-color: var(--yellow-tecnomat);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.p-icon { font-size: 2rem; margin-right: 15px; }
.p-name { font-weight: 700; font-size: 1rem; color: var(--blue-dark); display: block; }
.p-code { font-size: 0.75rem; color: #999; }
.p-price { margin-left: auto; font-weight: 900; color: var(--blue-tecnomat); font-size: 1.1rem; }

/* ==========================================================================
   7. SIDEBAR CARRELLO
   ========================================================================== */
.cart-header {
    background: var(--blue-tecnomat);
    color: white;
    padding: 25px;
    text-align: center;
}

.badge-cart {
    background: var(--yellow-tecnomat);
    color: var(--blue-dark);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 900;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-empty-msg {
    text-align: center;
    color: #bbb;
    margin-top: 50px;
}

.cart-empty-msg i { font-size: 4rem; margin-bottom: 15px; }

.cart-footer {
    padding: 25px;
    background: #f9f9f9;
    border-top: 2px solid #eee;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-weight: 900;
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.btn-send-phone {
    width: 100%;
    background: var(--red-tecnomat);
    color: white;
    border: none;
    padding: 20px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 0 #b3050f;
}

/* ==========================================================================
   8. PULSANTI E TASTIERA
   ========================================================================== */
.button-group-ui {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.btn-scelta-rapida {
    background: var(--blue-dark);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    transition: background 0.2s;
}

/* Tasto speciale Disegno 3D */
.btn-scelta-rapida:contains("📐") {
    background: var(--blue-tecnomat);
    border: 2px solid var(--yellow-tecnomat);
}

.footer-keyboard-area {
    position: fixed;
    bottom: 0; left: 0;
    width: calc(100% - var(--sidebar-width));
    background: var(--white);
    padding: 15px;
    border-top: 2px solid #ddd;
    z-index: 1001;
}

#user-input-manual {
    width: 100%;
    height: 60px;
    font-size: 1.4rem;
    border: 2px solid var(--blue-tecnomat);
    border-radius: 10px;
    padding: 0 20px;
}

.loader-ai {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--blue-tecnomat);
    border-radius: 50%;
    width: 30px; height: 30px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
}

@keyframes spin { 100% { transform: rotate(360deg); } }