/* ================================================= */
/* Variabili e Stili Globali                */
/* ================================================= */
:root {
    --primary-color: #00487d; /* Blu acceso (Brand) */
    --secondary-color: #99bdd7; /* Verde complementare (CTA) */
    --text-color: #333;
    --background-light: #f8f9fa;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: white;
}

h2 {
    letter-spacing: 0.1em;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Pulsanti Generici --- */
.btn-primary {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

    .btn-primary:hover {
        background-color: var(--primary-color);
        color: white;
    }

.btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
}

    .btn-secondary:hover {
        background-color: var(--primary-color);
        color: white;
    }

/* ================================================= */
/* Header e Navigazione                     */
/* ================================================= */
header {
    background-color: white;
    /* Ombra più pronunciata e moderna */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    position: sticky; /* Rende l'header fisso in cima */
    top: 0;
    z-index: 1000;
}

/* Contenitore principale (Logo a Sinistra, Menu a Destra) */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

/* Stili Logo Immagine */
.logo-link {
    display: flex;
    align-items: center;
    height: 100%;
}

.site-logo {
    height: 70px;
    width: auto;
    max-width: 300px;
    transition: transform 0.3s ease-in-out;
}

    .site-logo:hover {
        transform: scale(1.05);
    }

/* Stile dei Link di Navigazione */
.nav-links {
    display: flex;
    gap: 25px;
    align-items: center;
}

    .nav-links a {
        color: var(--text-color);
        text-decoration: none;
        font-weight: 600;
        padding: 8px 0;
        position: relative;
        transition: color 0.3s;
    }
        .nav-links a.btn-primary {
            color: white;
        }

        /* Effetto Underline Animato */
        .nav-links a:not(.btn-primary)::after {
            content: '';
            position: absolute;
            width: 0;
            height: 3px;
            bottom: -5px;
            left: 0;
            background-color: var(--secondary-color);
            transition: width 0.3s ease-out;
        }

        .nav-links a:not(.btn-primary):hover {
            color: var(--primary-color);
        }

            .nav-links a:not(.btn-primary):hover::after {
                width: 100%;
            }

    .nav-links .btn-primary {
        padding: 8px 18px;
        font-size: 1em;
    }

/* Nascondi hamburger su desktop */
.hamburger-menu {
    display: none;
}

/* ================================================= */
/* Hero Section (con immagine)              */
/* ================================================= */
.hero-section {
    background-image: url('../images/hero-background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 100px 0;
    text-align: center;
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    /* Overlay scuro per leggibilità */
    .hero-section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1;
    }

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

    .hero-content h1 {
        font-size: 3.5em;
        margin-bottom: 20px;
        font-weight: 900;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    }

    .hero-content p {
        font-size: 1.3em;
        margin-bottom: 40px;
        opacity: 0.95;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
    }

.hero-buttons a {
    margin: 0 15px;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 50px;
    transition: transform 0.3s, background-color 0.3s;
}

.hero-buttons .btn-primary.large {
    background-color: var(--secondary-color);
    color: white;
    border: none;
}

    .hero-buttons .btn-primary.large:hover {
        background-color: #1e7e34;
        transform: translateY(-3px);
    }

.hero-buttons .btn-secondary.large {
    background-color: transparent;
    border: 2px solid white;
    color: white;
}

    .hero-buttons .btn-secondary.large:hover {
        background-color: rgba(255, 255, 255, 0.1);
        transform: translateY(-3px);
    }


/* --- Feature Cards (Homepage) --- */
.features-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 50px 0;
    text-align: center;
}

.feature-card {
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

/* ================================================= */
/* CTA Newsletter (Accattivante)            */
/* ================================================= */
.cta-newsletter-section {
    background-color: var(--primary-color);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
}

.cta-icon {
    font-size: 3em;
    color: var(--secondary-color);
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

.cta-content h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 800;
}

.cta-content p {
    font-size: 1.2em;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn-cta-primary {
    display: inline-block;
    padding: 15px 35px;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: bold;
    letter-spacing: 1px;
    transition: background-color 0.3s, transform 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

    .btn-cta-primary:hover {
        background-color: #1e7e34;
        transform: translateY(-2px);
    }

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* ================================================= */
/* Pagine Lista (Libri/App)                 */
/* ================================================= */
.page-list {
    padding-top: 50px;
    padding-bottom: 50px;
}

    .page-list h2 {
        font-size: 2em;
        color: var(--primary-color);
        margin-bottom: 5px;
    }

.subtitle {
    font-size: 1.1em;
    color: #6c757d;
    margin-bottom: 30px;
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.item-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: transform 0.3s;
}

    .item-card:hover {
        transform: translateY(-5px);
    }

.item-cover {
    height: 100%;
    max-height: 200px;
    width: auto;
    border-radius: 4px;
    margin-bottom: 15px;
}

.item-cover-border {
    border: 1px solid gray;
}


.app-card .item-icon {
    font-size: 3em;
    color: var(--secondary-color);
    margin: 10px 0 15px 0;
}

/* ================================================= */
/* Dettaglio Libro/App (Responsive)         */
/* ================================================= */
.book-detail-section {
    padding: 50px 0;
}

.book-detail-layout {
    display: flex;
    gap: 40px;
}

.book-cover-sidebar {
    flex: 0 0 350px;
    text-align: center;
}

.book-cover-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.book-price-actions {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.price {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.full-width {
    display: block;
    margin-bottom: 10px;
}

.book-info-content {
    flex-grow: 1;
}

.category-tag {
    background-color: var(--secondary-color);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
}

.rating i {
    color: #ffc107;
}

.detail-tabs {
    margin: 30px 0 15px 0;
    border-bottom: 2px solid #ddd;
}

    .detail-tabs a {
        padding: 10px 20px;
        background: none;
        border: none;
        cursor: pointer;
        font-weight: bold;
        color: #6c757d;
        border-bottom: 3px solid transparent;
        transition: all 0.3s;
    }

        .detail-tabs a.active {
            color: var(--primary-color);
            border-bottom: 3px solid var(--primary-color);
        }

.tab-content {
    display: none;
    padding: 20px 0;
}

    .tab-content.active {
        display: block;
    }

/* Stili App Detail */
.app-info-sidebar {
    align-self: flex-start;
}

.app-icon-large {
    font-size: 6em;
    color: var(--primary-color);
    margin-bottom: 20px;
}


/* ================================================= */
/* Pagine Form (Newsletter/Contatti)        */
/* ================================================= */

.page-form {
    padding-top: 50px;
    padding-bottom: 50px;
}

.form-section {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--background-light);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

.simple-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

    .form-group label {
        display: block;
        font-weight: bold;
        margin-bottom: 5px;
    }

    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group textarea {
        width: 100%;
        padding: 10px;
        border: 1px solid #ced4da;
        border-radius: 5px;
    }

.checkbox-group {
    display: flex;
    align-items: center;
}

    .checkbox-group input {
        width: auto;
        margin-right: 10px;
    }

/* Stili per Contatti */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.contact-info ul {
    list-style: none;
    padding: 0;
}

.contact-info li {
    margin-bottom: 15px;
    font-size: 1.1em;
}

.contact-info i {
    color: var(--primary-color);
    margin-right: 10px;
}


/* ================================================= */
/* Footer Accattivante                      */
/* ================================================= */
footer {
    background-color: #00264e;
    color: #f8f9fa;
    padding-top: 50px;
    font-size: 0.95em;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #3a3f44;
}

.footer-col h3 {
    font-size: 1.2em;
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-weight: 700;
}

.footer-about .logo {
    color: white;
    font-size: 1.8em;
    display: block;
    margin-bottom: 15px;
}

.footer-about p {
    line-height: 1.6;
    color: #ced4da;
}

.footer-links ul, .footer-info ul {
    list-style: none;
    padding: 0;
}

.footer-links li, .footer-info li {
    margin-bottom: 10px;
}

.footer-links a, .footer-info a {
    color: #ced4da;
    text-decoration: none;
    transition: color 0.3s;
}

    .footer-links a:hover, .footer-info a:hover {
        color: var(--primary-color);
    }

.footer-info i {
    margin-right: 8px;
    color: var(--primary-color);
}

.footer-logo {
    font-size: 1.8em; /* Più grande */
    font-weight: 900; /* Molto grassetto */
    color: white;
    text-decoration: none;
    letter-spacing: -0.5px; /* Rende il testo più compatto */
    padding: 5px 0; /* Aggiunge un po' di spazio verticale per centrarlo */
}


.social-icons a {
    color: white;
    font-size: 1.5em;
    margin-right: 15px;
    transition: color 0.3s;
}

    .social-icons a:hover .fa-facebook-f {
        color: #3b5998;
    }

    .social-icons a:hover .fa-instagram {
        color: #E1306C;
    }

    .social-icons a:hover .fa-youtube {
        color: #FF0000;
    }

.footer-bottom {
    padding: 20px 0;
    text-align: center;
}

    .footer-bottom p {
        color: #adb5bd;
    }

    .footer-bottom a {
        color: #adb5bd;
        text-decoration: underline;
    }


/* ================================================= */
/* Media Queries (Responsività)             */
/* ================================================= */
@media (max-width: 768px) {

    /* Header Mobile */
    .site-logo {
        height: 35px;
    }

    .hamburger-menu {
        display: block;
        background: none;
        border: none;
        font-size: 1.5em;
        color: var(--primary-color);
        cursor: pointer;
        z-index: 1001;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        flex-direction: column;
        background-color: white;
        box-shadow: 0 8px 10px rgba(0, 0, 0, 0.1);
        padding: 20px 0;
    }

        .nav-links.active {
            display: flex;
        }

        .nav-links a {
            text-align: center;
            padding: 12px 0;
            border-bottom: 1px solid #eee;
        }

            .nav-links a:last-child {
                border-bottom: none;
                margin-top: 10px;
            }

            .nav-links a:not(.btn-primary)::after {
                display: none;
            }

    /* Hero Mobile */
    .hero-section {
        padding: 80px 0;
        min-height: 400px;
    }

    .hero-content h1 {
        font-size: 2.5em;
    }

    .hero-content p {
        font-size: 1.1em;
    }

    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

        .hero-buttons a {
            margin: 0;
            width: 100%;
            max-width: 250px;
            align-self: center; /* Centra i bottoni */
        }

    /* Dettaglio Libro Mobile */
    .book-detail-layout {
        flex-direction: column;
    }

    .book-cover-sidebar {
        flex: auto;
        order: -1;
    }

    .book-cover-image {
        max-width: 300px;
        margin: 0 auto 20px auto;
    }

    /* Footer Mobile */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-col {
        padding: 20px 0;
    }

    .footer-links ul, .footer-info ul {
        display: inline-block;
        text-align: left;
    }

    /* Contatti Mobile */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* CTA Mobile */
    .cta-newsletter-section {
        padding: 40px 15px;
    }

    .cta-content h2 {
        font-size: 1.8em;
    }

    .cta-content p {
        font-size: 1em;
    }
}

/* ================================================= */
/* Dropdown Menu (Navigazione)                      */
/* ================================================= */

/* Contenitore principale del link "Libri" */
.nav-item.dropdown {
    position: relative;
    display: inline-block; /* Mantiene il dropdown inline con gli altri link */
}

    /* Stile del pulsante/link principale del dropdown */
    .nav-item.dropdown .dropbtn {
        /* Eredita lo stile dai link normali, ma assicuriamo che l'underline funzioni */
        display: inline-block;
        padding: 8px 0;
    }

    /* L'icona freccia */
    .nav-item.dropdown .fa-caret-down {
        margin-left: 5px;
        font-size: 0.8em;
        transition: transform 0.3s;
    }

/* Contenuto del menu a tendina */
.dropdown-content {
    display: none; /* NASCONDI DI DEFAULT */
    position: absolute;
    background-color: white;
    min-width: 250px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 100; /* Assicura che sia sopra tutto il contenuto */
    top: 100%; /* Inizia proprio sotto la barra di navigazione */
    border-top: 3px solid var(--primary-color);
    border-radius: 0 0 5px 5px;
    padding: 5px 0;
}

    /* Stile per i link all'interno del dropdown */
    .dropdown-content a {
        color: var(--text-color);
        padding: 5px 16px;
        text-decoration: none;
        display: block; /* Li impila uno sotto l'altro */
        text-align: left;
        font-weight: normal; /* Meno grassetto dei link principali */
        transition: background-color 0.3s, color 0.3s;
    }

        /* Rimuovi l'underline animato dai link interni al dropdown */
        .dropdown-content a::after {
            display: none;
        }

        .dropdown-content a:hover {
            background-color: var(--background-light); /* Sfondo chiaro all'hover */
            color: var(--primary-color);
        }

/* MOSTRA IL CONTENUTO ALL'HOVER (Desktop) */
.nav-item.dropdown:hover .dropdown-content {
    display: block;
}

/* Ruota la freccia all'hover */
.nav-item.dropdown:hover .fa-caret-down {
    transform: rotate(180deg);
}

/* --- ADATTAMENTO MOBILE (Media Query) --- */
@media (max-width: 768px) {
    /* Su mobile, il dropdown non deve essere assoluto ma a tutta larghezza */
    .nav-item.dropdown {
        width: 100%;
        border-bottom: 1px solid #eee; /* Aggiunge separatore per l'elemento "Libri" */
    }

        .nav-item.dropdown .dropbtn {
            width: 100%;
            text-align: center;
            display: block; /* Prende tutta la larghezza per il click */
        }

    /* Il contenuto del dropdown si espande a tutta larghezza e non è assoluto */
    .dropdown-content {
        position: static;
        width: 100%;
        box-shadow: none;
        border-top: none;
        background-color: #f1f1f1; /* Sfondo leggermente diverso per distinguere */
        padding: 0;
    }

        .dropdown-content a {
            padding-left: 30px; /* Indenta i link di categoria */
            font-size: 0.9em;
            border-bottom: 1px dashed #ddd;
        }

            .dropdown-content a:last-child {
                border-bottom: none;
            }

    /* Su mobile, gestiamo l'apertura tramite JavaScript, non :hover */
    .nav-item.dropdown:hover .dropdown-content {
        display: none; /* Override del comportamento hover desktop */
    }
}

/* Permette a JS di mostrare il dropdown su mobile */
.dropdown-content.show {
    display: block !important;
}

/* ================================================= */
/* Sezione Contenuti Scaricabili (Dettaglio Libro)  */
/* ================================================= */

.download-section {
    margin-top: 50px;
    padding: 30px;
    background-color: var(--background-light);
    border-radius: 10px;
    border: 1px dashed #ced4da; /* Bordo tratteggiato per un look 'freebie' */
}

    .download-section h2 {
        color: var(--primary-color);
        font-size: 1.8em;
        margin-bottom: 10px;
    }

    .download-section p {
        font-size: 1.1em;
        margin-bottom: 30px;
        color: #6c757d;
    }

.download-grid {
    display: grid;
    /* 3 colonne su desktop, impilate su mobile 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;*/
    /* FORZA 2 COLONNE DI UGUALE LARGHEZZA 
    grid-template-columns: 1fr 1fr;
    gap: 20px;*/
    /* FORZA 1 COLONNA A TUTTA LARGHEZZA */
    grid-template-columns: 1fr; 
    gap: 20px;
}

.download-item {
    display: flex;
    align-items: center;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

    .download-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    .download-item i {
        font-size: 2.5em;
        color: var(--secondary-color);
        margin-right: 15px;
        flex-shrink: 0; /* Assicura che l'icona non si rimpicciolisca */
    }

.download-info {
    flex-grow: 1;
    margin-right: 15px;
}

    .download-info h3 {
        font-size: 1.1em;
        margin-bottom: 5px;
        color: var(--text-color);
    }

    .download-info p {
        font-size: 0.85em;
        margin: 0;
        color: #999;
        line-height: 1.3;
    }

/* Stile per i pulsanti di download piccoli */
.btn-secondary.small {
    padding: 8px 12px;
    font-size: 0.9em;
    white-space: nowrap; /* Mantiene il testo su una riga */
    align-self: flex-start; /* Allinea il bottone in alto */
}

    .btn-secondary.small i {
        font-size: 0.9em;
        margin-right: 5px;
        color: var(--primary-color);
    }

/* Media Query per Mobile: Impila il contenuto se necessario */
@media (max-width: 600px) {

    .download-grid {
        grid-template-columns: 1fr;
    }

    .download-item {
        /* Mantiene il layout Icona + Info + Bottone orizzontale */
        flex-direction: row;
        text-align: left;
    }

    .download-item {
        flex-direction: column; /* Impila icona, info e bottone */
        text-align: center;
    }

        .download-item i {
            margin: 0 0 10px 0;
        }

    .download-info {
        margin: 0 0 15px 0;
    }

        .download-info p {
            font-size: 0.9em;
        }

    .btn-secondary.small {
        width: 100%;
    }
}

.book-specs-grid {
    display: grid;
    /* Due colonne su desktop */
    grid-template-columns: 1fr 1fr;
    gap: 15px 30px;
    margin: 30px 0; /* Spazio sopra e sotto le specifiche */
    padding: 20px;
    background-color: var(--background-light); /* Sfondo leggero per evidenziare */
    border-radius: 8px;
}

.spec-item {
    display: flex; /* Utilizza flex per allineare etichetta e valore */
    /*justify-content: space-between;*/
    padding-bottom: 5px;
    border-bottom: 1px dotted #ccc; /* Linea tratteggiata per separazione */
}

.spec-label {
    font-weight: bold;
    color: var(--text-color);
    margin-right: 10px;
}

.spec-value {
    color: var(--primary-color);
    font-weight: 600;
    text-align: left;
}


/* --- Cookie Banner Layer --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(33, 37, 41, 0.95); /* Nero elegante semitrasparente */
    color: white;
    z-index: 9999; /* Sempre sopra a tutto */
    padding: 20px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    display: block; /* Verrà gestito da JS */
}

.cookie-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cookie-text p {
    font-size: 15px;
    margin-bottom: 20px;
    line-height: 1.4;
    padding: 0 30px;
}

.cookie-text a {
    color: var(--secondary-color);
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
}

.btn-cookie-link, .btn-cookie-close {
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: 0.3s;
}

.btn-cookie-link {
    background-color: transparent;
    border: 1px solid white;
    color: white;
}

.btn-cookie-close {
    background-color: var(--secondary-color);
    color: white;
}

    .btn-cookie-close:hover {
        background-color: #1e7e34;
    }

/* La X in alto a destra */
.cookie-x-close {
    position: absolute;
    top: -10px;
    right: 10px;
    font-size: 24px;
    color: #999;
    text-decoration: none;
}

/* Responsive: su Desktop mettiamo tutto su una riga */
@media (min-width: 992px) {
    .cookie-container {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    .cookie-text p {
        margin-bottom: 0;
        padding: 0;
    }

    .cookie-actions {
        width: auto;
    }
}


/* --- Media Query per Mobile: Impilamento --- */

@media (max-width: 768px) {
    .book-specs-grid {
        /* Una sola colonna su mobile */
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 20px 0;
    }
}


