@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;
}

/* Navbar fissa */
.cart-btn {
    position: fixed;
    top: 80px;
    right: 20px;
    background-color: #ffc107;
    color: #3a3a50;
    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:hover {
    background: rgb(235, 157, 40);
    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 {
    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;
}

h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #00bcd4;
}

.h2_dettagli_prodotto {
    margin-top: 100px;   
}

/* TABLE STYLES */
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;
}

.contactform-link {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 30px;
}
.contactform-link a {
    background-color: rgb(51, 182, 247);
    color: #fff;
    padding: 5px 10px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.3s;
}
.contactform-link a:hover {
    background-color: rgb(5, 119, 205);
}

.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: 80%;
    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: 300px;
    height: auto;
    margin: 0 auto;
    display: block;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.4);
    object-fit: contain;
}

.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 */
.offerta{
    color: #ff6347;
    animation: affarissimo 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);}
}

.fuoco_sx{ color: #ff6347; animation: fuoco_sx 1.5s infinite; }
.fuoco_dx{ color: #ff6347; animation: fuoco_dx 1s infinite; }

.label_offerte {
    padding: 5px;
    width: 80px;
    height: 30px;
    text-align: center;
    background: #333;
    color: #00bcd4;
    border: 1px solid #555;
}
.input_carrello {
    padding: 5px;
    width: 10px;
    height: 20px;
    text-align: center;
    background: #333;
    color: #fff;
    border: 1px solid #555;
}



/* =========================================
   RESPONSIVE (MOBILE)
   ========================================= */
@media (max-width: 768px) {
    .header_nav{
        width: 100%;
    }

    .scheda {
        width: 95%; /* Un po' di margine laterale */
        margin: 10px auto;
        margin-top: 20px; /* Distanza dal carrello o header */
        padding: 15px;
        padding-top: 20px;
    }

    .h2_dettagli_prodotto {
        font-size: 22px;
        margin-top: 30px; /* Reset margine top eccessivo su mobile */
    }

    .offerta {
        font-size: 15px;
    }

    /* Tabella Mobile: Stile Allineato (Titolo - Caratteristica sulla stessa riga) */
    table {
        width: 100%;
        font-size: 14px;
        border-collapse: collapse; 
    }
    
    tbody {
        display: table-row-group;
    }

    tr {
        display: table-row;
        margin-bottom: 0;
        border-bottom: 1px solid #444; 
    }

    td {
        display: table-cell; /* Cruciale per l'allineamento */
        width: auto;
        box-sizing: border-box;
        padding: 10px 8px;
    }

    td.label {
        width: 35%; /* Mantiene la larghezza per allineare i titoli */
        border-radius: 0;
        background: #3a3a50;
    }

    td.value {
        width: auto;
        border-radius: 0;
        background: #29293a;
    }

    /* Slider Mobile */
    .slide img {
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    /* Link */
    .back-link a {
        padding: 10px 18px;
        font-size: 14px;
        display: inline-block;
    }
    
    /* Adatta il bottone carrello per non coprire troppo */
    .cart-btn {
        top: 70px; /* Un po' più su se serve */
        right: 10px;
        padding: 8px 12px;
        font-size: 0.9em;
    }
    .div_carrello_sotto{
        width: 70%;
        margin: auto;
    }
}
/* EXTRA */
    .kit_personalizza {
color: #e37f14;
    }

/* =========================================
   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;
    }

}
/* --- RESPONSIVE PER IL CARRELLO (Mobile) --- */
@media (max-width: 600px) {
    
    /* 1. Il contenitore principale occupa tutto lo spazio */
    .div_carrello_sotto {
        width: 100%;
        padding: 0 10px;
    }

    /* 2. Il form si occupa di centrare gli elementi */
    .div_carrello_sotto form {
        width: 100%;
        justify-content: center;
    }

    /* 3. MODIFICA RICHIESTA: Il gruppo Quantità occupa solo il 60% */
    .form-quantity {
        width: 60% !important;  /* Larghezza ridotta come richiesto */
        min-width: 180px;       /* Sicurezza per schermi piccolissimi */
        margin: 0 auto;         /* Si centra orizzontalmente */
        justify-content: center;
    }

    /* Assicuriamoci che l'input centrale non diventi gigante */
    .form-quantity .input-center {
        width: auto !important; /* Lascia che si adatti allo spazio rimanente */
        flex: 1;                /* Occupa lo spazio tra i bottoni nel 60% disponibile */
        min-width: 40px;        /* Larghezza minima per leggere il numero */
    }

    /* 4. Il bottone Aggiungi Carrello (resta al 70% come piaceva a te) */
    .btn_cart_submit {
        width: 70% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-top: 15px;
        
        display: flex;
        justify-content: center;
    }
    .span_quantita_carrello {
        display: none;
    }
}