/* --- BASI --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    background-color: #f0f7f4; 
    color: #2d3436; 
    font-family: 'Inter', sans-serif; 
    overflow-x: hidden;
}

/* --- BARRA NAVIGAZIONE --- */
.top-nav { width: 100%; padding: 30px 0; text-align: center; }
.nav-container { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }
.nav-container a { 
    text-decoration: none; 
    color: #1a2a6c; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    font-size: 0.9rem; 
    transition: opacity 0.3s;
}
.nav-container a:hover { opacity: 0.5; }

/* --- HEADER PAGINA --- */
.category-header {
    padding: 60px 20px 20px; 
    text-align: center;
    width: 100%;
}
.category-title {
    font-size: 6rem; 
    font-weight: 100;
    color: #1a2a6c;
    letter-spacing: -2px;
    text-transform: uppercase;
    display: block;
    width: 100%;
}

/* --- GRIGLIA ORDINATA --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 60px; 
    padding: 20px 5% 40px; 
    max-width: 1800px; 
    margin: 0 auto;
    align-items: center; 
}

.artwork-card {
    transition: opacity 0.5s ease-in;
    width: 100%;
}

/* --- STILE CORNICI (12 COLORI PASTELLO DISTINTI) --- */
.frame {
    background-color: #000000 !important;
    padding: 3px;
    border: 18px solid; 
    border-radius: 12px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.p-1  { border-color: #FFB7B2 !important; } /* Rosa Salmone */
.p-2  { border-color: #B2E2F2 !important; } /* Azzurro Ghiaccio */
.p-3  { border-color: #FDFD96 !important; } /* Giallo Pastello */
.p-4  { border-color: #B2F2BB !important; } /* Verde Menta */
.p-5  { border-color: #D1B2F2 !important; } /* Lavanda */
.p-6  { border-color: #F2D1B2 !important; } /* Arancio Pesca */
.p-7  { border-color: #B2B2F2 !important; } /* Periwinkle */
.p-8  { border-color: #F2B2D1 !important; } /* Rosa Confetto */
.p-9  { border-color: #E2F2B2 !important; } /* Lime Chiarissimo */
.p-10 { border-color: #B2F2E2 !important; } /* Turchese Pastello */
.p-11 { border-color: #F2B2B2 !important; } /* Rosso Corallo Tenue */
.p-12 { border-color: #D1D1D1 !important; } /* Grigio Perla */

.frame:hover { transform: scale(1.03); }
.frame img { width: 100%; height: auto; display: block; border-radius: 2px; }

.artwork-info { text-align: center; margin-top: 20px; }
.artwork-info h3 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 2px; font-weight: 600; }

/* --- BOTTONE CONTINUA --- */
.cta-container { text-align: center; padding: 40px 0 80px; }
.btn-continue { 
    text-decoration: none; 
    color: #1a2a6c; 
    border: 1.5px solid #1a2a6c; 
    padding: 18px 50px; 
    text-transform: uppercase; 
    letter-spacing: 4px;
    background: transparent;
    cursor: pointer; 
    font-family: inherit; 
    font-size: 1.1rem;
    transition: all 0.3s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 1025px) {
    .btn-continue:hover { 
        background-color: #1a2a6c; 
        color: #f0f7f4; 
    }
}

/* --- TASTO TORNA SU --- */
#backToTop {
    display: none; /* Inizialmente nascosto */
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    width: 50px;
    height: 50px;
    border: 1.5px solid #1a2a6c;
    background-color: #f0f7f4;
    color: #1a2a6c;
    cursor: pointer;
    border-radius: 50%;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#backToTop:hover {
    background-color: #1a2a6c;
    color: #f0f7f4;
}

/* --- FOOTER --- */
footer { padding: 60px 0; text-align: center; border-top: 1px solid rgba(0,0,0,0.05); }
.footer-icons { display: flex; justify-content: center; gap: 15px; margin-bottom: 20px; }
.social-icon { 
    width: 50px; height: 50px; border: 1.5px solid #1a2a6c; 
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; color: #1a2a6c; font-size: 0.75rem; font-weight: 600;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .category-title { font-size: 3rem; letter-spacing: 2px; text-align: center; }
    .category-header { padding: 40px 10px 10px; }
    .category-grid { grid-template-columns: 1fr; gap: 40px; padding: 20px 10%; }
    .frame { border-width: 12px; }
    .btn-continue:active, .btn-continue:focus { background-color: transparent; color: #1a2a6c; }
    
    #backToTop {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* --- STILE BANNER COOKIE --- */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95); /* Nero quasi totale */
    color: #ffffff;
    padding: 15px 25px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    z-index: 10000; /* Lo tiene sopra a tutto */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    border-top: 1px solid #333;
}

#cookie-banner p {
    margin: 0;
    line-height: 1.4;
}

#cookie-banner button {
    background: #ffffff;
    color: #000000;
    border: none;
    padding: 8px 20px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 1px;
    transition: background 0.3s;
    margin-left: 20px;
    white-space: nowrap; /* Evita che il testo del bottone vada a capo */
}

#cookie-banner button:hover {
    background: #cccccc;
}

/* OTTIMIZZAZIONE MOBILE */
@media (max-width: 600px) {
    #cookie-banner {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    #cookie-banner button {
        margin-left: 0;
        width: 100%;
    }
}