.category-menu {
    font-size: 14px;
    line-height: 1.5;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 10px;
}

.booktype-section {
    margin-bottom: 15px;
    border-radius: 6px;
    overflow: hidden;
}

.booktype-header,
.depth1-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    background: #f8f9fa;
}

.booktype-header.collapsed,
.depth1-header.collapsed {
    background: #fff;
}

.booktype-header:hover,
.depth1-header:hover {
    background: #e7f4ff;
}

.toggle-btn {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    color: #1f8ce6;
    font-size: 12px;
    border: 1px solid #1f8ce6;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background: #1f8ce6;
    color: white;
    transform: rotate(180deg);
}

.booktype-title {
    font-size: 15px;
    font-weight: bold;
    color: #1f8ce6;
    flex: 1;
}

.depth1-title {
    font-size: 14px;
    color: #333;
    flex: 1;
}

.category-container,
.category-list {
    margin: 5px 0;
    padding-left: 20px;
}

.depth1-section {
    margin: 5px 0;
}

.depth2-item {
    margin: 5px 0;
}

.category-list {
    list-style: none;
    padding-left: 15px;
}

.category-list a {
    display: block;
    padding: 8px 15px;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.category-list a:hover {
    color: #1f8ce6;
    background: #e7f4ff;
}

.category-list a.active {
    color: #1f8ce6;
    background: #e7f4ff;
    font-weight: 500;
}

.category-count {
    font-size: 12px;
    color: #666;
    background: #eee;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-container.show,
.category-list.show {
    animation: slideDown 0.3s ease;
}

@media (max-width: 991px) {
    .category-menu {
        font-size: 13px;
        padding: 5px;
    }
    
    .booktype-header,
    .depth1-header {
        padding: 10px;
    }
    
    .toggle-btn {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
} 

/* 책 리스트 스타일 */
.book-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.book-item {
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
}

.book-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(31, 140, 230, 0.15);
}

.book-cover {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background: #f8f9fa;
    transition: transform 0.3s ease;
}

.book-item:hover .book-cover {
    transform: scale(1.05);
}

.book-info {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom, rgba(255,255,255,0.95), #fff);
}

.book-title {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #333 !important;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    height: 3em;
    word-break: keep-all;
    text-decoration: none !important;
}

.book-item:hover .book-title {
    color: #1f8ce6 !important;
}

.book-author {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
}

.book-price {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #1f8ce6;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

/* 반응형 조정 */
@media (max-width: 768px) {
    .book-list {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
        padding: 15px 0;
    }

    .book-info {
        padding: 12px;
    }

    .book-title {
        font-size: 15px;
        height: 2.8em;
    }

    .book-author {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .book-price {
        font-size: 15px;
        padding-top: 8px;
    }
}

/* 연관 도서 섹션 스타일 */
.related-books {
    margin-top: 40px;
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
}

.related-books h2 {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.related-books .book-list {
    display: flex;
    gap: 20px;
    padding: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.related-books .book-list::-webkit-scrollbar {
    display: none;
}

.related-books .book-item {
    flex: 0 0 180px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}

.related-books .book-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(31, 140, 230, 0.15);
}

.related-books .book-cover {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background: #f8f9fa;
    transition: transform 0.3s ease;
}

.related-books .book-item:hover .book-cover {
    transform: scale(1.05);
}

.related-books .book-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom, rgba(255,255,255,0.95), #fff);
}

.related-books .book-title {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #333 !important;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    height: 2.8em;
    word-break: keep-all;
    text-decoration: none !important;
}

.related-books .book-item:hover .book-title {
    color: #1f8ce6 !important;
}

.related-books .book-author {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-books .book-price {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #1f8ce6;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

/* 스크롤 버튼 스타일 */
.scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #eee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scroll-button:hover {
    background: #1f8ce6;
    color: white;
    border-color: #1f8ce6;
}

.scroll-left {
    left: 10px;
}

.scroll-right {
    right: 10px;
}

/* 하이퍼링크 스타일 개선 */
a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #1f8ce6;
}

@media (max-width: 991px) {
    .related-books {
        padding: 20px;
    }

    .related-books .book-item {
        flex: 0 0 150px;
    }

    .related-books .book-info {
        padding: 12px;
    }

    .related-books .book-title {
        font-size: 14px;
        height: 2.6em;
    }

    .related-books .book-author {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .related-books .book-price {
        font-size: 14px;
        padding-top: 6px;
    }

    .scroll-button {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 575px) {
    .related-books .book-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Pretendard 폰트 추가 */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");