@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

* { padding: 0; margin: 0; box-sizing: border-box; font-family: "Heebo", sans-serif; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1e1e2f;
    margin: 0;
    padding: 0;
    color: #f0f0f0;
}

/* --- BOTTONI CARRELLO FISSI --- */
.cart-btn, .cart-btn_vendi {
    position: fixed;
    right: 20px;
    color: white;
    padding: 10px 15px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    text-decoration: none;
    transition: all 0.3s;
}

.cart-btn {
    top: 80px;
    background-color: #ffc107;
    color: #3a3a50;
}
.cart-btn:hover {
    background: rgb(235, 157, 40);
    transform: translateY(-2px);
}

.cart-btn_vendi {
    top: 140px;
    background-color: rgb(36, 167, 10);
}
.cart-btn_vendi:hover {
    background: rgb(29, 139, 7);
    transform: translateY(-2px);
}

.cart-count {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 24px; height: 24px;
    display: flex; align-items: center; 
    justify-content: center;
    font-size: 0.8em;
}

/* --- SCHEDA PRODOTTO --- */
.scheda {
    max-width: 900px;
    margin: 40px auto;
    background-color: #2c2c3e;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.05);
    padding: 30px;
}

.scheda img {
    display: block;
    margin: 0 auto 20px auto;
    max-width: 350px;
    height: auto;
    border-radius: 10px;
    background-color: rgb(223, 220, 220);
    padding: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #00bcd4;
}

.h2_dettagli_prodotto {
    margin-top: 100px;    
}

/* --- TABELLA --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    color: #f0f0f0;
}

td {
    padding: 10px;
    vertical-align: top;
}

td.label {
    font-weight: 600;
    color: #f0f0f0;
    background-color: #3a3a50;
    width: 35%;
    border-radius: 5px 0 0 5px;
}

td.value {
    background-color: #29293a;
    border-radius: 0 5px 5px 0;
    color: #bbbbbb;
}

tr:nth-child(even) td.label {
    background-color: #34344a;
}
tr:nth-child(even) td.value {
    background-color: #252538;
}

/* Links */
a { color: #00bcd4; text-decoration: none; }
a:hover { text-decoration: underline; }

.back-link {
    text-align: center;
    margin-top: 30px;
}
.back-link a {
    background-color: #00bcd4;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.3s;
}
.back-link a:hover { background-color: #0097a7; }

/* --- SLIDER --- */
.slider-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto 30px auto;
    overflow: hidden;
}
.slider {
    display: flex;
    transition: transform 0.4s ease-in-out;
}
.slide {
    min-width: 100%;
    box-sizing: border-box;
    text-align: center;
}
.slide img {
    width: 100%;
    max-width: 350px;
    height: auto;
    margin: 0 auto;
    display: block;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.4);
}
.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    font-size: 20px;
    transition: background-color 0.3s;
}
.prev:hover, .next:hover { background-color: rgba(0,0,0,0.8); }
.prev { left: 10px; }
.next { right: 10px; }

/* --- ANIMAZIONI OFFERTE --- */
.offerta { color: #ff6347; animation: affarissimo 1s infinite; }
.fuoco_sx { color: #ff6347; animation: fuoco_sx 1.5s infinite; }
.fuoco_dx { color: #ff6347; animation: fuoco_dx 1s infinite; }

@-webkit-keyframes affarissimo {
    0% { opacity: 0.5; color: rgb(0, 255, 26);}
    50% { opacity: 1.5; color: rgb(0, 255, 26);}
    100% { opacity: 0.5; color: rgb(0, 255, 26);}
}
@-webkit-keyframes fuoco_sx {
    0% { opacity: 0.5; display: inline-block; transform: scale(1);}
    50% { opacity: 1.5; display: inline-block; transform: scale(1.3); color: rgb(255, 60, 0);}
    100% { opacity: 0.5; display: inline-block; transform: scale(1);}
}
@-webkit-keyframes fuoco_dx {
    0% { opacity: 0.5; display: inline-block; transform: scale(1);}
    50% { opacity: 1.5; display: inline-block; transform: scale(1.3); color: rgb(255, 60, 0);}
    100% { opacity: 0.5; display: inline-block; transform: scale(1);}
}

/* --- AMMINISTRAZIONE --- */
.barcode { text-align: center; margin-top: 30px; }
.barcode img { max-height: 80px; }

/* NUOVO STILE PER IL BOX OFFERTE */
.div_form_offerte { 
    width: 100%; 
    margin: 30px auto; 
    display: block; 
    text-align: center;
    background-color: #252538; /* Sfondo leggermente diverso per evidenziare il box */
    border: 1px solid #444;
    border-radius: 10px;
    padding: 20px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.2);
}

.h6_guida_offerte { 
    font-size: 13px; 
    color: #ff9800; /* Arancione più leggibile */
    margin-top: 0; 
    margin-bottom: 15px; 
    text-align: center;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px dashed #555;
    padding-bottom: 10px;
}

/* Flexbox per allineare tutto su una riga */
.div_form_offerte .form_aggiungi { 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap; /* Va a capo su mobile */
    margin: 0;
}

/* Reset label per togliere lo stile a blocco vecchio */
.div_form_offerte .label_offerte {
    padding: 0;
    width: auto;
    height: auto;
    background: transparent;
    color: #00bcd4;
    border: none;
    font-weight: bold;
    font-size: 14px;
}

/* Uniformiamo Select e Input */
.div_form_offerte .select_offerte,
.div_form_offerte .input_offerte {
    height: 40px; /* Altezza uniforme */
    background-color: #1e1e2f;
    color: #fff;
    border: 1px solid #555;
    padding: 0 10px;
    border-radius: 5px;
    font-size: 15px;
    display: flex;
    align-items: center;
}

.div_form_offerte .input_offerte {
    width: 120px; /* Un po' più largo per il barcode */
    text-align: center;
}

/* Bottone specifico dentro le offerte */
.div_form_offerte .btn_aggiungi {
    height: 40px; /* Stessa altezza degli input */
    line-height: 1; /* Centra il testo verticalmente */
    padding: 0 20px;
    width: auto; /* Larghezza automatica in base al testo */
    margin: 0;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.div_form_offerte .btn_aggiungi:hover {
    background-color: #218838;
}

/* --- STILI GENERICI PER ALTRI FORM ADMIN (RIMASTI INVARIATI MA RIORDINATI) --- */
.input_carrello { 
    padding: 5px; 
    text-align: center; 
    background: #333; 
    color: #fff; 
    border: 1px solid #555; 
    width: 60px; 
    height: 20px; 
}




/* --- BOTTONI GRANDI (AZIONI) - 4 IN LINEA RESPONSIVE --- */
.azioni-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;               
    justify-content: center; /* Centrati */
    margin: 30px auto;
    padding: 0 5px;
    width: 100%;
    max-width: 1200px;
}

.btn-big {
    /* PC: 4 bottoni per riga (25% larghezza ciascuno) */
    flex: 0 0 calc(25% - 10px);
    
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px; 
    
    font-family: "Heebo", sans-serif;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    color: white !important;
    
    padding: 12px 2px;
    border-radius: 8px;
    border: none;
    
    white-space: nowrap; 
    overflow: hidden;    
    
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.btn-big:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.5);
    filter: brightness(1.1);
}

/* Colori */
.btn-stats { background-color: #17a2b8; }
.btn-edit { background-color: #ffc107; color: #212529 !important; }
.btn-copy { background-color: #28a745; }
.btn-report-total { background-color: #007bff; }


/* --- RESPONSIVE --- */

/* SU TABLET E CELLULARI: 2 per riga (2x2) */
@media (max-width: 768px) {
    .btn-big {
        flex: 0 0 calc(50% - 10px); /* 50% larghezza */
        font-size: 12px; /* Testo leggermente più piccolo */
    }
}

/* SU CELLULARI MOLTO PICCOLI (es. vecchi iPhone): 1 per riga (impilati) */
/* Questa è una sicurezza in più se il testo è troppo lungo */
@media (max-width: 380px) {
    .btn-big {
        flex: 0 0 100%; /* Occupa tutta la larghezza */
    }
}


/* =========================================
   RESPONSIVE (MOBILE) - LOGICA ALLINEATA
   ========================================= */
@media (max-width: 768px) {
    .btn_sotto_desk { display: none; }
    .btn_sotto { display: block; }
    .scheda {
        width: 95%;
        margin: 10px auto;
        padding: 15px;
    }
    .h2_dettagli_prodotto {
        font-size: 22px;
        margin-top: 30px;
    }
    
    /* --- MODIFICA CRUCIALE PER ALLINEAMENTO --- */
    table {
        width: 100%;
        font-size: 14px;
        border-collapse: collapse; 
    }
    tbody { display: table-row-group; }
    tr {
        display: table-row;
        border-bottom: 1px solid #444; 
    }
    td {
        display: table-cell; /* Celle affiancate */
        width: auto;
        box-sizing: border-box;
        padding: 10px 8px;
    }
    td.label {
        width: 35%; /* Colonna titolo larga il 35% */
        border-radius: 0;
        background: #3a3a50;
    }
    td.value {
        width: auto;
        border-radius: 0;
        background: #29293a;
    }
    /* --- FINE MODIFICA --- */

    .slide img { max-width: 100%; }
    .back-link a { padding: 10px 18px; font-size: 14px; }
    .span_quantita_carrello {
        display: none;
    }

    
}
/* =========================================
   BARRA STRUMENTI (TOOLBAR) - STILE BASE
   ========================================= */
.toolbar-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px; 
    
    margin: 40px auto; 
    padding: 20px;
    width: 95%;
    max-width: 1000px;
    
    background-color: #2c2c3e; 
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); 
    border: 1px solid #444;
}

/* Stile base per i gruppi di input */
.form-group {
    display: flex;
    align-items: stretch; /* Altezza uguale per tutti gli elementi */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border-radius: 6px;
    overflow: hidden; 
}

/* Stile Base Bottoni Toolbar */
.btn_toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: white;
    transition: all 0.2s;
    height: 40px; 
}

/* Bottoni isolati (Elimina e Copia) */
.icon-only {
    width: 50px; 
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    text-decoration: none; 
}

/* =========================================
   STILE 1: FORM STANDARD (es. Costo) 
   Layout: [Input] + [Bottone]
   ========================================= */

/* Input standard (arrotondato solo a sinistra) */
.input_toolbar {
    width: 80px;
    padding: 10px;
    border: 1px solid #555;
    border-right: none; 
    background-color: #1e1e2f;
    color: #fff;
    font-size: 14px;
    text-align: center;
    outline: none;
    
}

.input_toolbar::placeholder { color: #888; font-size: 12px; }
.input_toolbar:focus { background-color: #252538; border-color: #666; }

/* Il bottone standard attaccato all'input (arrotondato a destra) */
.form-group .btn_toolbar {
    border-radius: 0 6px 6px 0; 
}


/* =========================================
   STILE 2: FORM QUANTITÀ (UNIFICATO)
   Layout: [Btn] + [Input] + [Btn]
   ========================================= */

/* Forza l'allineamento */
.form-quantity {
    display: flex;
    align-items: center;
}

/* Sovrascriviamo le regole base per il bottone sinistro (Meno) */
.btn-left {
    border-radius: 6px 0px 0px 6px !important; /* Forza stondatura sinistra */
    margin: 0 !important;
    border-right: 1px solid rgba(0,0,0,0.2); 
}

/* Input Centrale (Specifico per quantità) */
.input-center {
    border-radius: 0 !important; /* Quadrato */
    border-left: none !important;
    border-right: none !important;
    text-align: center;
    width: 60px !important; /* Più stretto del costo */
    margin: 0 !important;
    height: 40px;
    -moz-appearance: textfield; 
}
/* Nasconde freccette input number */
.input-center::-webkit-outer-spin-button,
.input-center::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Sovrascriviamo le regole base per il bottone destro (Più) */
.btn-right {
    border-radius: 0px 6px 6px 0px !important; /* Forza stondatura destra */
    margin: 0 !important;
    border-left: 1px solid rgba(0,0,0,0.2); 
}


/* =========================================
   COLORI
   ========================================= */
.btn-green { background-color: #28a745; }
.btn-green:hover { background-color: #218838; }

.btn-yellow { background-color: #ffc107; color: #212529; } 
.btn-yellow:hover { background-color: #e0a800; }

.btn-red { background-color: #dc3545; }
.btn-red:hover { background-color: #c82333; }

.btn-lime { background-color: #cddc39; color: #000; }
.btn-lime:hover { background-color: #afb42b; }

.btn-blue { background-color: #007bff; }
.btn-blue:hover { background-color: #0056b3; }
/* =========================================
   RESPONSIVE (MOBILE)
   ========================================= */
@media (max-width: 600px) {
    .toolbar-container {
        flex-direction: column; 
        gap: 15px;
        padding: 15px;
    }
    
    .form-group, .form-single, .btn_toolbar {
        width: 100%; 
    }

    /* Gestione larghezze su mobile */
    .input_toolbar { flex: 1; }
    .icon-only { width: 100%; }

    /* Fix specifico per il gruppo quantità su mobile */
    .form-quantity {
        justify-content: center; 
        width: 100%;
    }
    
    /* Su mobile i bottoni +/- non devono allargarsi al 100% come gli altri */
    .btn-left, .btn-right {
        width: auto !important; 
        flex: 0 0 50px; /* Larghezza fissa per i bottoni + e - */
    }
    .input-center {
        flex: 1; /* L'input prende lo spazio centrale */
    }
    .span_quantita_carrello {
        display: none;
    }
}

/* Bottone Carrello - STILE TECH */
.btn_cart_submit {
    height: 40px;
    padding: 0 20px;
    margin-left: 10px;
    
    background-color: #ffc107;
    color: #212529; /* Grigio scuro quasi nero */
    
    border: 2px solid #e0a800; /* Bordo sottile per definizione */
    border-radius: 6px; /* Stesso raggio degli input */
    
    font-family: "Heebo", sans-serif;
    font-size: 15px;
    font-weight: bold;
    
    cursor: pointer;
    
    transition: all 0.1s;
    
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn_cart_submit:hover {
    background-color: #ffca2c;
    transform: translateY(-2px);
    
}

.btn_cart_submit:active {
    transform: translateY(4px); /* Si schiaccia giù */
    box-shadow: 0 0 0 #c69500; /* L'ombra sparisce */
}
/* --- RESPONSIVE PER IL BOTTONE CARRELLO --- */
@media (max-width: 600px) {
    /* Il bottone diventa largo tutto lo schermo su mobile */
    .btn_cart_submit {
        width: 100%; 
        margin-left: 0; /* Toglie il distanziamento laterale da PC */
        margin-top: 15px; /* Aggiunge spazio sopra */
        justify-content: center; /* Centra bene testo e icona */
    }
    
    /* Centra anche il gruppo quantità */
    .form-quantity {
        width: 100%;
        justify-content: center;
    }
    .span_quantita_carrello {
        display: none;
    }
}