/* ---- LAYOUT CATALOGO ---- */

.CatalogoLayout {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.CatalogoContent {
    flex: 1;
    min-width: 0;
}

/* ---- SIDEBAR CATEGORIE ---- */

.CategorieSidebar {
    width: 200px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #d0e4f0;
}

.SidebarTitle {
    font-weight: 900;
    font-size: 0.8rem;
    padding: 10px 14px;
    background-color: #1a4a7a;
    color: white;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.SidebarItem {
    padding: 10px 14px;
    font-size: 0.85rem;
    border-bottom: 1px solid #e8f0f8;
}

.SidebarItem a {
    color: #333;
    display: block;
    text-decoration: none;
}

.SidebarItem:hover { background-color: #e8f0f8; }
.SidebarItem:hover a { color: #1a4a7a; }

.SidebarAll { background-color: #f5f8fc; font-weight: 700; }

.SidebarSelected {
    background-color: #5bb8d4;
    font-weight: 700;
}

.SidebarSelected a { color: white; }
.SidebarSelected:hover { background-color: #4aa8c4; }

.SidebarCount { color: #888; font-size: 0.75rem; margin-left: 4px; }
.SidebarSelected .SidebarCount { color: #e0f4fa; }

/* ---- GRIGLIA (riusa classi da Index.css) ---- */

.GrigliaLibri {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.CardLibro {
    background: #fff;
    border: 1px solid #e0e8f0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
}

.CardLibro:hover {
    box-shadow: 0 6px 20px rgba(26,74,122,0.13);
    transform: translateY(-3px);
}

.CardImmagine {
    position: relative;
    background: #e8f0f8;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.CardImmagine a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.CardImmagine img {
    max-height: 190px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
}

.BadgeEsaurito {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #c0392b;
    color: white;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 3px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    z-index: 1;
}

.CardTesto {
    padding: 10px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.CardSoggetto {
    font-size: 0.65rem;
    color: #5bb8d4;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.CardTitolo { font-size: 0.85rem; font-weight: 700; color: #1a4a7a; line-height: 1.3; flex: 1; }
.CardTitolo a { color: #1a4a7a; }
.CardTitolo a:hover { color: #5bb8d4; }

.CardAutore { font-size: 0.75rem; color: #666; }

.CardPrezzo { font-size: 1rem; font-weight: 900; color: #1a4a7a; margin-top: 4px; }

.CardFooter { padding: 0 12px 12px 12px; }

.BotDettaglio {
    display: block;
    width: 100%;
    padding: 8px;
    background: #e8a020;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s;
}

.BotDettaglio:hover { background: #d4911a; color: white; }

.BotEsaurito {
    display: block;
    width: 100%;
    padding: 8px;
    background: #e0e0e0;
    color: #999;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
}

/* ---- PAGINAZIONE ---- */

.Paging {
    margin-top: 20px;
    font-size: larger;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px dotted #aac6e0;
    padding-top: 24px;
}

.Button {
    background-color: #1a4a7a;
    color: white;
    height: 35px;
    display: inline-block;
    border-radius: 5px;
    font-size: large;
    margin-left: 8px;
    margin-right: 8px;
    border: none;
    cursor: pointer;
    padding: 0 12px;
}

.Button:hover { background-color: #5bb8d4; }

.Pagine {
    font-size: large;
    padding: 6px 10px;
    border: 1px solid #1a4a7a;
    border-radius: 4px;
    margin: 0 2px;
    cursor: pointer;
    color: #1a4a7a;
    background: white;
}

.Pagine:hover { background: #e8f0f8; }

/* ---- TITOLO RICERCA ---- */

.CatalogoTitolo {
    font-size: 1rem;
    font-weight: 900;
    color: #1a4a7a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 3px solid #5bb8d4;
    display: block;
}

/* ---- RESPONSIVE ---- */

@media only screen and (max-width: 499px) {
    .CatalogoLayout { flex-direction: column; }
    .CategorieSidebar {
        width: 100%;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .SidebarTitle { display: none; }
    .SidebarItem {
        flex-shrink: 0;
        border-bottom: none;
        border-right: 1px solid #e8f0f8;
        white-space: nowrap;
    }
    .SidebarAll { border-radius: 6px 0 0 6px; }
    .GrigliaLibri { grid-template-columns: repeat(2, 1fr); }
}

@media only screen and (min-width: 500px) {
    .GrigliaLibri { grid-template-columns: repeat(3, 1fr); }
}

@media only screen and (min-width: 900px) {
    .GrigliaLibri { grid-template-columns: repeat(4, 1fr); }
}
