/* 
 * Progetto: mondokey.store 
 * Autore: MONDOKEY.COM
 */

:root {
    --primary: #2b59c3;        /* Blu Hero */
    --primary-dark: #1e42a3;
    --accent: #ffc107;         /* Giallo pulsanti */
    --accent-hover: #e0a800;
    --success: #10b981;        /* Verde per salvataggio */
    --text-dark: #222;
    --text-light: #555;
    --bg-light: #f8fafc;       /* Grigio chiarissimo sfondo */
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Reset Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- HEADER & NAVIGAZIONE --- */
.main-header {
    background: var(--primary);
    padding: 1rem 0;
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--white);
    text-decoration: none;
    letter-spacing: -0.5px;
}

nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.balance-tag {
    background: rgba(255,255,255,0.15);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.btn-yellow-sm {
    background: var(--accent);
    color: var(--text-dark) !important;
    padding: 8px 18px;
    border-radius: 50px;
}

/* --- SEZIONE HERO --- */
.hero-blue {
    background: var(--primary);
    color: var(--white);
    padding: 100px 0;
    text-align: center;
}

.hero-blue h1 {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-yellow {
    background: var(--accent);
    color: var(--text-dark);
    padding: 16px 32px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 800;
    transition: transform 0.2s, background 0.2s;
}

.btn-yellow:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-outline {
    border: 2px solid rgba(255,255,255,0.4);
    color: var(--white);
    padding: 16px 32px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
}

/* --- FEATURES GRID (Allineamento corretto) --- */
.features {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 40px;
}

.feature-grid {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.f-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    flex: 1;
    min-width: 300px;
    max-width: 380px;
}

/* --- AREA ADMIN & BOTTONI AVANZATI --- */
.admin-container { padding: 40px 0; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }

.admin-card {
    background: var(--white);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus { border-color: var(--primary); }

/* Pulsanti Admin Professionali */
.btn-admin {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-save-prod {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-save-prod:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.btn-update-user {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(43, 89, 195, 0.25);
}

.btn-update-user:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(43, 89, 195, 0.35);
}

/* --- TABELLE LOG --- */
.table-wrapper { overflow-x: auto; margin-top: 20px; border-radius: 10px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: 15px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { background: #f1f5f9; font-weight: 700; color: var(--text-light); }

/* --- FOOTER (Differenziato) --- */
.site-footer {
    background: #ffffff;
    border-top: 1px solid var(--border);
    padding: 60px 0 30px 0;
    margin-top: 80px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-grid { grid-template-columns: 1fr; }
    .hero-blue h1 { font-size: 2.2rem; }
    .hero-actions { flex-direction: column; }
}

/* Responsive Grid per i prodotti */
@media (max-width: 1024px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* 2 prodotti su tablet */
    }
}

@media (max-width: 600px) {
    .feature-grid {
        grid-template-columns: repeat(1, 1fr) !important; /* 1 prodotto su smartphone */
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    h1 { font-size: 1.8rem; } /* Titoli più piccoli su mobile */
}

/* Fix per le card prodotti su mobile */
.f-card {
    width: 100%;
    box-sizing: border-box;
}

/* Stile Sezione Come Funziona */
.how-it-works {
    background: #f8faff;
    padding: 50px 0;
    border-bottom: 1px solid #eef2f7;
}

.steps-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.step-card {
    background: #fff;
    padding: 30px 20px;
    border-radius: 20px;
    text-align: center;
    flex: 1;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 112, 186, 0.05);
    border: 1px solid #eef2f7;
    transition: transform 0.3s ease;
}

.step-card:hover {
    transform: translateY(-5px);
    border-color: #0070ba;
}

.step-number {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffcc00;
    color: #0070ba;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(255, 204, 0, 0.3);
}

.step-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.step-card h3 {
    font-size: 1.1rem;
    color: #0070ba;
    margin-bottom: 10px;
}

.step-card p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.step-arrow {
    font-size: 2rem;
    color: #0070ba;
    opacity: 0.3;
    font-weight: bold;
}

/* Responsive per il box passi */
@media (max-width: 900px) {
    .steps-grid {
        flex-direction: column;
    }
    .step-arrow {
        transform: rotate(90deg);
        margin: 10px 0;
    }
    .step-card {
        width: 100%;
        max-width: 400px;
    }
}

/* --- FIX DEFINITIVO MENU MOBILE --- */
.menu-toggle {
    display: none; /* Nascosto su desktop */
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: white;
    border-radius: 3px;
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column !important; /* Logo sopra */
        align-items: center !important;
        padding: 15px 0 !important;
    }

    .menu-toggle {
        display: flex !important; /* Mostra l'hamburger sotto il logo */
        margin: 10px 0 !important;
    }

    .nav-links {
        display: none !important; /* FORZA LA CHIUSURA DI DEFAULT */
        flex-direction: column !important;
        width: 100% !important;
        background-color: #0070ba !important; /* Colore blu originale */
        padding: 20px 0 !important;
        gap: 15px !important;
        text-align: center !important;
    }

    /* Si apre SOLO quando clicchi */
    .nav-links.active {
        display: flex !important;
    }
}

.add-product-card { 
        max-width: 1000px; 
        margin: 20px auto; 
    }
    .add-product-form {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        align-items: flex-end;
    }
    .form-group { flex: 1; min-width: 200px; }
    .form-group.desc { flex: 2; min-width: 300px; }
    .form-group input, .form-group textarea {
        width: 100%;
        padding: 10px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: #f8fafc;
        box-sizing: border-box;
    }