.book-shelf a {
    text-decoration: none;
}

.book-shelf {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem; /* Espacement uniforme Netflix-like */
    overflow-x: auto; /* Scroll horizontal natif */
    scrollbar-width: thin; /* Fine pour Firefox */
    scrollbar-color: #6b584c transparent; /* Thumb brun, track transparent (Firefox) */
    padding: 0.5rem 0; /* Réduit pour plus de compacité */
    background: 
        radial-gradient(ellipse at center, rgba(245,240,230,0.1) 0%, rgba(107,88,76,0.05) 50%, transparent 100%); /* Élégant : Dégradé radial papier patiné/beige dilué */
    border-radius: 8px;
    margin-bottom: 0.5rem; /* Espace réduit pour barre scroll en dessous */
    min-height: 405px; /* <- Modifie cette valeur (ex. : 400px, 450px) pour plus d'espace */
}

.book-shelf::-webkit-scrollbar {
    height: 12px; /* Hauteur augmentée pour plus grande */
}

.book-shelf::-webkit-scrollbar-track {
    background: transparent; /* Transparent */
}

.book-shelf::-webkit-scrollbar-thumb {
    background: #6b584c; /* Brun thématique */
    border-radius: 6px; /* Ajusté pour taille plus grande */
    transition: background 0.3s ease;
}

.book-shelf::-webkit-scrollbar-thumb:hover {
    background: #8b4513; /* Plus foncé au hover */
}

.book-shelf .book {
    flex-shrink: 0; /* Fixe taille pour scroll fluide */
    width: 225px;
    height: 350px;
    position: relative;
    text-align: center;
    transition: none; /* Retour original : pas de scale/ombre extra */
}

.book-cover {
    position: absolute;
    z-index: 1;
    width: 100%;
    height: 100%;
    transform-origin: left center;
    -webkit-transform-origin: left center;
    background-size: cover;
    border-radius: 4px;
    box-shadow: 
        inset 4px 1px 3px #ffffff60,
        inset 0 -1px 2px #00000080,
        2px 0 4px rgba(0,0,0,0.2);
    transition: all 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    -webkit-transition: all 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.book .book-cover {
    background-size: 100% 100%;
}

.effect {
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 100%);
    border-radius: 2px 0 0 2px;
    transition: all 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.light {
    width: 90%;
    height: 100%;
    position: absolute;
    border-radius: 4px; 
    background-image: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.15) 100%);
    top: 0;
    right: 0;
    opacity: .1;
    transition: all 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    -webkit-transition: all 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.book:hover {
    cursor: pointer;
    overflow: visible; /* Permet rotation sans coupure */
    /* Retour original : Pas de scale ou ombre extra */
}

.book:hover .book-cover {
    transform: perspective(2000px) rotateY(-60deg);
    -webkit-transform: perspective(2000px) rotateY(-60deg);
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    box-shadow: 
        inset 4px 1px 3px #ffffff60,
        inset 0 -1px 2px #00000080,
        -8px 0px 8px -4px #00000040,
        0 0 15px rgba(0,0,0,0.1);
}

.book:hover .effect {
    width: 15px;
    background: linear-gradient(to right, rgba(139,69,19,0.6) 0%, rgba(139,69,19,0.2) 50%, rgba(0,0,0,0) 100%);
}

.book:hover .light {
    opacity: 0.8;
    width: 80%;
    background-image: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.25) 100%);
}

.book-inside {
    width: calc(100% - 4px);
    height: 97%;
    position: relative;
    left: 2px;
    top: 0%;
    border: none;
    border-radius: 0;
    background: white;
    box-shadow: 
        -5px 20px 20px -5px #00000030,
        inset -8px 0 8px rgba(139,69,19,0.4),
        inset 1px 0 0 rgba(255,255,255,0.9),
        inset 2px 0 0 rgba(240,240,240,0.6),
        inset 3px 0 0 rgba(255,255,255,0.9),
        inset 4px 0 0 rgba(240,240,240,0.6),
        inset 5px 0 0 rgba(255,255,255,0.9),
        0 2px 4px rgba(0,0,0,0.1);
    transition: all 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-style: preserve-3d;
    overflow: hidden;
}

.book:hover .book-inside {
    box-shadow: 
        -5px 20px 20px -5px #00000030,
        inset -8px 0 8px rgba(139,69,19,0.6),
        inset 3px 0 0 rgba(255,255,255,0.95),
        inset 4px 0 0 rgba(240,240,240,0.7),
        inset 5px 0 0 rgba(255,255,255,0.95),
        inset 6px 0 0 rgba(240,240,240,0.7),
        0 2px 4px rgba(0,0,0,0.1);
}

.excerpt {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease;
    background: white;
    overflow: hidden;
}

.excerpt-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/decorations/vintage_book_paper_texture.jpg'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: sepia(0.1) contrast(1.05);
    opacity: 0.85;
    z-index: 1;
}

.excerpt-text {
    position: relative;
    z-index: 2;
    padding: 20px;
    height: 100%;
    overflow-y: auto;
    color: black;
    font-family: 'Times New Roman', serif;
    font-size: 11px;
    line-height: 1.4;
    text-align: justify;
    background: rgba(255, 255, 255, 0.7);
}

.excerpt-text p {
    margin: 0 0 8px 0;
}

.book:hover .excerpt {
    opacity: 1;
}

.title {
    font-size: 22px;
    width: 100%;
    color: #333;
    text-align: center;
    position: absolute;
    top: -30px;
    height: 1px;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transition: all 1s ease-in-out;
    -webkit-transition: all 1s ease-in-out;
}

.title p {
    width: 100%;
    margin: 0;
    line-height: 1.3;
}

/* Supprime affichage title sur hover */
.book:hover .title {
    opacity: 0 !important;
    display: none !important;
}

/* UX luxe : Titres collections Netflix-like (bold, hover focus) */
.collection-title {
    font-family: 'Times New Roman', serif;
    font-size: 1.75rem;
    font-weight: bold; /* Plus impactant */
    color: var(--bs-primary);
    margin-bottom: 0.5rem; /* Réduit pour plus de compacité */
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.collection-title:hover {
    color: #8b4513; /* Brun plus foncé au hover */
}

.collection-title::after {
    content: '';
    flex: 1;
    height: 2px; /* Plus épais pour Netflix vibe */
    background: linear-gradient(to right, transparent, var(--bs-primary), transparent);
}

.collection-badge {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background: rgba(107,88,76,0.2); /* Subtil brun */
}

/* Intro teaser */
.catalog-intro {
    text-align: center;
    padding: 3rem 0;
    background-color: var(--bs-light);
    margin-bottom: 2rem;
    border-radius: 8px;
}

.catalog-intro h2 {
    font-family: 'Times New Roman', serif;
    font-size: 2.25rem;
    color: var(--bs-primary);
    margin-bottom: 1rem;
}

.catalog-intro p {
    font-size: 1.1rem;
    color: var(--bs-body-color);
    max-width: 600px;
    margin: 0 auto;
}

/* Responsive : Mobile-first Netflix (swipe facile) */
@media (max-width: 768px) {
    .book-shelf {
        gap: 0.75rem;
        padding: 0.5rem 0; /* Réduit pour mobile */
    }
    .book {
        width: 180px; /* Plus compact mobile */
        height: 280px;
    }
}

/* Desktop large : Plus compact pour max visibilité */
@media (min-width: 1200px) {
    .book-shelf {
        gap: 0.75rem; /* FIX : Moins d'espace pour + de livres visibles */
    }
}

/* Mobile touch : Pas de hover 3D, excerpt sur tap */
@media (hover: none) and (pointer: coarse) {
    .book-detail-btn {
        background: var(--bs-primary) !important;
        color: white !important;
        border: none !important;
        padding: 0.75rem 1.5rem !important;
        border-radius: 50px !important;
        text-align: center !important;
        font-weight: bold !important;
        text-decoration: none !important;
        display: block !important;
        margin-top: 1rem !important;
    }
    .book-detail-btn:hover {
        background: #8d8a84 !important;
    }
    .book.hovered .excerpt {
        opacity: 1;
    }
    .book-shelf .book {
        touch-action: pan-x pan-y; /* FIX : Permet scroll vertical ET horizontal sur les livres */
    }
    .book:hover,
    .book.hovered {
        transform: none !important;
        overflow: visible;
    }
}

/* Compactage global pour max visibilité */
.catalog-compact .book-shelf {
    padding: 0.5rem 0; /* Réduit globalement */
}

.catalog-compact .row {
    margin-bottom: 0.5rem; /* Réduit l'espace entre rows */
}

/* Boutons de navigation pour étagères (gauche/droite, raffinés) - Conservé pour futur, mais invisibles sans HTML */
.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(145deg, rgba(107,88,76,0.9), rgba(107,88,76,0.7)); /* Dégradé brun mat pour raffinement */
    color: white;
    border: 1px solid rgba(139,69,19,0.3); /* Bordure subtile intérieure */
    border-radius: 50%;
    width: 50px; /* Taille augmentée */
    height: 50px; /* Taille augmentée */
    cursor: pointer;
    z-index: 10;
    font-size: 20px; /* Icônes plus fines et élégantes */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Transition fluide raffinée */
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(107,88,76,0.2); /* Ombre subtile pour profondeur */
}

.scroll-btn:hover {
    background: linear-gradient(145deg, rgba(139,69,19,1), rgba(139,69,19,0.8)); /* Dégradé plus foncé au hover */
    transform: translateY(-50%) rotate(5deg) scale(1.05); /* Rotation légère + scale pour dynamisme élégant */
    box-shadow: 0 4px 12px rgba(139,69,19,0.3); /* Ombre accentuée */
}

.scroll-btn.left-btn {
    left: -25px; /* Position à l'extrémité gauche */
}

.scroll-btn.right-btn {
    right: -25px; /* Position à l'extrémité droite */
}

@media (max-width: 768px) {
    .scroll-btn {
        width: 40px;
        height: 40px;
        font-size: 18px; /* Ajusté pour mobile */
    }
    .scroll-btn.left-btn {
        left: -20px;
    }
    .scroll-btn.right-btn {
        right: -20px;
    }
    .catalog-compact .book-shelf {
        padding: 0.5rem 0; /* Encore plus compact mobile */
    }
}

/* Ajout à catalog-custom.css - Styles globaux pour visibilité */
.desktop-only {
    display: block;
}
.mobile-only {
    display: none;
}
@media (max-width: 768px) {
    .desktop-only { display: none; }
    .mobile-only { display: block; }
    /* ... (vos règles inline actuelles, sans la media query wrapper) */
    .book-shelf { gap: 0.75rem; padding: 0.5rem 0; }
    .book { width: 180px; height: 280px; }
    /* Intégrez le reste des règles inline ici */
}