/* =========================================
   STILE DARK MODERN - CARRELLO DEFINITIVO
   ========================================= */
:root {
    --bg-body: #1e1e2f;
    --bg-card: #27293d;
    --bg-darker: #1d1e26;
    --text-main: #e0e0e0;
    --border: #3e3e4f;
    --accent: #00e676;
    --gold: #fec849;
    --danger: #ff5252;
    --info-blue: #29b6f6;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-body); 
    color: var(--text-main);
    font-family: 'Heebo', sans-serif;
    margin: 0;
    font-size: 16px;
}

.container {
    max-width: 1200px; /* Allargato leggermente per PC */
    margin: 40px auto;
    padding: 30px;
    background-color: var(--bg-card); 
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    border: 1px solid var(--border);
}

h1 { text-align: center; margin-bottom: 30px; color: #fff; text-transform: uppercase; letter-spacing: 1px; }

/* --- MESSAGGI ALERT --- */
.alert-success { background: rgba(0,230,118,0.15); border: 1px solid var(--accent); color: var(--accent); padding: 15px; border-radius: 8px; text-align: center; margin-bottom: 20px;}
.alert-error { background: rgba(255,82,82,0.15); border: 1px solid var(--danger); color: var(--danger); padding: 15px; border-radius: 8px; text-align: center; margin-bottom: 20px;}
.empty-message { text-align: center; color: var(--gold); font-size: 1.4rem; padding: 40px; border: 2px dashed var(--border); }

/* --- BOX REGISTRAZIONE (Migliorato) --- */
.rigistrazione {
    background-color: rgba(41, 182, 246, 0.1); /* Sfondo azzurro tenue */
    border-left: 4px solid var(--info-blue);
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    text-align: center;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
}
.rigistrazione a {
    color: var(--info-blue);
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    margin-left: 5px;
    border-bottom: 1px dashed var(--info-blue);
    transition: 0.3s;
}
.rigistrazione a:hover { color: #fff; background-color: var(--info-blue); padding: 2px 5px; border-radius: 4px; }


/* --- TABELLA PC --- */
table { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 30px; }

th {
    background-color: var(--bg-darker); color: var(--accent); text-transform: uppercase;
    padding: 18px; border-bottom: 2px solid var(--border); font-size: 0.85rem; letter-spacing: 0.5px;
}

td {
    background-color: var(--bg-card); padding: 20px 15px; vertical-align: middle;
    border-bottom: 1px solid var(--border); text-align: center; color: #fff;
}

/* Immagini (Ingrandite) */
.img_carrello { 
    width: 90px; height: 90px; /* Più grandi su PC */
    object-fit: cover; border-radius: 8px; border: 2px solid #444; 
    transition: transform 0.2s;
}
.img_carrello:hover { border-color: var(--accent); transform: scale(1.05); }

.td_nome { font-weight: bold; text-align: left; color: #fff; font-size: 1.1rem; padding-left: 20px; }
.box_vedi_prodotto { text-decoration: none; }


/* --- QUANTITA' E BOTTONI (Stile Admin) --- */

/* Wrapper che tiene input e bottone aggiorna vicini */
.qty-action-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Selettore Quantità [ - 1 + ] */
.qty-selector { 
    display: flex; 
    align-items: center; 
    background: #1e1e2f; 
    border: 1px solid #555; 
    border-radius: 6px; 
    height: 40px; /* Altezza comoda */
    overflow: hidden;
}

.qty-btn { 
    width: 35px; 
    height: 100%; 
    background-color: #3a3a50; 
    color: white; 
    border: none; 
    cursor: pointer; 
    font-weight: bold; 
    font-size: 18px; 
    transition: 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { background-color: #50506b; }

.qty-input { 
    width: 50px; 
    height: 100%;
    text-align: center; 
    border: none; 
    background: transparent; 
    color: white; 
    font-weight: bold; 
    font-size: 16px; 
    margin: 0; 
    -moz-appearance: textfield; 
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }


/* STILE BOTTONI AZIONE (Compatto per PC) */
.btn-cart-card { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    height: 40px; /* Stessa altezza del selettore */
    padding: 0 15px; 
    border-radius: 6px; 
    text-decoration: none; 
    font-weight: bold; 
    font-size: 13px; 
    text-transform: uppercase;
    transition: 0.3s; 
    border: none; 
    cursor: pointer; 
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    white-space: nowrap;
}
.btn-cart-card:hover { filter: brightness(1.15); transform: translateY(-2px); }

/* Varianti Colore */
.btn-update { 
    background: linear-gradient(135deg, #ffca28, #ff8f00); 
    color: #222; /* Testo scuro su giallo */
}
.btn-remove { 
    background: linear-gradient(135deg, #ff5252, #c62828); 
    color: #fff;
}


/* --- FOOTER TABELLA --- */
tfoot td { background-color: var(--bg-darker); font-weight: bold; padding: 15px; font-size: 1.1rem; }
.footer-label { text-align: right; color: #aaa; padding-right: 20px;}
.footer-value { text-align: center; color: var(--accent); }
.total-row .footer-value { color: var(--gold); font-size: 1.5rem; }


/* --- BOTTONI GRANDI (Checkout) --- */
.btn_paypal_acquisto, .btn_procedi_acquisto, .btn_modifica_dati, .btn-preventivo, .btn-danger {
    display: flex; justify-content: center; align-items: center;
    width: 100%; max-width: 350px; margin: 20px auto; padding: 18px;
    font-size: 1rem; font-weight: 800; border: none; border-radius: 50px;
    cursor: pointer; color: #fff; text-transform: uppercase; box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    text-decoration: none;
}
.btn_paypal_acquisto { background: linear-gradient(90deg, #0070ba, #003087); }
.btn_procedi_acquisto { background: linear-gradient(90deg, #00e676, #00c853); color: #1e1e2f; }
.btn-preventivo { background: linear-gradient(135deg, #9c27b0, #6a1b9a); border: 1px solid rgba(255,255,255,0.1); }
.btn_modifica_dati { background: linear-gradient(90deg, #42a5f5, #1e88e5); }
.btn-danger { background: linear-gradient(135deg, #ff5252, #d32f2f); max-width: 250px; margin-top: 40px; opacity: 0.9; }

.btn_paypal_acquisto:hover, .btn_procedi_acquisto:hover, .btn-preventivo:hover, .btn-danger:hover { 
    transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.5); 
}


/* --- FORM DATI UTENTE --- */
input[type="text"], input[type="email"], textarea { 
    width: 100%; padding: 12px; background: #181824; color: #fff; 
    border: 1px solid #444; border-radius: 8px; margin-bottom: 12px; 
}
.shipping-info-inline { background: rgba(255,255,255,0.05); border: 1px dashed #555; padding: 20px; border-radius: 10px; text-align: center; margin-top: 20px; color: #ccc; }
.hidden { display: none; }
.h3_spedizione { text-align: center; color: var(--gold); margin: 25px 0 15px 0; font-weight: 600; border-bottom: 1px dashed var(--border); padding-bottom: 10px; }


/* =========================================
   RESPONSIVE (MOBILE)
   ========================================= */
@media (max-width: 768px) {
    .container { width: 100%; margin: 0; padding: 10px; border: none; box-shadow: none; background: var(--bg-body); }
    
    table, thead, tbody, th, td, tr { display: block; width: 100%; }
    thead { display: none; }

    tbody tr {
        background: var(--bg-card); margin-bottom: 15px; border-radius: 12px;
        border: 1px solid var(--border); padding: 15px; position: relative;
    }

    td {
        display: flex; justify-content: space-between; align-items: center;
        text-align: right; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    td:last-child { border-bottom: none; }

    td::before {
        content: attr(data-label); font-weight: bold; text-transform: uppercase;
        color: #aaa; font-size: 0.75rem; letter-spacing: 1px;
    }

    /* Immagine */
    td[data-label="Prodotto"] { justify-content: center; padding-bottom: 5px; border-bottom: none; }
    td[data-label="Prodotto"]::before { display: none; }
    .img_carrello { width: 110px; height: 110px; } /* Ancora più grandi su mobile */

    /* Nome */
    td[data-label="Nome"] { justify-content: center; text-align: center; color: var(--gold); border-bottom: 1px solid var(--border); padding-bottom: 15px; font-size: 1.2rem; padding-left: 0; }
    td[data-label="Nome"]::before { display: none; }

    /* Layout Quantità Mobile */
    td[data-label="Quantità"] {
        flex-direction: row; 
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }
    
    /* Su mobile i bottoni si adattano */
    .qty-action-row { width: auto; }
    
    /* Bottone Rimuovi */
    td[data-label=""] form { width: 100%; }
    .btn-remove { width: 100%; margin-top: 5px; }

    /* Footer */
    tfoot { display: block; margin-top: 15px; background: transparent; padding: 0; }
    .footer-row { display: flex; justify-content: space-between; align-items: center; background: var(--bg-card); padding: 15px; margin-bottom: 10px; border-radius: 8px; border: 1px solid var(--border); }
    .footer-row td { padding: 0; border: none; background: transparent; width: auto; display: block; }
    .footer-label { text-align: left; padding-right: 0; }
    .footer-value { text-align: right; }
    tfoot td[colspan="5"] { width: auto; }
}