* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background-color: #f1f5f9; color: #1e293b; display: flex; min-height: 100vh; }

.sidebar { width: 320px; background-color: #0f172a; color: #f8fafc; padding: 20px; overflow-y: auto; height: 100vh; position: fixed; left: 0; top: 0; box-shadow: 4px 0 10px rgba(0,0,0,0.1); }
.sidebar h3 { font-size: 16px; color: #38bdf8; margin-bottom: 20px; border-bottom: 1px solid #334155; padding-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }

.macro-btn { background: none; border: none; color: #f1f5f9; width: 100%; text-align: left; padding: 10px 5px; font-size: 14px; font-weight: bold; cursor: pointer; display: flex; justify-content: space-between; border-bottom: 1px solid #1e293b; }
.macro-btn:hover { color: #38bdf8; }
.sub-container { display: none; padding-left: 15px; margin-top: 5px; }

.sotto-btn { background: none; border: none; color: #cbd5e1; width: 100%; text-align: left; padding: 8px 5px; font-size: 13px; cursor: pointer; display: flex; justify-content: space-between; }
.sotto-btn:hover { color: #34d399; }
.dettaglio-container { display: none; padding-left: 15px; }

.foglia-link { display: block; color: #94a3b8; padding: 6px 5px; font-size: 12px; text-decoration: none; cursor: pointer; }
.foglia-link:hover, .foglia-link.active-item { color: #ffffff; background-color: #1e293b; border-radius: 4px; font-weight: bold; }

.main-content { margin-left: 320px; flex: 1; padding: 40px; overflow-y: auto; }
.header-portale { background: white; padding: 25px; border-radius: 8px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); margin-bottom: 30px; border-left: 5px solid #2563eb; }
.header-portale h1 { font-size: 24px; color: #0f172a; margin-bottom: 5px; }
.header-portale p { color: #64748b; font-size: 14px; }

.search-wrapper { margin-bottom: 25px; }
.search-input { width: 100%; padding: 15px 20px; font-size: 16px; border: 2px solid #cbd5e1; border-radius: 8px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); outline: none; }
.search-input:focus { border-color: #2563eb; }

.grid-prodotti { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; }
.card-prod { background: white; border-radius: 8px; border: 1px solid #e2e8f0; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); transition: transform 0.2s; }
.card-prod:hover { transform: translateY(-3px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }

.img-wrapper { width: 100%; height: 160px; display: flex; align-items: center; justify-content: center; margin-bottom: 15px; background: #fff; }
.img-prod { max-width: 100%; max-height: 100%; object-fit: contain; }

.prod-titolo { font-size: 14px; font-weight: bold; color: #0f172a; margin-bottom: 8px; min-height: 40px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-codice { font-size: 11px; background: #e2e8f0; color: #334155; padding: 3px 8px; border-radius: 4px; display: inline-block; font-family: monospace; margin-bottom: 12px; }
.prod-desc { font-size: 12px; color: #64748b; margin-bottom: 15px; line-height: 1.4; }

.footer-card { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #f1f5f9; padding-top: 15px; margin-top: auto; }
.prod-prezzo { font-size: 20px; font-weight: bold; color: #dc2626; }
.btn-wa { background-color: #25d366; color: white; text-decoration: none; padding: 8px 14px; border-radius: 6px; font-size: 12px; font-weight: bold; cursor: pointer; border: none; }
.btn-wa:hover { background-color: #22c55e; }

.briciola { font-size: 14px; color: #2563eb; font-weight: bold; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.5px; }

.stato-caricamento { text-align: center; padding: 60px 20px; color: #64748b; font-size: 14px; }

.footer-legale { text-align: center; padding: 25px 20px 10px; margin-top: 20px; font-size: 12px; color: #94a3b8; border-top: 1px solid #e2e8f0; }
.footer-legale p { margin-bottom: 4px; }
.footer-legale a { color: #64748b; text-decoration: underline; }
.footer-legale a:hover { color: #2563eb; }

.cookie-banner {
    display: none;
    position: fixed;
    bottom: 16px;
    right: 16px;
    max-width: 240px;
    background: white;
    color: #334155;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    z-index: 10000;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.cookie-banner.mostra { opacity: 1; }
.cookie-banner p { font-size: 11px; line-height: 1.4; margin: 0; color: #64748b; }
.cookie-banner-azioni { display: flex; gap: 6px; }
.cookie-btn { flex: 1; padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 5px; font-size: 11px; font-weight: bold; cursor: pointer; }
.cookie-btn-accetta { background: #2563eb; color: white; border-color: #2563eb; }
.cookie-btn-accetta:hover { background: #1d4ed8; }
.cookie-btn-rifiuta { background: white; color: #64748b; }
.cookie-btn-rifiuta:hover { background: #f8fafc; }
.cookie-banner-link { font-size: 10px; color: #94a3b8; text-decoration: underline; align-self: center; }
.cookie-banner-link:hover { color: #2563eb; }

@media (max-width: 480px) {
    .cookie-banner { right: 10px; left: 10px; max-width: none; bottom: 10px; }
}
