.book-carousel-wrapper {
    position: relative;
}

.book-carousel {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 0 auto;
    padding: 8px 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: fit-content;
    max-width: 100%;
}

.book-carousel::-webkit-scrollbar {
    display: none;
}

.book-item {
    position: relative;
    flex-shrink: 0;
    width: 78px;
    height: 101px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 20px;
}

.book-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: auto;
    text-decoration: none;
    transition: transform 0.2s ease;
    outline: none;
}

.book-item a:focus,
.book-item a:active {
    outline: unset;
    border: none;
    box-shadow: none;
}


.book-logo {
    width: 67px;
    height: 67px;
    border: 4px solid white;
    border-radius: 50%;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: transparent;
    aspect-ratio: 1 / 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    padding: 7px;
    box-sizing: border-box;
}

.book-logo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
}

.book-item a:hover {
    transform: scale(1.05);
}

.book-item:hover .book-logo {
    border-color: #f3f4f6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.rating {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #FFFFFF;
    color: #333333;
    font-weight: bold;
    font-size: 14px;
    padding: 0px 10px;
    border-radius: 999px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.2s ease;
    white-space: nowrap;
    min-width: 50px;
}

.rating-number {
    color: #333333;
    font-weight: bold;
}

.rating-star svg {
    width: 14px;
    height: 14px;
    margin-bottom: 2px;
}

.rating:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.all-anchor {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 78px;
}

.all-anchor-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 78px;
    padding: 8px 12px;
    text-decoration: underline;
    color: #272a2c;
    font-weight: 500;
    font-size: 14px;
    text-align: center;
    transition: color 0.2s ease, text-decoration 0.2s ease;
    position: relative;
}

.all-anchor-link:hover {
    color: #272a2c;
    text-decoration: underline;
    transform: unset !important;
}

.all-anchor-link::after {
    content: url("data:image/svg+xml,%3Csvg width='12' height='20' viewBox='0 0 12 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 2L10 10L2 18' stroke='%2325963C' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    display: inline-block;
    width: 12px;
    height: 20px;
    margin-left: 13px;
    position: relative;
    transition: transform 0.2s ease;
}

.all-anchor-text {
    line-height: 1.2;
    max-width: 80px;
}

/* Scroll buttons */
.book-carousel-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s ease;
    color: #374151;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.book-carousel-scroll-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-50%) scale(1.05);
}

.book-carousel-scroll-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.book-carousel-scroll-left {
    left: 3px;
    background: #fff;
}

.book-carousel-scroll-right {
    right: 3px;
    background: #fff;
}

/* Shadow gradients as separate elements */
.book-carousel-wrapper::before {
    content: '';
    position: absolute;
    left: 0px;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 100px;
    background: linear-gradient(to right, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
    pointer-events: none;
    z-index: 15;
    display: var(--show-left-shadow, none);
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.book-carousel-wrapper::after {
    content: '';
    position: absolute;
    right: 0px;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 100px;
    background: linear-gradient(to left, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
    pointer-events: none;
    z-index: 15;
    display: var(--show-right-shadow, none);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.home .book-carousel-wrapper::before {
    background: linear-gradient(to right, rgba(237, 237, 234, 1), rgba(237, 237, 234, 0));
}

.home .book-carousel-wrapper::after {
    background: linear-gradient(to left, rgba(237, 237, 234, 1), rgba(237, 237, 234, 0));
}

/* Medium screens and up */
@media (min-width: 768px) {
    .book-carousel {
        justify-content: flex-start;
        gap: 0;
        padding: 8px 8px;
    }
    
    .book-item {
        width: 95px;
        height: auto;
        margin-bottom: 10px;
    }
    
    .book-logo {
        width: 83px;
        height: 83px;
        aspect-ratio: 1 / 1;
    }
    
    .book-logo--placeholder {
        font-size: 18px;
    }
    
    .rating {
        font-size: 13px;
        padding: 0px 8px;
        border-radius: 999px;
        bottom: -7px;
        min-width: 48px;
    }
    
    .rating-star svg {
        width: 14px;
        height: 14px;
        margin-bottom: 2px;
    }
    
    .all-anchor {
        min-width: 95px;
    }
    
    .all-anchor-link {
        min-height: 95px;
        padding: 10px 12px;
        font-size: 15px;
    }
    
    .all-anchor-text {
        max-width: 100px;
    }
    
    /* Scroll buttons - medium screens */
    .book-carousel-scroll-btn {
        width: 30px;
        height: 30px;
    }
    
    .book-carousel-scroll-left {
        left: 3px;
    }
    
    .book-carousel-scroll-right {
        right: 3px;
    }
    
    /* Shadow gradients - medium screens */
    .book-carousel-wrapper::before {
        left: 0px;
        width: 120px;
        height: 110px;
    }
    
    .book-carousel-wrapper::after {
        right: 0px;
        width: 120px;
        height: 110px;
    }
}




/* Responsive adjustments for very small screens */
@media (max-width: 767px) {
    .book-carousel {
        padding: 8px 8px;
        gap: 4px;
    }
    
    .book-item {
        width: 80px;
        height: 74px;
        padding-top: 6px;
        margin-bottom: 7px;
    }
    
    .book-logo {
        width: 68px;
        height: 68px;
        border-width: 4px;
        aspect-ratio: 1 / 1;
    }
    
    .book-logo--placeholder {
        font-size: 12px;
    }
    
    .rating {
        font-size: 14px;
        padding: 0px 10px;
        border-radius: 999px;
        bottom: -6px;
        min-width: 50px;

    }
    
    .rating-star svg {
        width: 14px;
        height: 14px;
        margin-bottom: 2px;
    }
    
    .all-anchor {
        min-width: 80px;
    }
    
    .all-anchor-link {
        min-height: 80px;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .all-anchor-link::after {
        content: url("data:image/svg+xml,%3Csvg width='10' height='16' viewBox='0 0 10 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 2L8 8L2 14' stroke='%2325963C' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        width: 10px;
        height: 16px;
        margin-left: 4px;
    }
    
    .all-anchor-text {
        max-width: 60px;
    }
    
    /* Scroll buttons - small screens */
    .book-carousel-scroll-btn {
        width: 30px;
        height: 30px;
    }
    
    .book-carousel-scroll-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .book-carousel-scroll-left {
        left: 3px;
    }
    
    .book-carousel-scroll-right {
        right: 3px;
    }
    
    /* Shadow gradients - small screens */
    .book-carousel-wrapper::before {
        left: 0;
        width: 90px;
        height: 80px;
    }
    
    .book-carousel-wrapper::after {
        right: -1px;
        width: 90px;
        height: 80px;
    }
}